diff --git a/cypress/e2e/with-users/controllers/details.spec.ts b/cypress/e2e/with-users/controllers/details.spec.ts index 6d473a453e..5df83c17f5 100644 --- a/cypress/e2e/with-users/controllers/details.spec.ts +++ b/cypress/e2e/with-users/controllers/details.spec.ts @@ -65,7 +65,7 @@ context("Controller details", () => { it("lists valid actions on the controller details page", () => { cy.findByText(/Take action/).click(); - [/Import images/i, /Delete/i].forEach((name) => + [/Set zone/i, /Delete/i].forEach((name) => cy .findByRole("button", { name, diff --git a/cypress/e2e/with-users/machines/list.spec.ts b/cypress/e2e/with-users/machines/list.spec.ts index 40898ce2f2..975c052176 100644 --- a/cypress/e2e/with-users/machines/list.spec.ts +++ b/cypress/e2e/with-users/machines/list.spec.ts @@ -152,7 +152,7 @@ context("Machine listing", () => { ); cy.findByRole("button", { name: /Delete/i }).click(); cy.findByRole("button", { name: /Delete 3 machines/ }).click(); - cy.findByText(/No machines available./).should("exist"); + cy.findByText(/No machines match the search criteria./).should("exist"); }); it("can filter machine list by deployment target", () => { diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 62ead27546..62270f420c 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -71,9 +71,13 @@ Cypress.Commands.add("deleteMachine", (hostname: string) => { Cypress.Commands.add("deletePool", (pool: string) => { cy.visit(generateMAASURL("/pools")); cy.findByRole("row", { name: new RegExp(`${pool}`) }).within(() => { - cy.findByRole("button", { name: /Delete/i }).click(); - cy.findByTestId("action-confirm").click(); + cy.findByRole("link", { name: /Delete/i }).click(); }); + cy.findByRole("complementary", { name: /Delete/i }) + .should("be.visible") + .within(() => { + cy.findByRole("button", { name: /Delete/i }).click(); + }); cy.get(`[data-testid='message']:contains(${pool} removed successfully.)`, { timeout: LONG_TIMEOUT, });