Cypress plugin that automatically generates smoke-like tests from a project's cypress test base. By providing the percentage of tests to skip, cypress-smokify
will pick file-specific arbitrary tests to run. This can be useful when a project's test base grows to such an extent that it gets cumbersome to run all tests everytime when pushing code for example. However, all tests should always be run before deploying any code.
- Install the package
npm install cypress-smokify
- Add it into
cypress/plugins/index.js
const smokify = require('cypress-smokify')
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
on('file:preprocessor', smokify(config))
}
- Specify the % (value between 0-1) of tests you want to skip
cypress run --env smokify=0.5 --config baseUrl=http://X:Y/