Cypress

https://www.cypress.io/

Setup steps

  • Download and set up firebase emulators if you have not already: firebase init emulators

    • You may be prompted to install the JDK. Find the latest JDK here: https://www.oracle.com/java/technologies/downloads/

  • Import the staging version of the database (ask Will for this)

  • Stop and restart your local api server to make sure all emulators are running

  • To start the Cypress UI run yarn test:integration from the scraper folder

Notes

  • The visit() Cypress command has been overwritten to use some default options we use most often for testing. window.eth is mocked by default. For tests where you do not want window.eth mocked, pass "mockEthProvider": false in the options object as the second argument of the command.

  • When you write tests that create new records, please be sure to remove them. I tried to set this up to delete firebase auth user records after each test, as well.

  • I have seen some flakiness in tests but so far that's usually related to XHR requests taking longer than usual on some test runs. You can ask Cypress to wait for those requests to finish before continuing with your assertions using cy.wait(). Take a look at home_page_spec.ts to see how this is done.

Last updated