Skip to content

Commit 933f0e3

Browse files
authored
Fix ISM e2e tests for OS 2.9: conditional toast dismiss and flexible column count (#2124)
1 parent 0b11787 commit 933f0e3

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cypress/integration/plugins/index-management-dashboards-plugin/managed_indices_spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('Managed indices', () => {
2929
// Common text to wait for to confirm page loaded, give up to 60 seconds for initial load
3030
cy.contains('Edit rollover alias', { timeout: 60000 });
3131

32-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
32+
cy.get('body').then(($body) => { if ($body.find('[data-test-subj="toastCloseButton"]').length) { cy.get('[data-test-subj="toastCloseButton"]').click({ force: true }); } });
3333
});
3434

3535
describe('can have policies removed', () => {
@@ -90,7 +90,7 @@ describe('Managed indices', () => {
9090
// Wait up to 5 seconds for the managed index to execute
9191
// eslint-disable-next-line cypress/no-unnecessary-waiting
9292
cy.wait(5000).reload();
93-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
93+
cy.get('body').then(($body) => { if ($body.find('[data-test-subj="toastCloseButton"]').length) { cy.get('[data-test-subj="toastCloseButton"]').click({ force: true }); } });
9494

9595
// Confirm managed index successfully initialized the policy
9696
cy.contains('Successfully initialized', { timeout: 20000 });
@@ -100,7 +100,7 @@ describe('Managed indices', () => {
100100
// Wait up to 5 seconds for managed index to execute
101101
// eslint-disable-next-line cypress/no-unnecessary-waiting
102102
cy.wait(5000).reload();
103-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
103+
cy.get('body').then(($body) => { if ($body.find('[data-test-subj="toastCloseButton"]').length) { cy.get('[data-test-subj="toastCloseButton"]').click({ force: true }); } });
104104

105105
// Confirm we have a Failed execution, wait up to 20 seconds as OSD takes a while to load
106106
cy.contains('Failed', { timeout: 20000 });
@@ -127,7 +127,7 @@ describe('Managed indices', () => {
127127

128128
// Reload the page
129129
cy.reload();
130-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
130+
cy.get('body').then(($body) => { if ($body.find('[data-test-subj="toastCloseButton"]').length) { cy.get('[data-test-subj="toastCloseButton"]').click({ force: true }); } });
131131

132132
// Confirm we see managed index attempting to retry, give 20 seconds for OSD load
133133
cy.contains('Pending retry of failed managed index', { timeout: 20000 });
@@ -138,7 +138,7 @@ describe('Managed indices', () => {
138138
// Wait up to 5 seconds for managed index to execute
139139
// eslint-disable-next-line cypress/no-unnecessary-waiting
140140
cy.wait(5000).reload();
141-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
141+
cy.get('body').then(($body) => { if ($body.find('[data-test-subj="toastCloseButton"]').length) { cy.get('[data-test-subj="toastCloseButton"]').click({ force: true }); } });
142142

143143
// Confirm managed index successfully rolled over
144144
cy.contains('Successfully rolled over', { timeout: 20000 });

cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('Transforms', () => {
102102
cy.contains('category.keyword_terms');
103103

104104
// Add aggregable field
105-
cy.contains('50 columns hidden').click({ force: true });
105+
cy.contains(/\d+ columns hidden/).click({ force: true });
106106
cy.contains('taxless_total_price').click({ force: true });
107107
// Click out of the window
108108
cy.contains('Select fields to transform').click({ force: true });

0 commit comments

Comments
 (0)