Closed kalapyha closed 1 year ago
We can add cypress
and create/update action to run e2e tests for each PR
Please read the doc here https://www.cypress.io/ for more information
Done.
Now we have a full setup for e2e
tests using Cypress
.
I've added a workflow so we are running these tests on push
too.
You can also check this Badge
Here's an example of how you could add Cypress to an existing React project and run tests using GitHub Actions:
[x] First, you will need to install Cypress by running npm install cypress or yarn add cypress in your project.
[x] Next, you will need to add Cypress commands to your project's package.json file, such as "cy:open": "cypress open" and "cy:run": "cypress run"
[x] Create a new directory in your project called cypress and add a new file called cypress.json to configure Cypress.
[x] Now you can open Cypress by running npm run cy:open or yarn cy:open
[x] Once Cypress is open you can start writing your tests.
[x] To run tests using GitHub Actions, you will need to create a new workflow in your project's .github/workflows directory. Here's an example workflow that runs tests using Cypress:
This workflow will run Cypress tests on the main branch every time you push to it.