vue-cli-plugin-cypress-experimental

Experimental Cypress plugin for Vue CLI
3,670 7
Install
npm install vue-cli-plugin-cypress-experimental
Latest Version:1.2.0
License:MIT
Last Updated:Dec 11, 2022
Links: GitHub  ·  npm
Maintainer: _jessicasachs

vue-cli-plugin-cypress-experimental 👩🏻‍🔬

ci status

Terminal typing vue add cypress-experimental

Experimental Cypress Plugin, provides component testing among other feature flags

Cypress offers a rich interactive interface for running tests in the browser. This Vue plugin is a quick way to install experimental features like component testing. Find out more about component testing here.

⚠️ This plugin and the features inside of it are experimental. We want to collect developer feedback, but they are not stable or fully-featured yet. Please read other experiments here

⚠️ Requires Cypress v4.5.0 or later

Installing in an Already Created Project 💎

# Add it
vue add cypress-experimental

# Run it
npm run test:component # yarn test:components

Injected Commands ⚙️

  • vue-cli-service test:components

    Run component tests with cypress open.

    By default it launches Cypress in interactive mode with a GUI. This allows you to view the components as they are being tested. If you want to run the tests in headless mode (e.g. for CI), you can do so with the cypress run option.

    Options:

    --headless run in headless mode without GUI
    -s, --spec (headless only) runs a specific spec file. defaults to "all"
    

    Additionally:

    Examples :

    • Run Cypress in headless mode for a specific file: vue-cli-service test:component --headless --spec tests/components/specs/actions.spec.js

Configuration 🛠

We've pre-configured Cypress to place most of the component testing related files under <projectRoot>/tests/components. You can also check out how to configure Cypress via cypress.json.

To place the component tests sibling to your source files, just change the componentFolder option in your cypress.json file to point to the root of your source directory.

Environment Variables 🌲

Cypress doesn't load .env files for your test files the same way as vue-cli does for your application code. Cypress supports a few ways to define env variables but the easiest one is to use .json files (either cypress.json or cypress.env.json) to define environment variables. Keep in mind those variables are accessible via Cypress.env function instead of regular process.env object.

Related Packages

@4tw/vue-cli-plugin-cypress-django

Integration testing with cypress and django

2,900 4
@mingto/mt-cli

明途脚手架工具

2,568
cli
mgo-cli

create a vue3 webapp by demand

2,096
cli
@vue/babel-preset-app

babel-preset-app for vue-cli

28,669,765 29,510
@vue/cli-service

local service for vue-cli projects

28,072,157 29,510

Version History

Version Released License
1.2.0 MIT
1.1.0 MIT
1.0.0 MIT
0.0.5 MIT
0.0.4 MIT