From ca63a22673cc2f9839ba796db0be50bc99be7a8d Mon Sep 17 00:00:00 2001 From: Pranshu1902 Date: Wed, 10 Jan 2024 01:02:19 +0530 Subject: [PATCH] add cypress for delete location functionality --- cypress/e2e/facility_spec/locations.cy.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cypress/e2e/facility_spec/locations.cy.ts b/cypress/e2e/facility_spec/locations.cy.ts index d39464ce14b..6c91de0eb84 100644 --- a/cypress/e2e/facility_spec/locations.cy.ts +++ b/cypress/e2e/facility_spec/locations.cy.ts @@ -159,6 +159,23 @@ describe("Location Management Section", () => { assetPagination.navigateToPreviousPage(); }); + it("Delete location", () => { + cy.awaitUrl("/facility"); + cy.get("a").contains("Dummy Facility 1").click(); + cy.get("button[id=headlessui-menu-button-:r3:]").click(); + cy.get("div[id=location-management]").click(); + + // create new location + cy.get("button[id=add-new-location]").click(); + cy.get("input[id=name]").type("Test Location"); + cy.get("button[id=headlessui-listbox-button-:r16:]").click(); + cy.get("li[id=location-type-option-OTHER]").click(); + cy.get("button[id=submit]").click(); + + // delete location + cy.get("button[id=delete-location-button]").click(); + }); + afterEach(() => { cy.saveLocalStorage(); });