Skip to content

Commit

Permalink
test: fix Cypress machine list tests (#5286)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndv99 committed Jan 16, 2024
1 parent fa61b57 commit 114d228
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/with-users/machines/list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 match the search criteria./).should("exist");
cy.findByText(/No machines available./).should("exist");
});

it("can filter machine list by deployment target", () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Cypress.Commands.add("loginNonAdmin", () => {

Cypress.Commands.add("addMachine", (hostname = generateName()) => {
cy.visit(generateMAASURL("/machines"));
cy.get("[data-testid='add-hardware-dropdown'] button").click();
cy.findByRole("button", { name: "Add hardware" }).click();
cy.get(".p-contextual-menu__link").contains("Machine").click();
cy.get("input[name='hostname']").type(hostname);
cy.get("input[name='pxe_mac']").type(generateMac());
Expand Down Expand Up @@ -82,7 +82,7 @@ Cypress.Commands.add("deletePool", (pool: string) => {

Cypress.Commands.add("addMachines", (hostnames: string[]) => {
cy.visit(generateMAASURL("/machines"));
cy.get("[data-testid='add-hardware-dropdown'] button").click();
cy.findByRole("button", { name: "Add hardware" }).click();
cy.get(".p-contextual-menu__link").contains("Machine").click();
hostnames.forEach((hostname, index) => {
cy.get("input[name='hostname']").type(hostname);
Expand Down

0 comments on commit 114d228

Please sign in to comment.