/
Automation Testing

Automation Testing

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

npm init npm install cypress --save-dev


Cypress Tests

 

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

For headless cypress runs, go to project root /common-hosted-form-service/tests/functional and run the following command

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

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 cypress-ci.yaml will be in the project path /common-hosted-form-service/.github/workflows

Chefs uses test IDIR and password as GitHub secrets to run cypress tests. The secrets are stored in the following manner. Secret variable KEYCLOAKUSERNAME is test IDIR username and KEYCLOAKPASSWORD is test IDIR password.

image-20240528-045612.png

Cypress workflow triggers automatically after each PR deployment. Cypress report will be look like this

image-20250221-211940.png

Related content

CHEFS Operational Tools
CHEFS Operational Tools
More like this
Local CHEFS Instance Setup
Local CHEFS Instance Setup
More like this
CHEFS Refresher with CoCo Team
CHEFS Refresher with CoCo Team
More like this
CHEFS Value Team
More like this
CHEFS Sprint 35 - Prioritized Objectives
CHEFS Sprint 35 - Prioritized Objectives
More like this