- Testing process
Connect to the VPN and run: DEBUG=axios yarn start:dev
- Open
src/test/functional/features/pay-your-fee.feature
and changeAnd I click "Continue to payment"
toAnd I click "Stop here"
- In another terminal run
yarn test:cucumber:grep "Continuing to payment"
- A browser will open and setup the case and will stop just before continuing to payment to allowing you check any of the pages from the check your answers so far page
- Copy
src/test/cross-browser/features/happy-path.feature
tosrc/test/functional/features/happy-path.feature
- In another terminal run
yarn test:cucumber:grep "Successfully submitting a no fault union dissolution application"
- Open
src/test/functional/features/joint-check-your-answers.feature
and changeThen the page should include "Your answers will be sent ...
toThen the page should include "Stop here"
- In another terminal run
yarn test:cucumber:grep "Checking completed answers as a joint applicant"
- A browser will open and setup the case and will stop just before submitting for their partner to allowing you check any of the pages from the check your answers so far page
- Open
src/test/functional/features/applicant2/enter-your-access-code.feature
and changeThen the page should include "You need to review your joint application"
toThen the page should include "Stop here"
- In another terminal run
yarn test:cucumber:grep "They have entered the correct case reference"
- A browser will open and setup the case and will stop just after linking applicant 1 case to applicant 2 to allowing you check any of the pages from the check your answers so far page
- Install
adoptopenjdk11
from brew/apt etc. - Checkout
[email protected]:hmcts/nfdiv-case-api.git
- Run
./gradlew generateTypeScript
to generatebuild/ts/index.ts
- Checkout
[email protected]:hmcts/nfdiv-frontend.git
- Copy
nfdiv-case-api/build/ts/index.ts
tonfdiv-frontend/src/main/app/case/definition.ts
- Run
yarn lint
to show any data mismatches between the frontend and backend
Unit tests are written in Jest and can be started by running yarn test
.
Code coverage is set at 90% and is reported by Sonar.
Functional tests are written in Cucumber syntax with Codecept running them against their step implementations.
Tests locally are run via Playwright/Puppeteer using Chromium on Jenkins these run inside of a Docker container.
Testing error conditions, edge cases, more complex or lengthy functional tests are marked with @nightly
which will run in the nightly 4am job
Tests can be marked as @flaky
to skip them if they're failing and require fixing.
- Running all tests
yarn test:cucumber
(including@nightly
) - Running
master
and branch testsyarn test:e2e
Happy path cross browser tests are written in Cucumber syntax with Codecept running them against their step implementations.
These are run via Playwright - Chrome/Edge, Safari and Firefox and SauceLabs in Windows 10 and Microsoft Edge.
Running cross browser tests locally, start the server then run:
TEST_HEADLESS=false yarn test:crossbrowser:playwright
See README.md
for more information on testing and connecting to SauceLabs.