Giter Club home page Giter Club logo

hmrc.national-duty-repayment-center-acceptance-tests's Introduction

This is a template README.md. Be sure to update this with project specific content that describes your ui test project.

national-duty-repayment-center-acceptance-tests

UI test suite for the <digital service name> using WebDriver and <scalatest/cucumber>.

Running the tests

Prior to executing the tests ensure you have:

  • Docker - to run a Chrome or Firefox browser inside a container
  • Appropriate drivers installed - to run tests against locally installed Browser
  • Installed MongoDB
  • Installed/configured service manager.

Run the following command to start services locally:

sudo mongod
sm --start UI_TEST_TEMPLATE -f

Then execute the run_tests.sh script:

./run_tests.sh <environment> <browser-driver>

The run_tests.sh script defaults to the local environment with the locally installed chrome driver binary. For a complete list of supported param values, see:

  • src/test/resources/application.conf for environment
  • webdriver-factory for browser-driver

Running tests against a containerised browser - on a developer machine

The script ./run-browser-with-docker.sh can be used to start a Chrome or Firefox container on a developer machine. The script requires remote-chrome or remote-firefox as an argument.

Read more about the script's functionality here.

To run against a containerised Chrome browser:

./run-browser-with-docker.sh remote-chrome 
./run_tests.sh local remote-chrome

./run-browser-with-docker.sh is NOT required when running in a CI environment.

Running the tests against a test environment

To run the tests against an environment set the corresponding host environment property as specified under <env>.host.services in the application.conf.

For example, to execute the run_tests.sh script against QA environment using Chrome remote-webdriver

./run_tests.sh qa remote-chrome

Running ZAP tests

ZAP tests can be automated using the HMRC zap-automation library. It is not mandatory to do so and should not be considered a substitute for manual exploratory testing using OWASP ZAP.

Tagging tests for ZAP

It is not required to proxy every journey test via ZAP. The intention of proxying a test through ZAP is to expose all the relevant pages of an application to ZAP. So tagging a subset of the journey tests or creating a single ZAP focused journey test is sufficient.

Configuring the browser to proxy via ZAP

Setting the system property zap.proxy=true configures the browser specified in browser property to proxy via ZAP. This is achieved using webdriver-factory.

zap-automation config

Running ZAP tests require passing a zap-automation config object to the zap-automation library. zap-automation config is defined in the application.conf. The config is passed to the zap-automation library via ZapSpec from which the ZAP tests are triggered.

Executing a ZAP test

The shell script run_zap_tests.sh is available to execute ZAP tests. The script first proxies a set of journey tests, tagged as ZapTests, via ZAP. Upon completion, the script then triggers a ZAP scan for the provided zap-automation config.

For example, to execute ZAP tests locally using a Chrome browser

./run_zap_test.sh local chrome

To execute ZAP tests locally using a Chrome browser

./run-browser-with-docker.sh remote-chrome 
./run_zap_test.sh local remote-chrome

./run-browser-with-docker.sh is NOT required when running in a CI environment.

For more information about ZAP tests, please refer to the zap-automation documentation.

Running tests using BrowserStack

If you would like to run your tests via BrowserStack from your local development environment please refer to the webdriver-factory project.

This project supports UI test execution using Firefox (Geckodriver) and Chrome (Chromedriver) browsers.

See the drivers/ directory for some helpful scripts to do the installation work for you. They should work on both Mac and Linux by running the following command:

./installGeckodriver.sh <operating-system> <driver-version>
or
./installChromedriver <operating-system> <driver-version>
  • defaults to linux64, however it also supports macos
  • defaults to 0.21.0 for Gecko/Firefox, and the latest release for Chrome. You can, however, however pass any version available at the Geckodriver or Chromedriver repositories.

Note 1: You will need to ensure that you have a recent version of Chrome and/or Firefox installed for the later versions of the drivers to work reliably.

Note 2 These scripts use sudo to set the right permissions on the drivers so you will likely be prompted to enter your password.

hmrc.national-duty-repayment-center-acceptance-tests's People

Contributors

anu9 avatar simms11 avatar lmugnai avatar chandaksweta avatar hmrc-web-operations avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.