All Projects → bahmutov → cypress-watch-and-reload

bahmutov / cypress-watch-and-reload

Licence: other
Reloads Cypress when one of the watched files changes

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to cypress-watch-and-reload

cypress-browserify-preprocessor
Cypress preprocessor for bundling JavaScript via browserify
Stars: ✭ 23 (-50%)
Mutual labels:  cypress, cypress-io, cypress-plugin
cypress-get-it
Get elements by data attribute by creating a Cy command on the fly
Stars: ✭ 23 (-50%)
Mutual labels:  cypress, cypress-io, cypress-plugin
cypress-xpath
Adds XPath command to Cypress test runner
Stars: ✭ 145 (+215.22%)
Mutual labels:  cypress, cypress-io, cypress-plugin
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+200%)
Mutual labels:  cypress, cypress-io
cypress-mochawesome-reporter
Zero config Mochawesome reporter for Cypress with screenshots
Stars: ✭ 48 (+4.35%)
Mutual labels:  cypress, cypress-io
cypress-angular-unit-test
Trying to load and bootstrap Angular component dynamically inside Cypress
Stars: ✭ 146 (+217.39%)
Mutual labels:  cypress, cypress-io
cypress-dotenv
Cypress plugin that enables compatability with dotenv
Stars: ✭ 47 (+2.17%)
Mutual labels:  cypress, cypress-plugin
cypress-test-tiny
Tiny Cypress E2E test case
Stars: ✭ 48 (+4.35%)
Mutual labels:  cypress, cypress-io
cypress-hyperapp-unit-test
Unit test Hyperapp components using Cypress
Stars: ✭ 26 (-43.48%)
Mutual labels:  cypress, cypress-io
cypress-retry
Retry just the failed Cypress.io tests using Cypress module API and AST rewriting
Stars: ✭ 16 (-65.22%)
Mutual labels:  cypress, cypress-io
TLE5012-Magnetic-Angle-Sensor
This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
Stars: ✭ 37 (-19.57%)
Mutual labels:  cypress, cypress-io
cypress-upload-file-post-form
Solution for two Cypress testing use-cases I came across with: perform a direct http FORM request to the server containing a file and other parameters and upload a file into a form before submission
Stars: ✭ 59 (+28.26%)
Mutual labels:  cypress, cypress-io
cypress-example-docker-compose
Example running Cypress tests against Apache server via docker-compose
Stars: ✭ 106 (+130.43%)
Mutual labels:  cypress, cypress-io
cypress-plugin-stripe-elements
A small Cypress plugin that assists you in filling in Stripe Elements inputs
Stars: ✭ 22 (-52.17%)
Mutual labels:  cypress, cypress-plugin
todo-graphql-example
Example Todo app on top of json-graphql-server
Stars: ✭ 20 (-56.52%)
Mutual labels:  cypress, cypress-io
snapshot
Adds value / object / DOM element snapshot testing support to Cypress test runner
Stars: ✭ 114 (+147.83%)
Mutual labels:  cypress, cypress-io
cypress-example-circleci-orb
Demo of using the Cypress CircleCI Orb
Stars: ✭ 26 (-43.48%)
Mutual labels:  cypress, cypress-io
cypress-angularjs-unit-test
Unit test Angularjs code using Cypress.io test runner
Stars: ✭ 23 (-50%)
Mutual labels:  cypress, cypress-io
cypress-example-docker-circle-workflows
Cypress + Docker + CircleCI Workflows = ❤️
Stars: ✭ 29 (-36.96%)
Mutual labels:  cypress, cypress-io
cypress-browser-permissions
A Cypress plugin to set launched browser preferences including permissions like Geolocation, Notifications, Microphone, etc.
Stars: ✭ 40 (-13.04%)
Mutual labels:  cypress, cypress-plugin

cypress-watch-and-reload CircleCI renovate-app badge

Reloads Cypress when one of the watched files changes

Video

Watch this plugin in action in the short video Re-run Cypress Tests When Application Files Change and Nodemon And cypress-watch-and-reload Utilities

Install

npm install cypress-watch-and-reload

Use

Add to your cypress/plugins/index.js file

module.exports = (on, config) => {
  // https://github.com/bahmutov/cypress-watch-and-reload
  require('cypress-watch-and-reload/plugins')(config)
  // IMPORTANT: return the config object
  // because the plugin might have changed it
  return config
}

Add to your cypress/support/index.js file

require('cypress-watch-and-reload/support')

In your cypress.json set wildcard with files to watch. For example

{
  "cypress-watch-and-reload": {
    "watch": "page/*"
  }
}

Every time you change one of the files matching the wildcard, Cypress will reload itself, rerunning the tests.

You can use a list of files / wildcard patterns to watch:

{
  "cypress-watch-and-reload": {
    "watch": ["page/*", "src/*.js"]
  }
}

This package uses chokidar under the hood, see plugins.js. The client-side setup is disabled if you are running Cypress in non-interactive mode using cypress run command.

UI

There is a button to disable watching the files, which is useful sometimes to modify lots of files before running the tests.

Toggle button

Example

See the projects cypress-watch-and-reload-example and chat.io

Details

This plugin opens a WebSocket connection from Cypress to its Node backend. The backend is watching the specified files. Whenever you change a file, Cypress will notice and will reload itself, rerunning tests.

Development

To see the plugin in action, open Cypress in this repository

npm run cy:open

Then edit and save any file in the "page" folder and see the tests re-run automatically.

Small print

Author: Gleb Bahmutov <[email protected]> © 2020

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

MIT License

Copyright (c) 2020 Gleb Bahmutov <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].