From 43900531ba7364db7c69c9fbb4e2f437e890acc9 Mon Sep 17 00:00:00 2001 From: Nishant Goel <113011736+nisgoel-amazon@users.noreply.github.com> Date: Tue, 6 Aug 2024 00:56:23 +0530 Subject: [PATCH] Reordering rollup and transform tests as after deleting and testing enable/disable feature creating flakiness in tests (#1513) Signed-off-by: Nishant Goel (cherry picked from commit 38b96389befbc6820572eab99a9d50775695e30e) --- .../rollups_spec.js | 72 +++++++-------- .../transforms_spec.js | 88 +++++++++---------- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js b/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js index 4210d4e66..0eab5fa70 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js @@ -210,42 +210,6 @@ describe('Rollups', () => { }); }); - describe('can be deleted', () => { - before(() => { - cy.deleteAllIndices(); - cy.deleteIMJobs(); - cy.createRollup(ROLLUP_ID, sampleRollup); - }); - - it('successfully', () => { - // Confirm we have our initial rollup - cy.contains(ROLLUP_ID); - - // Select checkbox for our rollup job - cy.get(`#_selection_column_${ROLLUP_ID}-checkbox`).check({ force: true }); - - // Click on Actions popover menu - cy.get(`[data-test-subj="actionButton"]`).click({ force: true }); - - // Click Delete button - cy.get(`[data-test-subj="deleteButton"]`).click({ force: true }); - - // Type "delete" to confirm deletion - cy.get(`input[placeholder="delete"]`).type('delete', { force: true }); - - // Click the delete confirmation button in modal - cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click(); - - // Confirm we got deleted toaster - cy.contains(`"${ROLLUP_ID}" successfully deleted!`); - - // Confirm showing empty loading state - cy.contains( - 'Rollup jobs help you conserve storage space for historical time series data while preserving the specific information you need' - ); - }); - }); - describe('can be enabled and disabled', () => { before(() => { cy.deleteAllIndices(); @@ -293,4 +257,40 @@ describe('Rollups', () => { cy.contains(`${ROLLUP_ID} is enabled`); }); }); + + describe('can be deleted', () => { + before(() => { + cy.deleteAllIndices(); + cy.deleteIMJobs(); + cy.createRollup(ROLLUP_ID, sampleRollup); + }); + + it('successfully', () => { + // Confirm we have our initial rollup + cy.contains(ROLLUP_ID); + + // Select checkbox for our rollup job + cy.get(`#_selection_column_${ROLLUP_ID}-checkbox`).check({ force: true }); + + // Click on Actions popover menu + cy.get(`[data-test-subj="actionButton"]`).click({ force: true }); + + // Click Delete button + cy.get(`[data-test-subj="deleteButton"]`).click({ force: true }); + + // Type "delete" to confirm deletion + cy.get(`input[placeholder="delete"]`).type('delete', { force: true }); + + // Click the delete confirmation button in modal + cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click(); + + // Confirm we got deleted toaster + cy.contains(`"${ROLLUP_ID}" successfully deleted!`); + + // Confirm showing empty loading state + cy.contains( + 'Rollup jobs help you conserve storage space for historical time series data while preserving the specific information you need' + ); + }); + }); }); diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js b/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js index 4c53838d3..91e187771 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js @@ -188,50 +188,6 @@ describe('Transforms', () => { }); }); - describe('can be deleted', () => { - beforeEach(() => { - cy.createTransform(TRANSFORM_ID, sampleTransform); - cy.reload(); - }); - - it('successfully', () => { - // Confirm we have our initial transform - cy.contains(TRANSFORM_ID); - - // Disable transform - cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({ - force: true, - }); - cy.get(`[data-test-subj="disableButton"]`).click({ force: true }); - cy.contains(`"${TRANSFORM_ID}" is disabled`); - - // Select checkbox for our transform job - cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({ - force: true, - }); - - // Click on Actions popover menu - cy.get(`[data-test-subj="actionButton"]`).click({ force: true }); - - // Click Delete button - cy.get(`[data-test-subj="deleteButton"]`).click({ force: true }); - - // Type "delete" to confirm deletion - cy.get(`input[placeholder="delete"]`).type('delete', { force: true }); - - // Click the delete confirmation button in modal - cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click(); - - // Confirm we got deleted toaster - cy.contains(`"${TRANSFORM_ID}" successfully deleted`); - - // Confirm showing empty loading state - cy.contains( - 'Transform jobs help you create a materialized view on top of existing data.' - ); - }); - }); - describe('can be enabled and disabled', () => { beforeEach(() => { cy.createTransform(TRANSFORM_ID, sampleTransform); @@ -290,4 +246,48 @@ describe('Transforms', () => { cy.contains(`"${TRANSFORM_ID}" is enabled`); }); }); + + describe('can be deleted', () => { + beforeEach(() => { + cy.createTransform(TRANSFORM_ID, sampleTransform); + cy.reload(); + }); + + it('successfully', () => { + // Confirm we have our initial transform + cy.contains(TRANSFORM_ID); + + // Disable transform + cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({ + force: true, + }); + cy.get(`[data-test-subj="disableButton"]`).click({ force: true }); + cy.contains(`"${TRANSFORM_ID}" is disabled`); + + // Select checkbox for our transform job + cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({ + force: true, + }); + + // Click on Actions popover menu + cy.get(`[data-test-subj="actionButton"]`).click({ force: true }); + + // Click Delete button + cy.get(`[data-test-subj="deleteButton"]`).click({ force: true }); + + // Type "delete" to confirm deletion + cy.get(`input[placeholder="delete"]`).type('delete', { force: true }); + + // Click the delete confirmation button in modal + cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click(); + + // Confirm we got deleted toaster + cy.contains(`"${TRANSFORM_ID}" successfully deleted`); + + // Confirm showing empty loading state + cy.contains( + 'Transform jobs help you create a materialized view on top of existing data.' + ); + }); + }); });