From aa8d84c65172b592ba35bf4fac87356c2e5a9dfe Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Wed, 30 Oct 2024 16:40:26 -0400 Subject: [PATCH] Revert "Comment out failing ISM test (#1613)" This reverts commit ae5d7145673189223c567297931f78720efa47cc. --- .../indices_spec.js | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js b/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js index 334b1c896..b0de7ef1c 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js @@ -500,45 +500,44 @@ describe('Indices', () => { }); }); - // TODO: FIX THIS TEST - // it('successfully open an index', () => { - // // Confirm we have our initial index - // cy.contains(SAMPLE_INDEX); - - // cy.get('[data-test-subj="moreAction"]').click(); - // // Open btn should be disabled if no items selected - // cy.get('[data-test-subj="Open Action"]').should( - // 'have.class', - // 'euiContextMenuItem-isDisabled' - // ); - - // // Select an index - // cy.get(`[data-test-subj="checkboxSelectRow-${SAMPLE_INDEX}"]`).check({ - // force: true, - // }); - - // cy.get('[data-test-subj="moreAction"]').click(); - // // Open btn should be enabled - // cy.get('[data-test-subj="Open Action"]') - // .should('exist') - // .should('not.have.class', 'euiContextMenuItem-isDisabled') - // .click(); - - // // Check for open index modal - // cy.contains('Open'); - - // cy.get('[data-test-subj="Open Confirm button"]').click(); - - // // Check for success toast - // cy.contains(/sample_index have been opened/); - - // // Confirm the index is open - // cy.get(`input[type="search"]`).focus().type(SAMPLE_INDEX); - // cy.get('tbody > tr').should(($tr) => { - // expect($tr, '1 row').to.have.length(1); - // expect($tr, 'item').to.contain('open'); - // }); - // }); + it('successfully open an index', () => { + // Confirm we have our initial index + cy.contains(SAMPLE_INDEX); + + cy.get('[data-test-subj="moreAction"]').click(); + // Open btn should be disabled if no items selected + cy.get('[data-test-subj="Open Action"]').should( + 'have.class', + 'euiContextMenuItem-isDisabled' + ); + + // Select an index + cy.get(`[data-test-subj="checkboxSelectRow-${SAMPLE_INDEX}"]`).check({ + force: true, + }); + + cy.get('[data-test-subj="moreAction"]').click(); + // Open btn should be enabled + cy.get('[data-test-subj="Open Action"]') + .should('exist') + .should('not.have.class', 'euiContextMenuItem-isDisabled') + .click(); + + // Check for open index modal + cy.contains('Open'); + + cy.get('[data-test-subj="Open Confirm button"]').click(); + + // Check for success toast + cy.contains(/sample_index have been opened/); + + // Confirm the index is open + cy.get(`input[type="search"]`).focus().type(SAMPLE_INDEX); + cy.get('tbody > tr').should(($tr) => { + expect($tr, '1 row').to.have.length(1); + expect($tr, 'item').to.contain('open'); + }); + }); }); describe('can clear cache for indexes', () => {