basic e2e tests

This commit is contained in:
Owen Rees
2023-06-08 13:37:28 +02:00
parent c5aac42344
commit b038d3fee8
10 changed files with 150 additions and 25 deletions
+21
View File
@@ -0,0 +1,21 @@
describe("Test all links", () => {
// TODO traverse entire site
it("Test all links on homepage return 200 status", () => {
cy.visit("/");
cy.get("a").each((page) => {
cy.request(page.prop("href"));
});
});
it("Check navbar links point to correct pathname", () => {
const pages = ["tournois", "about", "contact"];
cy.visit("/");
pages.forEach((page) => {
cy.contains(page, { matchCase: false }).click();
cy.location("pathname").should("eq", `/${page}`); // url path matches link name
cy.go("back");
});
});
});