Skip to content

Commit

Permalink
add vis to dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am committed Feb 21, 2024
1 parent 1571be4 commit aa033e8
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions cypress/utils/dashboards/vis-augmenter/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,28 +271,28 @@ export const bootstrapDashboard = (
// wait for vis saved
cy.contains(`Saved '${visualizationSpec.name}'`);
cy.wait(5000);
cy.get(`[data-title="${visualizationSpec.name}"]`).should('have.length', 1);
// cy.get(`[data-title="${visualizationSpec.name}"]`).should('have.length', 1);
// somehow the visualization is not added to dashboard
// cy.get('body').then(($body) => {
// if ($body.find(`[data-title="${visualizationSpec.name}"]`).length === 0) {
// cy.getElementByTestId('dashboardAddPanelButton').click({ force: true });
// cy.getElementByTestId('savedObjectFinderSearchInput')
// .focus()
// .clear()
// .type(visualizationSpec.name);
cy.get('body').then(($body) => {
if ($body.find(`[data-title="${visualizationSpec.name}"]`).length === 0) {
cy.getElementByTestId('dashboardAddPanelButton').click({ force: true });
cy.getElementByTestId('savedObjectFinderSearchInput')
.focus()
.clear()
.type(visualizationSpec.name);

// cy.getElementByTestId(
// `savedObjectTitle${visualizationSpec.name}`
// ).click();
cy.getElementByTestId(
`savedObjectTitle${visualizationSpec.name}`
).click();

// cy.getElementByTestId('euiFlyoutCloseButton').click();
cy.getElementByTestId('euiFlyoutCloseButton').click();

// cy.get(`[data-title="${visualizationSpec.name}"]`).should(
// 'have.length',
// 1
// );
// }
// });
cy.get(`[data-title="${visualizationSpec.name}"]`).should(
'have.length',
1
);
}
});
});

/// wait for page load
Expand Down

0 comments on commit aa033e8

Please sign in to comment.