Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CHEFS uses CYPRESS for test automation. Cypress is a UI testing tool, which is used for functional testing of web applications. It uses JavaScript framework and can test anything that runs in browser.

Prerequisites

Node.js needs to be installed on the machine before cypress installation

...

Set up

Make sure you have installed Node.js and go to project path /common-hosted-form-service/tests/functional and run the following commands to install cypress

Code Block
npm init
npm install cypress --save-dev

...

Cypress Tests

Cypress tests are stored inside the folder/common-hosted-form-service/tests/functional/cypress/e2e

Cypress test scripts are found in https://github.com/bcgov/common-hosted-form-service/tree/main/tests/functional/cypress/e2e

To run the cypress tests heedlessly, go to project root /common-hosted-form-service/tests/functional and run the following command

Code Block
npm run test

To open the cypress interface and the tests from there , go to project root /common-hosted-form-service/tests/functional and run the following command and can see cypress test scripts inside e2e folder

Code Block
npx cypress open

...

Environment variables

All the env variables are stored in cypress.config.js file in the project path /common-hosted-form-service/tests/functional

...

Cypress workflow

Cypress workflow file will find here https://github.com/bcgov/common-hosted-form-service/tree/main/.github/workflows

...