Skip to content

Commit

Permalink
test files
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDarsa committed Jun 30, 2024
1 parent febb210 commit 9f9d661
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
7 changes: 6 additions & 1 deletion cypress/e2e/organizations/notifications.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ describe('Org Notifications page', () => {
slack: { name: slackName },
} = testData.organizations.notifications;

cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(webhooknName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(emailName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(teamsName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(rocketChatName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(slackName);
});
});
});
4 changes: 3 additions & 1 deletion cypress/e2e/rbac/maintainer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const task = new TaskAction();
describe('MAINTAINER permission test suites', () => {
beforeEach(() => {
cy.login(Cypress.env('user_maintainer'), Cypress.env('user_maintainer'));
registerIdleHandler('idle');
});

context('Settings', () => {
Expand All @@ -39,6 +40,7 @@ describe('MAINTAINER permission test suites', () => {

it('Deletes SSH key', () => {
cy.visit(`${Cypress.env('url')}/settings`);
cy.waitForNetworkIdle('@idle', 500);

settings.deleteSshKey(testData.ssh.name);
});
Expand Down Expand Up @@ -303,4 +305,4 @@ describe('MAINTAINER permission test suites', () => {
task.doCancelTask();
});
});
});
});
36 changes: 28 additions & 8 deletions cypress/support/actions/deployment/DeploymentAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,37 @@ export default class deploymentAction {
.should('include.text', 'There was a problem cancelling deployment.');
}
doLogViewerCheck() {
deployment.getAccordionHeadings().then($headings => {
for (let i = 0; i < $headings.length - 1; i++) {
cy.wrap($headings.eq(i)).click();
}

for (let i = 0; i < $headings.length - 1; i++) {
cy.wrap($headings.eq(i)).next().next().getBySel('section-details').getBySel('log-text').should('exist');
cy.get('body').then($body => {
if ($body.find('.accordion-heading').length > 0) {
// parsing went ok
cy.get('.accordion-heading')
.each(($heading, index, $headings) => {
if (index < $headings.length - 1) {
cy.wrap($heading).click();
}
})
.then($headings => {
for (let i = 0; i < $headings.length - 1; i++) {
cy.wrap($headings.eq(i))
.next()
.next()
.getBySel('section-details')
.then($sectionDetails => {
if ($sectionDetails.find('.log-text').length > 0) {
cy.wrap($sectionDetails).find('.log-text').should('exist');
} else {
cy.wrap($sectionDetails).find('.log-viewer').should('not.be.empty');
}
});
}
});
} else {
// parsing failed
cy.get('.log-viewer').should('not.be.empty');
}
});
}
navigateToRunningDeployment() {
cy.getBySel('deployment-row').getBySel('running').first().click();
}
}
}
3 changes: 1 addition & 2 deletions cypress/support/actions/settings/SettingsAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export default class SettingAction {
}

deleteSshKey(name: string) {
settings.getDeleteBtn().click();

settings.getDeleteBtn().should('be.visible').click({ force: true, multiple: true });
cy.contains(name).should('not.exist');
}
}

0 comments on commit 9f9d661

Please sign in to comment.