j40-cejst-2/client/cypress/integration/LegacyTests/allLinks.spec.js

23 lines
536 B
JavaScript
Raw Normal View History

// / <reference types="Cypress" />
describe('Do all the English pages have all links with a defined href attribute?', () => {
const pages = [
'/',
'cejst',
'methodology',
'contact',
];
pages.forEach((page) => {
it(`test all href attr on ${page} page`, () => {
cy.visit(page);
// Checks to make sure all a tags have an href:
cy.get('a').each(($a) => {
const message = $a.text();
expect($a, message).to.have.attr('href').not.contain('undefined');
});
});
});
});