From c6b2e92885fda95f08894019d90e128a3f5d6aaa Mon Sep 17 00:00:00 2001 From: Nishant Goel Date: Mon, 5 Aug 2024 20:12:07 +0530 Subject: [PATCH 1/4] select checkbox via id instead of class name Signed-off-by: Nishant Goel --- .../aliases.js | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js b/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js index bb0b4cf41..5f2442761 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js @@ -170,28 +170,20 @@ describe('Aliases', () => { expect(num).to.equal(1); }); - cy.get('[data-test-subj="moreAction"]').click(); - // Flush btn should be disabled if no items selected - cy.get('[data-test-subj="Flush Action"]').should( - 'have.class', - 'euiContextMenuItem-isDisabled' - ); - - // Select an alias - cy.get(`[data-test-subj="checkboxSelectRow-${sample_alias}"]`).check({ - force: true, - }); - - cy.get('[data-test-subj="moreAction"]').click(); - - // Extra wait required for page data to load, otherwise "Enable" button will be disabled - cy.wait(2000); + cy.get('[data-test-subj="moreAction"] button') + .click() + .get('[data-test-subj="Flush Action"]') + .should('be.disabled') + .end(); - // Flush btn should be enabled - cy.get('[data-test-subj="Flush Action"]') - .should('exist') - .should('not.have.class', 'euiContextMenuItem-isDisabled') - .click(); + cy.get(`#_selection_column_${sample_alias}-checkbox`) + .click() + .get('[data-test-subj="moreAction"] button') + .click() + .get('[data-test-subj="Flush Action"]') + .should('not.be.disabled') + .click() + .end(); // Check for flush index modal cy.contains('Flush alias'); From 6c4012aba4b65f64986b6683fedb51316f54db3b Mon Sep 17 00:00:00 2001 From: Nishant Goel Date: Mon, 5 Aug 2024 22:15:49 +0530 Subject: [PATCH 2/4] Re trigger PR workflows Signed-off-by: Nishant Goel From 7687231a8c320a61ca02a46f80bf873fc2460cf0 Mon Sep 17 00:00:00 2001 From: Nishant Goel Date: Mon, 5 Aug 2024 22:47:46 +0530 Subject: [PATCH 3/4] Instead of sorting in asc order on aliases page, search the alias via text Signed-off-by: Nishant Goel --- .../plugins/index-management-dashboards-plugin/aliases.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js b/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js index 5f2442761..72442ee0b 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js @@ -142,9 +142,9 @@ describe('Aliases', () => { describe('can flush an alias', () => { it('successfully flush an index', () => { - let sample_alias = `${SAMPLE_ALIAS_PREFIX}-${1}`; + let sample_alias = `${SAMPLE_ALIAS_PREFIX}-1`; // Sort all aliases in asc order to make it at first page - cy.contains('Alias name').click(); + cy.get('[placeholder="Search..."]').type(`${sample_alias}{enter}`); // Confirm we have our initial alias cy.contains(sample_alias); // index a test doc From 331ab642f21c5924777f4f2c0c8f5ddce8d33dd1 Mon Sep 17 00:00:00 2001 From: Nishant Goel Date: Mon, 5 Aug 2024 23:54:25 +0530 Subject: [PATCH 4/4] Reordering rollup and transform tests as after deleting and testing enable/disable feature creating flakiness in tests Signed-off-by: Nishant Goel --- .../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.' + ); + }); + }); });