diff --git a/cypress/e2e/with-users/machines/actions.spec.ts b/cypress/e2e/with-users/machines/actions.spec.ts index 3742f20200..24faa980ae 100644 --- a/cypress/e2e/with-users/machines/actions.spec.ts +++ b/cypress/e2e/with-users/machines/actions.spec.ts @@ -117,7 +117,10 @@ context("Machine listing - actions", () => { const machineName = generateName("machine"); cy.addMachine(machineName); cy.findByRole("searchbox", { name: "Search" }).type(machineName); - cy.findByRole("checkbox", { name: `${machineName}.maas` }).click({ + cy.waitForTableToLoad({ name: /Machines/i }); + cy.findByRole("checkbox", { + name: `${machineName}.maas`, + }).click({ force: true, }); openMachineActionForm("Categorise", "Set pool"); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 882bc15997..8a891205ed 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -54,7 +54,9 @@ Cypress.Commands.add("deleteMachine", (hostname: string) => { cy.visit(generateMAASURL("/machines")); cy.findByRole("combobox", { name: "Group by" }).select("No grouping"); cy.findByRole("searchbox").type(hostname); - cy.findByText(/Showing 1 out of 1 machines/).should("exist"); + cy.findByText(/Showing 1 out of 1 machines/, { + timeout: LONG_TIMEOUT, + }).should("exist"); cy.findByRole("grid", { name: /Machines/ }).within(() => cy .findByRole("checkbox", { name: new RegExp(hostname) }) @@ -146,7 +148,9 @@ Cypress.Commands.add("waitForPageToLoad", () => { Cypress.Commands.add("waitForTableToLoad", ({ name } = { name: undefined }) => { cy.findByRole("grid", { name: /Loading/i }).should("exist"); - cy.findByRole("grid", { name: /Loading/i }).should("not.exist"); + cy.findByRole("grid", { name: /Loading/i, timeout: LONG_TIMEOUT }).should( + "not.exist" + ); return cy.findByRole("grid", { name }).should("exist"); });