Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

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.

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

Cypress workflow

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

Workflow runs find here in the repository

Workflow_location.png

Chefs uses test IDIR and password as GitHub secrets to run cypress tests. By default workflow triggers and cypress runs on dev environment for each push to main branch . When a dev wants to run the cypress tests after the new code pushes to PR environment, Then dev needs to update the GitHub secrets in order to run it on the PR environment. The secrets are stored in the following manner.

Confluence_cypress_workflow.png

secret variable KEYCLOAKUSERNAME is test IDIR username and KEYCLOAKPASSWORD is test IDIR password. secret variable DEPENV is by default stored as app. For example if a dev wants to run the new code in the PR environment, then needs to update the secret DEPENV to new variable say PR-1114 (whatever is the PR number) . After saving that dev needs to re run the workflow(manually) and check the cypress result for any failed tests.

Cypress report for the successful run will be like this

cypress_sucess_report.png

Cypress report with the failed tests will be look like below with screenshots available to download to view where the test fails

Cypress_failure_report.png

  • No labels