Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/testing #3360

Merged
merged 21 commits into from
Apr 18, 2018
Merged

Feature/testing #3360

merged 21 commits into from
Apr 18, 2018

Conversation

edbrett
Copy link
Contributor

@edbrett edbrett commented Apr 12, 2018

Time to add some testing to GFW. This PR aims to introduce a new testing platform for end-to-end testing alongside tidying up a lot of the old testing code. We have decided to go with Cypress as a testing library (https://www.cypress.io/). We have 2 testing flows:

  1. RSpec - these are simple route tests with some slightly more complicated ones for the map and download section.

  2. Cypress integration tests - currently only testing the landing page route for rendering.

Local Testing

You can perform local testing in a variety of ways:

  • npm run test - will run the full sets of tests for rspec and cypress. These will run in the terminal and with any errors/feedback there.

  • npm run test:open- will open the cypress testing panel. You can then run the tests you want locally and is very powerful for helping you to debug and write new tests

  • bundle exec rspec - run all rails tests.

CI Testing

We are using TravisCI integrated with github to handle the CI testing pipeline. npm run ci is the script used to trigger all testing scripts. This means that the package.json has been updated to handle the build, server start, and script running through travis. The old Rails tests (all were failing) have been updated and the cypress tests have been included:

@edbrett edbrett added the WIP Any PR that should not be merged to develop label Apr 12, 2018
@edbrett edbrett force-pushed the feature/testing branch 2 times, most recently from 549a44b to 97254d5 Compare April 12, 2018 16:08
@edbrett edbrett removed the WIP Any PR that should not be merged to develop label Apr 17, 2018
@pjosh pjosh self-requested a review April 18, 2018 09:12
Copy link
Contributor

@pjosh pjosh left a comment

Choose a reason for hiding this comment

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

Pretty awesome! 👏 👏
Only one question! We should include /cypress/screenshots & /cypress/videos inside the .gitignore?

@edbrett
Copy link
Contributor Author

edbrett commented Apr 18, 2018

Done!

@edbrett edbrett merged commit 0513b04 into develop Apr 18, 2018
@edbrett edbrett deleted the feature/testing branch April 18, 2018 09:22
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.

None yet

2 participants