Skip to content

Commit af94d53

Browse files
Update cypress/utils/dashboards/saved_objects_management/commands.js
Co-authored-by: Zhongnan Su <[email protected]> Signed-off-by: Yu Jin <[email protected]>
1 parent a7d6c1b commit af94d53

File tree

1 file changed

+17
-13
lines changed
  • cypress/utils/dashboards/saved_objects_management

1 file changed

+17
-13
lines changed

cypress/utils/dashboards/saved_objects_management/commands.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ Cypress.Commands.add('selectDataSourceForImport', (dataSourceTitle) => {
1010
.click();
1111
});
1212

13-
Cypress.Commands.add('deleteAllSavedObjects', () => {
14-
cy.wait(1000);
15-
cy.deleteSavedObjectByType('dashboard');
16-
cy.wait(1000);
17-
cy.deleteSavedObjectByType('index-pattern');
18-
cy.wait(1000);
19-
cy.deleteSavedObjectByType('search');
20-
cy.wait(1000);
21-
cy.deleteSavedObjectByType('visualization');
22-
cy.wait(1000);
23-
cy.deleteSavedObjectByType('metrics');
24-
cy.wait(1000);
25-
cy.deleteSavedObjectByType('vega');
13+
Cypress.Commands.add("deleteAllSavedObjects", () => {
14+
const types = [
15+
"index-pattern",
16+
"visualization",
17+
"dashboard",
18+
"search",
19+
"query",
20+
"url",
21+
"augment-vis",
22+
"homepage",
23+
"data-source",
24+
"visualization-visbuilder",
25+
"config",
26+
];
27+
types.forEach((type) => {
28+
cy.deleteSavedObjectByType(type);
29+
});
2630
});
2731

2832
Cypress.Commands.add(

0 commit comments

Comments
 (0)