Skip to content

Cypress tests

Will Lin edited this page Aug 4, 2021 · 14 revisions

Pre-requisites

  • Ensure redis/postgres are running
  • Seed with test data
    • cd backend/core
    • yarn db:reseed
  • yarn dev:backend in a separate terminal

Running sites/public

  • yarn test:app:public:headless
    • see failures
  • Run once you know the backend is running
    • cd sites/public && yarn test:headless
  • WARNING: the tests modify your database, so you may need to db:reseed if you see failures on the second or later run.

Running sites/partners

  • cd sites/partners
  • yarn test:headless
    • [1] Cypress could not verify that this server is running:
      [1]
      [1]   > http://localhost:3000
      
    • Edited cypress.json to have localhost:3001
  • yarn test:headless
    • Broken, also in bloom-housing/bloom.

Interactive

  • @willrlin was able to get yarn cypress open to work in linux. I changed the browser to Electron and was able to run tests and see log output.
  • In #171, @anders-schneider said he could get the cypress desktop app to show up but not run the tests.

Debugging

  • Add .debug() to places where you need to debug an interactive run and then ensure developer tools are open in your browser when the test is run.
  • Example: cy.request("GET", listingsUrl).debug()