Current chrome issue: [21/11/25] There is a current issue when running tests using later versions of chrome as per https://hmrcdigital.slack.com/archives/C0J8BH46N/p1760607965741119. As a workaround we must use version 128. In order to do so we must also add the following properties to the CLI
-Dbrowser.usePreviousVersion=trueFor the foreseeable future (this applies to all subsequent commands associated with chrome) e.g. Run the following command to trigger the test via the CLI.
sbt clean -Dbrowser="chrome" -Denvironment="local" -Dbrowser.usePreviousVersion=true test
The scripts are also updated, and once this is fixed we'll need to remove them
- Start the needed services in a terminal session with the following command:
sm2 --start SAO_ALL- Run your tests with the following command:
sbt clean -Dbrowser="chrome" -Denvironment="local" test| Parameter | Supported values |
|---|---|
-Dbrowser |
chrome, edge, firefox |
-Denvironment |
local, dev, qa |
We have a few convenience scripts that take chrome as a default value for browser and local as environment.
- From your terminal, run the following command:
./run_all_tests.sh- Add the
SoloTeststag to the scenario(s) you wish to run as per the below example:
- From your terminal, run the following command:
./run_solo_tests.sh- Remember to remove the
SoloTeststag(s) added when testing before pushing code to a pull request.
- To run only the submission tests, ensure
SubmissionUITeststag is added to the respective scenario(s). These should already be tagged. - From a terminal run:
./run_submission_ui_tests.sh- To run only the registration tests, ensure
RegistrationUITeststag is added to the respective scenario(s). These should already be tagged. - From a terminal run:
./run_registration_ui_tests.sh- First run the DAST tool locally.
- The following script is available to execute ZAP tests. The script proxies the journeys tagged with 'ZapTests' via ZAP.
./run_local_zap_tests.shSteps to verify in MongoDB Compass that the 'user-answers' collection is updated for the upload submission template.
- Before connecting to mongoDB, please ensure the Upscan service is up and running locally on sm2.
- Run the 'mongosh' command in the terminal to retrieve the mongoDB url (e.g. URL: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.8.2).
- Launch MongoDB Compass, paste the mongoDB url into connection field , and connect to the database.
- Navigate to and open the 'user_answers' collection under the senior-accounting-officer-submission-frontend.
- The 'data.notificationUpload.reference' is added and the 'statusType' is set to 'InProgress' in the 'user-answers' collection after user navigates to the notification upload form page on UI.
- The 'statusType' is updated to 'UploadedSuccessfully' after user uploaded csv file on UI, and refresh the collection to verify the updated 'statusType'.
Check all project files are formatted as expected as follows:
sbt scalafmtCheckAll scalafmtCheckFormat *.sbt and project/*.scala files as follows:
sbt scalafmtSbtFormat all project files as follows:
sbt scalafmtAllVisit the official Scalafmt documentation to view a complete list of tasks which can be run.
This code is open source software licensed under the Apache 2.0 License.
