Skip to content

Commit

Permalink
add cypress for delete location functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu1902 committed Jan 9, 2024
1 parent 4989f92 commit ca63a22
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit ca63a22

Please sign in to comment.