Hello, could someone please help me, I have google...
# best-practices
w
Hello, could someone please help me, I have googled my eyes out, lol :p. I have added axe + a11y to cypress which works fine if i check one page (not the entire webpage), however when I have created a test that will check all the subpages on the webpage, a11y does not do anything and I get a function error (not sure if this is the reason why it doesnt work, but it can be likely). Could someone please look at my code and see if it looks ok ?
Copy code
describe("Page accessibility tests", () => {
  beforeEach(() => {
    cy.visit("https://www.knowit.no");
    cy.contains("button", "Godta alle").click({ force: true });
    cy.contains("Meny").click();
    cy.injectAxe();
  });

  it("should open om oss page and run checkally", () => {
    // Find and click on "Om oss" list-button
    cy.contains("Om oss").click();

    // Verfiy that the page has title "Om oss"
    cy.get("h1").should("have.text", "Om oss");
    cy.checkA11y();
  });

  it("should open Kunder and run checkally", () => {
    // Find and click on "Kunder" list-button
    cy.contains("Kunder").click();

    // Verfiy that the page has title "Kunder"
    cy.get("h1").should("have.text", "Kunder");
    cy.checkA11y();
  });

  it("should open om Tjenester and run checkally", () => {
    // Find and click on "Tjenester" list-button
    cy.contains("Tjenester").click();

    // Find and click on "Tjenester" list-button
    cy.contains("Systemløsninger").click();

    // Verfiy that the page has title "Tjenester"
    cy.get("h1").should("have.text", "Tjenester");
    cy.checkA11y();
  });
});