From 92927adc2a3f627b97c4e5d16d698d013f9a328d Mon Sep 17 00:00:00 2001 From: Kshitij Tandon Date: Thu, 30 Jan 2025 16:47:28 +0530 Subject: [PATCH] Fixing an issue in snpashot e2e test Signed-off-by: Kshitij Tandon --- .../index-management-dashboards-plugin/snapshots_spec.js | 2 ++ cypress/utils/commands.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/plugins/index-management-dashboards-plugin/snapshots_spec.js b/cypress/e2e/plugins/index-management-dashboards-plugin/snapshots_spec.js index b8cb8048b..38c77a620 100644 --- a/cypress/e2e/plugins/index-management-dashboards-plugin/snapshots_spec.js +++ b/cypress/e2e/plugins/index-management-dashboards-plugin/snapshots_spec.js @@ -92,6 +92,7 @@ describe("Snapshots", () => { describe("Snapshot can be restored", () => { it("Successfully restores indexes from snapshot", () => { + cy.visit(`${BASE_PATH}/app/${IM_PLUGIN_NAME}#/snapshots`); // Wait for snapshot to be created successfully with a 12sec timeout cy.get(`[data-test-subj="refreshButton"]`, { timeout: 12000 }) .should("be.visible") @@ -124,6 +125,7 @@ describe("Snapshots", () => { describe("Snapshot can be deleted", () => { it("deletes snapshot successfully", () => { + cy.visit(`${BASE_PATH}/app/${IM_PLUGIN_NAME}#/snapshots`); // Select test snapshot cy.get(`[data-test-subj="checkboxSelectRow-test_repo:test_snapshot"]`).check({ force: true }); diff --git a/cypress/utils/commands.js b/cypress/utils/commands.js index 4dd68a224..020849d46 100644 --- a/cypress/utils/commands.js +++ b/cypress/utils/commands.js @@ -98,7 +98,7 @@ Cypress.Commands.add("login", () => { Cypress.Commands.add("deleteAllIndices", () => { cy.log("Deleting all indexes"); - cy.request("DELETE", `${Cypress.env("openSearchUrl")}/index*,sample*,opensearch_dashboards*`); + cy.request("DELETE", `${Cypress.env("openSearchUrl")}/test_index_*,index*,sample*,opensearch_dashboards*`); cy.request("DELETE", `${Cypress.env("openSearchUrl")}/.opendistro-ism*?expand_wildcards=all`); });