diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_builder/dashboard.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_builder/dashboard.spec.js index 72bd3a35a..92aee997a 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_builder/dashboard.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_builder/dashboard.spec.js @@ -108,38 +108,42 @@ if (Cypress.env('VISBUILDER_ENABLED')) { cy.deleteSavedObjectByType(VB_SO_TYPE, `vb${cleanupKey}`); }); - it('Should be able to edit a visualization', () => { - // Navigate to vis builder - cy.getElementByTestId('dashboardEditMode').click(); - cy.getElementByTestId( - `embeddablePanelHeading-${toTestId(VB_METRIC_VIS_TITLE, '')}` - ) - .find('[data-test-subj="embeddablePanelToggleMenuIcon"]') - .click(); - cy.getElementByTestId('embeddablePanelAction-editPanel').click(); - cy.getElementByTestId('visualizationLoader') - .find('.mtrVis__value') - .should('contain.text', VB_INDEX_DOC_COUNT); - - // Edit visualization - const newLabel = 'Editied Label'; - cy.getElementByTestId('dropBoxField-metric-0').click(); - cy.vbEditAgg([ - { - testSubj: 'visEditorStringInput1customLabel', - type: 'input', - value: newLabel, - }, - ]); - - // Save and return - cy.getElementByTestId('visBuilderSaveAndReturnButton').click(); - - cy.getElementByTestId('visualizationLoader').should( - 'contain.text', - newLabel - ); - }); + it( + 'Should be able to edit a visualization', + { retries: { runMode: 2 } }, + () => { + // Navigate to vis builder + cy.getElementByTestId('dashboardEditMode').click(); + cy.getElementByTestId( + `embeddablePanelHeading-${toTestId(VB_METRIC_VIS_TITLE, '')}` + ) + .find('[data-test-subj="embeddablePanelToggleMenuIcon"]') + .click(); + cy.getElementByTestId('embeddablePanelAction-editPanel').click(); + cy.getElementByTestId('visualizationLoader') + .find('.mtrVis__value') + .should('contain.text', VB_INDEX_DOC_COUNT); + + // Edit visualization + const newLabel = 'Editied Label'; + cy.getElementByTestId('dropBoxField-metric-0').click(); + cy.vbEditAgg([ + { + testSubj: 'visEditorStringInput1customLabel', + type: 'input', + value: newLabel, + }, + ]); + + // Save and return + cy.getElementByTestId('visBuilderSaveAndReturnButton').click(); + + cy.getElementByTestId('visualizationLoader').should( + 'contain.text', + newLabel + ); + } + ); after(() => { cy.deleteIndex(VB_INDEX_ID);