Not Recommended: All of this is done automatically with Vue CLI
- Install
cypress
and@cypress/vue
npm install -D cypress @cypress/vue
- Include this plugin from your project's
cypress/plugin/index.js
file
const preprocessor = require('@cypress/vue/dist/plugins/webpack')
module.exports = (on, config) => {
preprocessor(on, config)
// IMPORTANT return the config object
return config
}
- Include the support file from your project's
cypress/support/index.js
file
import '@cypress/vue/dist/support'
⚠️ Turn the experimental component support on in yourcypress.json
. You can also specify where component spec files are located. For exampled to have them located insrc
folder use:
{
"componentFolder": "src"
}