Skip to content

Commit 2cae075

Browse files
authored
Merge pull request #9447 from jrafanie/cypress-fixes
Cypress fixes around timing and element existance
2 parents 4dce1e6 + 5618412 commit 2cae075

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
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/Automation/Embedded-Automate/customization.cy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Automation > Embedded Automate > Customization', () => {
2828
// creates a dialog
2929
cy.get('[title="Configuration"]').click({force: true});
3030
cy.get('[title="Add a new Dialog"]').click({force: true});
31-
cy.get('[name="name"]').type('Test User');
31+
cy.get('[name="name"]').type('Test User', {force: true});
3232
cy.get('[name="description"').type('Test Description');
3333
cy.get('[name="dialog_type"]').select('Configured System Provision');
3434
cy.get('[class="CodeMirror-lines"]').type(':Buttons:');
@@ -72,8 +72,8 @@ describe('Automation > Embedded Automate > Customization', () => {
7272
// creates a dialog
7373
cy.get('[title="Configuration"]').click({force: true});
7474
cy.get('[title="Add a new Dialog"]').click({force: true});
75-
cy.get('[name="name"]').type('Test User');
76-
cy.get('[name="description"').type('Test Description');
75+
cy.get('[name="name"]').type('Test User', {force: true});
76+
cy.get('[name="description"').type('Test Description', {force: true});
7777
cy.get('[name="dialog_type"]').select('Configured System Provision');
7878
cy.get('[class="CodeMirror-lines"]').type(':Buttons:');
7979
cy.get('[class="btnRight bx--btn bx--btn--primary"]').click({force: true});
@@ -127,7 +127,7 @@ describe('Automation > Embedded Automate > Customization', () => {
127127
// creates a dialog
128128
cy.get('[title="Configuration"]').click({force: true});
129129
cy.get('[title="Add a new Dialog"]').click({force: true});
130-
cy.get('[name="name"]').type('Test User');
130+
cy.get('[name="name"]').type('Test User', {force: true});
131131
cy.get('[name="description"').type('Test Description');
132132
cy.get('[name="dialog_type"]').select('Configured System Provision');
133133
cy.get('[class="CodeMirror-lines"]').type(':Buttons:');

cypress/e2e/ui/Overview/Chargeback/rates.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ describe('Rates', () => {
239239
cy.get('#fixed_rate_1_0').clear().type('1');
240240
cy.get('#per_time_2').select('Monthly');
241241
cy.get('#per_unit_2').select('KB');
242-
cy.get('#finish_2_0').clear();
242+
cy.get('#finish_2_0').clear({force: true});
243243
cy.get('#variable_rate_2_0').clear({force: true }).type('100', { force: true });
244244
cy.get('#buttons_on > .btn-primary').click({ force: true });
245245
}).then(() => {

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
});

cypress/e2e/ui/searchbox.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ describe('Search box', () => {
2626
cy.expect_no_search_box();
2727
});
2828

29-
it('Is not present on list view page', () => {
29+
it('Is present on list view page', () => {
3030
cy.menu('Control', 'Alerts');
31-
cy.expect_no_search_box();
31+
cy.expect_search_box();
3232
});
3333
});

0 commit comments

Comments
 (0)