Skip to content

Commit 5618412

Browse files
committed
Use get with a timeout instead of a hardcoded wait
1 parent 0034f60 commit 5618412

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ describe('Automation > Embedded Automate > Explorer', () => {
2929
cy.get('[name="description"]').type('This is a test NameSpace');
3030
cy.get('.bx--btn--primary').contains('Add').click();
3131

32-
cy.wait(1000); // Need this wait or else namespace doesn't get added properly
32+
// Wait for namespace to be visible
33+
cy.get('[title="Automate Namespace: TestNameSpace"]', {timeout: 1000}).should('be.visible')
3334
});
3435

3536
beforeEach(() => {

cypress/e2e/ui/Overview/reports.cy.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,10 @@ describe('Overview > Reports Tests', () => {
337337
cy.get('#form_filter_div > .form-horizontal > :nth-child(1) > .col-md-8 > .btn-group > .btn').click({ force: true });
338338
cy.get('#form_filter_div > .form-horizontal > :nth-child(1) > .col-md-8 > .btn-group > .open > .dropdown-menu > [data-original-index="1"] > a').then((option) => {
339339
cy.get(option).click({ force: true }).then(() => {
340-
cy.wait(5000);
341-
cy.get('#form_filter_div > .form-horizontal > :nth-child(2) > .col-md-8 > .btn-group > .btn').click({ force: true });
340+
cy.get('#form_filter_div > .form-horizontal > :nth-child(2) > .col-md-8 > .btn-group > .btn', {timeout: 5000}).click({ force: true });
342341
cy.get('#form_filter_div > .form-horizontal > :nth-child(2) > .col-md-8 > .btn-group > .open > .dropdown-menu > [data-original-index="1"] > a').then((option) => {
343342
cy.get(option).click({ force: true }).then(() => {
344-
cy.wait(5000);
345-
cy.get(':nth-child(3) > .col-md-8 > .btn-group > .btn').click({ force: true });
343+
cy.get(':nth-child(3) > .col-md-8 > .btn-group > .btn', {timeout: 5000}).click({ force: true });
346344
cy.get(':nth-child(3) > .col-md-8 > .btn-group > .open > .dropdown-menu > [data-original-index="1"] > a').then((option) => {
347345
cy.get(option).click({ force: true });
348346
reportFilter = option[0].innerText;

cypress/e2e/ui/menu.cy.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,7 @@ describe('Menu', () => {
492492

493493
it('About', () => {
494494
cy.menu('Settings', 'About').then(() => {
495-
cy.wait(50000); // Need to wait before getting the modal container or else the test fails
496-
cy.get('.bx--modal-container');
495+
cy.get('.bx--modal-container', {timeout: 10000});
497496
});
498497
});
499498
});

0 commit comments

Comments
 (0)