-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "baseUrl": "http://127.0.0.1:8000/", "numTestsKeptInMemory": 100 } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// <reference types="Cypress" /> | ||
|
||
Cypress.env("routes").forEach(route => { | ||
describe("Accessibility: " + route, () => { | ||
before(function() { | ||
cy.visit(route); | ||
cy.configureAxe({ | ||
exclude: [["#query"], [".search-button"]], | ||
}); | ||
cy.injectAxe(); | ||
}); | ||
it(route + " has no violations", function() { | ||
cy.checkA11y(); | ||
}); | ||
it(route + " has no active violations", function() { | ||
cy.get('header[role="banner"] h1 a').trigger("mouseover"); | ||
cy.get('header[role="banner"] .links a:first-of-type').trigger( | ||
cy.get('aside article:first-of-type header a:first-of-type').trigger("mouseover"); | ||
cy.get('aside article:first-of-type footer a:first-of-type').trigger("mouseover"); | ||
cy.get('header[role="banner"] .menu .search-button').trigger( | ||
"click" | ||
); | ||
cy.checkA11y(); | ||
}); | ||
/* Cypress.env("styles").forEach(style => { | ||
it(style + " has sufficient contrast", function() { | ||
cy.document().then(doc => { | ||
if (doc.querySelector("link[href$='metal.css']")) { | ||
let cssLink = doc.querySelector("link[href$='metal.css']"); | ||
// let cssLink = doc.querySelector( | ||
// "link[href^='" + Cypress.env("stylesFolder") + "']" | ||
// ); | ||
let cssPath = cssLink.getAttribute("href").replace("metal.css", ""); | ||
cssLink.setAttribute("href", cssPath + style); | ||
} | ||
}); | ||
cy.checkA11y({ | ||
runOnly: ["cat.color"], | ||
}); | ||
// cy.screenshot(route + "/styles/" + style); | ||
}); | ||
}); */ | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// <reference types="Cypress" /> | ||
|
||
describe("Accessibility: " + "/", () => { | ||
before(function() { | ||
cy.visit("/"); | ||
cy.injectAxe(); | ||
}); | ||
it("/" + " has no violations", function() { | ||
cy.checkA11y(); | ||
}); | ||
it("/" + " has no active violations", function() { | ||
// cy.get('header[role="banner"] h1 a').focus(); | ||
// cy.get('header[role="banner"] .links a:first-of-type').focus(); | ||
cy.get('header[role="banner"] h1 a').trigger("mouseenter"); | ||
cy.get('header[role="banner"] h1 a').trigger("mouseover"); | ||
// cy.get('header[role="banner"] .links a:first-of-type').trigger("mouseover"); | ||
// cy.get("aside article:first-of-type header a:first-of-type").trigger( | ||
// "mouseover" | ||
// ); | ||
// cy.get("aside article:first-of-type footer a:first-of-type").trigger( | ||
// "mouseover" | ||
// ); | ||
// cy.get('header[role="banner"] .menu .search-button').trigger("click"); | ||
cy.checkA11y(); | ||
}); | ||
/* Cypress.env("styles").forEach(style => { | ||
it(style + " has sufficient contrast", function() { | ||
cy.document().then(doc => { | ||
if (doc.querySelector("link[href$='metal.css']")) { | ||
let cssLink = doc.querySelector("link[href$='metal.css']"); | ||
// let cssLink = doc.querySelector( | ||
// "link[href^='" + Cypress.env("stylesFolder") + "']" | ||
// ); | ||
let cssPath = cssLink.getAttribute("href").replace("metal.css", ""); | ||
cssLink.setAttribute("href", cssPath + style); | ||
} | ||
}); | ||
cy.checkA11y({ | ||
runOnly: ["cat.color"], | ||
}); | ||
// cy.screenshot(route + "/styles/" + style); | ||
}); | ||
}); */ | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
const path = require("path"); | ||
const fs = require("fs"); | ||
|
||
module.exports = (on, config) => { | ||
config.env.routes = ["/", "/article", "/blog", "/cv", "/docs"]; | ||
config.env.stylesFolder = path.join(__dirname, "../../css/styles"); | ||
let styles = []; | ||
var files = fs.readdirSync(config.env.stylesFolder); | ||
files.forEach(function(file) { | ||
styles.push(file); | ||
}); | ||
config.env.styles = styles; | ||
return config; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add("login", (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import "./commands"; | ||
import "cypress-axe"; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |