Started on this by trying to add Cypress e2e testing to js-dom-todos -- see branch jules-cypress-test.
Created a test suite for the Standard Criteria -- located in directory cypress/tests/e2e.
To run tests locally, the server must be running.
You can run npm run test:ui which will run the server and open the Cypress test UI, allowing you to interact with the frontend and modify the tests using Cypress Studio. I didn't need it for this very simple example but could be useful in future for more complex repos to create initial interactions that you can then refine.
Or you can run just the tests without the UI by running npm test. It will run the tests in the shell and terminate once the tests have run. It will also generate and save a video of the tests so you can see what happens -- generated in cypress/videos (added to .gitignore to not blow up GitHub).
The cypress.config.js file is minimal at the moment - the most important setting is experimentalStudio: true, which allows us to use the interactive Cypress Studio mode to modify/add tests. It's a clever feature but it is still experimental, so it's not always the most efficient or appropriate (e.g. it sometimes uses its own commands incorrectly; the query selectors can be too specific for our use-cases; etc.)
There is a GitHub Action setup, but it is not running correctly at the moment, and I've yet to figure out why. The action is only setup for jules-cypress-test branch, and I am testing it out via the branch jules-cypress-test-implementation. The issue is that whilst the server runs, the test suite can never seem to make an API request to it, stating ECONNREFUSED.
I started a Discord chat about it here, which includes the link to a Stack Overflow question I've posted with all the details.
CURRENT STATUS [24 Feb 2023] -- BLOCKED
Started on this by trying to add Cypress e2e testing to js-dom-todos -- see branch
jules-cypress-test
.cypress/tests/e2e
.npm run test:ui
which will run the server and open the Cypress test UI, allowing you to interact with the frontend and modify the tests using Cypress Studio. I didn't need it for this very simple example but could be useful in future for more complex repos to create initial interactions that you can then refine.npm test
. It will run the tests in the shell and terminate once the tests have run. It will also generate and save a video of the tests so you can see what happens -- generated incypress/videos
(added to.gitignore
to not blow up GitHub).cypress.config.js
file is minimal at the moment - the most important setting isexperimentalStudio: true
, which allows us to use the interactive Cypress Studio mode to modify/add tests. It's a clever feature but it is still experimental, so it's not always the most efficient or appropriate (e.g. it sometimes uses its own commands incorrectly; the query selectors can be too specific for our use-cases; etc.)jules-cypress-test
branch, and I am testing it out via the branchjules-cypress-test-implementation
. The issue is that whilst the server runs, the test suite can never seem to make an API request to it, statingECONNREFUSED
.