Skip to content

Commit

Permalink
[Dashboard] Retry visbuilder dashboard test (opensearch-project#823)
Browse files Browse the repository at this point in the history
Seeing it pass in video replays but occassionally doesn't pass.
However, it doesn't pass with security enabled so I'd imagine it
could be related to the refreshing of the session.

Issue:
opensearch-project/OpenSearch-Dashboards#4947

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
  • Loading branch information
kavilla authored and leanneeliatra committed Sep 29, 2023
1 parent f6081d9 commit ac153a5
Showing 1 changed file with 36 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ac153a5

Please sign in to comment.