Alcohol Duty UI Tests Link: https://github.com/hmrc/alcohol-duty-ui-tests
Start the docker desktop application (and make sure the mongodb is running on the docker)
Start Alhocol Duty
services as follows:
sm2 --start ALCOHOL_DUTY_ALL
To test specific microservices in your local, stop the microservice(s) you'd like to test using service-manager. Example: sm2 --stop ALCOHOL_DUTY_RETURNS_FRONTEND
Run the microservice(s) you'd like to test using sbt:
- If running ALCOHOL_DUTY_RETURNS_FRONTEND or ALCOHOL_DUTY_RETURNS: start using test only routes:
sbt "run -Dapplication.router=testOnlyDoNotUseInAppConf.Routes"
- If running other microservices: start normally:
sbt run
./run_tests.sh
Pass below parameters to the VM options under the configuration (Edit Configuration -> VM Options) -Denv=local -Dbrowser=chrome -Dbrowser.option.headless=false -Dwebdriver.chrome.driver= To enable headless mode replace <-Dbrowser.option.headless=false> with <-Dbrowser.option.headless=true> in the VM option
Start Mongo Docker container as follows:
docker run --rm -d -p 27017:27017 --name mongo percona/percona-server-mongodb:
Then, run the below command to execute tests
./run_browser_with_docker.sh
(* Argument <browser>
must be remote-chrome
, remote-edge
or remote-firefox
)
Since the introduction of the ui-test-runner, there is no need to run the Accessibility and ZAP tests separately. They are now part of the test runs. And, no need to tag any tests with @ZAP or @a11y to run ZAP tests or accessibility tests, respectively.
Connect to 127.0.0.1:5900
via a VNC client to inspect and debug test execution.
If prompted for a password the default is secret
.
Download the BrowserStack local executable from the following links and extract the file: Linux - https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip Mac - https://www.browserstack.com/browserstack-local/BrowserStackLocal-darwin-x64.zip Run the executable with the automate key of your browserstack account - ./BrowserStackLocal accessKey. Access key can be found at https://www.browserstack.com/accounts/settings Run the shell script - ./run_browserStack_tests.sh Select the browser to run the test. To view the running tests in browserstack, navigate to https://automate.browserstack.com/
Download the latest Chromedriver from (https://googlechromelabs.github.io/chrome-for-testing/). Extract the zip file and save the driver in the following folder - /usr/local/bin/
This code is open source software licensed under the Apache 2.0 License.