Oppdaterer landingsside tester

This commit is contained in:
Sindre Kjelsrud 2023-08-04 12:15:18 +02:00
parent f303081d4e
commit 2fb4a478bd
5 changed files with 77 additions and 60 deletions

View file

@ -1,3 +1,5 @@
import 'cypress-axe'
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
@ -24,14 +26,19 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
Cypress.Commands.add("checkPageA11y", () => {
cy.injectAxe();
cy.configureAxe({
rules: [
// {
// id: "svg-img-alt",
// enabled: false,
// },
//Skrur av fordi checkA11y ikke vet at div er en gyldig children av <dl>-elementer
],
});
cy.checkA11y(
undefined
);
});

View file

@ -17,4 +17,12 @@
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
// require('./commands')
declare global {
namespace Cypress {
interface Chainable {
checkPageA11y(): Chainable<JQuery<HTMLElement>>;
}
}
}