Skip to content

Commit

Permalink
Update cypress/utils/dashboards/saved_objects_management/commands.js
Browse files Browse the repository at this point in the history
Co-authored-by: Zhongnan Su <[email protected]>
Signed-off-by: Yu Jin <[email protected]>
  • Loading branch information
yujin-emma and zhongnansu committed Jun 6, 2024
1 parent a7d6c1b commit af94d53
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions cypress/utils/dashboards/saved_objects_management/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ Cypress.Commands.add('selectDataSourceForImport', (dataSourceTitle) => {
.click();
});

Cypress.Commands.add('deleteAllSavedObjects', () => {
cy.wait(1000);
cy.deleteSavedObjectByType('dashboard');
cy.wait(1000);
cy.deleteSavedObjectByType('index-pattern');
cy.wait(1000);
cy.deleteSavedObjectByType('search');
cy.wait(1000);
cy.deleteSavedObjectByType('visualization');
cy.wait(1000);
cy.deleteSavedObjectByType('metrics');
cy.wait(1000);
cy.deleteSavedObjectByType('vega');
Cypress.Commands.add("deleteAllSavedObjects", () => {
const types = [
"index-pattern",
"visualization",
"dashboard",
"search",
"query",
"url",
"augment-vis",
"homepage",
"data-source",
"visualization-visbuilder",
"config",
];
types.forEach((type) => {
cy.deleteSavedObjectByType(type);
});
});

Cypress.Commands.add(
Expand Down

0 comments on commit af94d53

Please sign in to comment.