Package Exports
- cypress-html-validate
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cypress-html-validate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Cypress HTML-Validate plugin
Validates HTML using html-validate
.
It automatically fetches the active source markup from the browser and validates, failing the test if any validation errors is encountered.
Usage
In cypress/plugins/index.js
:
const htmlvalidate = require("cypress-html-validate/dist/plugin");
module.exports = on => {
htmlvalidate.install(on);
};
In cypress/support/index.js
:
import "cypress-html-validate/dist/commands";
In specs:
it("should be valid", () => {
cy.visit("/my-page.html");
cy.htmlvalidate();
});
Configuration
html-validate
configuration can be passed in cypress/plugins/index.js
:
htmlvalidate.install(on, {
rules: {
foo: "error",
},
});