Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update staticroutes.spec.ts #5392

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions cypress/e2e/with-users/subnets/staticroutes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LONG_TIMEOUT } from "../../../constants";
import { generateMAASURL } from "../../utils";

context("Static Routes", () => {
Expand Down Expand Up @@ -27,7 +28,8 @@ context("Static Routes", () => {
});
cy.findByRole("button", { name: /save/i }).click();
cy.findByRole("complementary", { name: /Add static route/i }).should(
"not.exist"
"not.exist",
{ timeout: LONG_TIMEOUT }
);

// Edit static route
Expand All @@ -40,7 +42,7 @@ context("Static Routes", () => {

cy.findByRole("complementary", { name: /Edit static route/i }).within(
() => {
cy.findByLabelText(/gateway ip/i).type("{Backspace}1");
cy.findByLabelText(/gateway ip/i).type("{Backspace}2");
cy.findByRole("button", { name: /save/i }).click();
}
);
Expand All @@ -51,8 +53,9 @@ context("Static Routes", () => {
cy.findByText(staticRoute as string);
});
});
cy.findByRole("complementary", { name: /Add static route/i }).should(
"not.exist"
cy.findByRole("complementary", { name: /Edit static route/i }).should(
"not.exist",
{ timeout: LONG_TIMEOUT }
);

// Delete the static route
Expand All @@ -70,11 +73,15 @@ context("Static Routes", () => {
cy.findByRole("button", { name: /delete/i }).click();
}
);
cy.findByRole("complementary", {
name: /Delete static route/i,
}).should("not.exist", {
timeout: LONG_TIMEOUT,
});
cy.get("@staticRoute").then((staticRoute: unknown) => {
cy.findByRole("region", { name: /Static routes/i }).within(() => {
cy.findByText(staticRoute as string).should("not.exist");
});
});
cy.findByRole("region", { name: /side panel/i }).should("not.exist");
});
});
Loading