We use Cypress for testing.
Update an environment config file to test against:
cp config/base_config.json public/config.json
npm test
Create a .local.env with the following
HOST=local.dsde-dev.broadinstitute.org
HTTPS=true
SSL_CRT_FILE=server.crt
SSL_KEY_FILE=server.key
Update baseUrl
in cypress.config.js
and url
in cypress/support/commands.js
to
https://local.dsde-dev.broadinstitute.org:3000
Set env
to local
in config.json
Start a local server:
npm start
Generate configs locally
./scripts/render-accounts.sh
Open Cypress' interactive view:
npm run cypress:open
Run Cypress headless:
npm run cypress:run
See https://www.cypress.io/blog/2021/04/06/introducing-the-cypress-component-test-runner/ for more detailed information
This command opens a browser window with component tests visible.
You don't need to have a running server started, this will do that for you.
(Note that specifying any port with open-ct
will default to 3000, this seems to be a cypress bug)
npx cypress open
This runs component tests headless:
npx cypress run --component