diff --git a/cypress/utils/dashboards/saved_objects_management/commands.js b/cypress/utils/dashboards/saved_objects_management/commands.js index fb8af2fdd..18edbd539 100644 --- a/cypress/utils/dashboards/saved_objects_management/commands.js +++ b/cypress/utils/dashboards/saved_objects_management/commands.js @@ -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(