This is a Cypress custom command to check spelling.
This repository is used to check common spelling error on a webpage.
Install the module.
npm install cypress-spellchecker
Add the following line to cypress/support/commands.js
.
require('Cypress-spellchecker/src/spellCheckCommand')
Add the following lines to cypress.config.js
.
const { defineConfig } = require('cypress')
const spellcheck = require('Cypress-spellchecker/src/spellCheck')
module.exports = defineConfig({
// setupNodeEvents can be defined in either
// the e2e or component configuration
e2e: {
setupNodeEvents(on, config) {
spellcheck(on)
}
}
})
cy.spellCheck('https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings')
cy.spellCheck('https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings','filename')