Skip to content

Conversation

@ajsaraujo
Copy link
Contributor

@ajsaraujo ajsaraujo commented May 25, 2022

Description

Adds some integration tests, made with Cypress.

  • npm run cypress:dev to run them in headed mode
  • npm run cypress:ci to run them in headless mode

Video

mob-timer.spec.js.mp4

Comment on lines +7 to +11
"cypress:ci": "cypress run",
"cypress:dev": "cypress open",
"start-server": "grunt",
"test:dev": "start-server-and-test start-server http://localhost:8080 cypress:dev",
"test:ci": "start-server-and-test start-server http://localhost:8080 cypress:ci"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do this through Grunt, since it's what the project uses for all it's tasks, but I couldn't do it.

For Cypress to work, you need to run both the dev server and Cypress server in parallel. However, for parallel tasks support in Grunt, it seems you need to install a plugin, so I used this start-server-and-test library instead, which seemed to be simpler. Let me know what you think about it.

Once we get this task-running-setup-thing straight, if it interests you, we can also create a GitHub Action to run the tests (and other tasks, such as linting) against each pull request.

@ajsaraujo ajsaraujo changed the title Draft: Add integration tests with Cypress Add integration tests with Cypress Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant