Skip to content

hmrc/pillar2-acceptance-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pillar2-acceptance-tests

Acceptance tests for Pillar2 Application Features

This repository is the automated acceptance tests for Pillar2 Application which include below pages:

These are the acceptance tests for the Pillar2 (Global Minimum Tax) service, which covers user journeys such as Submitting Eligibility Questions, User Registration, Subscription, Amend Subscription, and Maintaining Pillar2 tax for MNEs. This service is tested on the Jenkins build pipeline for tests that run through the full journey pages included below:

Examples

The structure of the project is as follows:

├── src
│   └── test
│       ├── resources
│       │   ├── features      # The Cucumber feature files
│       │   ├── application.conf  
│       │   ├── cucumber.properties
│       │   └── testdata
│       └── scala
│           └── uk
│               └── gov
│                   └── hmrc
│                       └── test
│                             └── ui
│                               │  └── conf
│                               │       └── TestConfiguration
│                               └── cucumber
│                               │       └── runner             #The different runners to start the tests 
│                               │       │      └── Runner
│                               │       │      └── SoloRunner
│                               │       │      └── ZapRunner
│                               │       └── stepdefs     # The step definitions
│                               │       │      └── BaseStepDef       # shutdown hooks
│                               │       │      └── CommonFunctions   # common step definitions
│                               │       │      └── StepDef           # combined step definitions
│                               │       │      └── Hooks             # start up and tear down methods for tests
│                               │       │      └── Page1             # step definition methods of Page1  
│                               │       │      └── Page2             # step definition methods of Page1 
│                               │       │      :
│                               │       │      :
│                               │       └── Check       # The shared test utils
│                               │       └── Find        # The shared test utils
│                               │       └── Forms       # The shared test utils
│                               │       └── Input       # The shared test utils
│                               │       └── Nav         # The shared test utils
│                               │       └── PageObject  # The shared test utils
│                               │       └── Wait        # The shared test utils
│                               └── driver
│                               │      └── BrowserDriver # setup webdriver object
│                               └── pages
│                                     └── BasePage     # common page methods
│                                     └── Page1        # page methods
│                                     └── Page2
│                                     :
│                                     :
|
└── target
│     └── test-reports
│        └── html-report      # The Cucumber report and test run screenshots
├── .gitignore                   # To ensure that certain files not tracked by Git remain untracked
├── .build.sbt                   # script file to build the project
├── LICENCE                      # License details
├── README.md                    # Read me file
├── run_accessibility_tests.sh   # Script file to run acaccessibility tests  
├── run_solo.sh                  
├── run_tests.sh                 # Script file to run acceptance tests      
├── run_zap_tests.sh             # Script file to run security tests on jenkins
└── run_zap_tests_local.sh       # Script file to run security tests on local

It is built using the following:

  • Cucumber(BDD),
  • Selenium-WebDriver,
  • SBT (build tool),
  • Scala

Getting started

Running the Test Suite

Acceptance tests for Pillar2 Service
=========================================

How to use this ?
-----------------
1. Clone the project to a directory of your choice
2. Import the project in IntelliJ
3. Navigate to the directory where you have the cloned pillar2-frontend project. Run below command to use testonly route locally:
  `sbt "run -Dplay.http.router=testOnlyDoNotUseInAppConf.Routes 10050"
4. On a terminal instance run: `sm --start PILLAR2_ALL`  
5. Navigate to the directory where you have the cloned pillar2 acceptance testes project
6. Run: `./run_tests.sh`

IntelliJ 
---------
- Create a new JUnit task and set the class to uk.gov.hmrc.test.ui.cucumber.runner
- Change use "classpath of module" to pillar2-acceptance-tests     

Source code formatting

We use Scalafmt to format our code base.

In case of contribution and you are an IntelliJ user, you should install the scalafmt plugin, select Scalafmt as Formatter and flag the checkbox "Reformat on file save" (_Settings -> Editor -> Code Style -> Scala). You can format your code by using the alt+shift+L or option+command+L shortcut

Format at project level under src/test

sbt test:scalafmt

Run acceptance tests locally and on Jenkins

./run_tests.sh

Run security tests locally

To run zap tests for any of the services, download from https://www.zaproxy.org/download/, extract and execute the following in the root of the extracted folder:

./zap.sh -daemon -config api.disablekey=true -port 11000 and run

./run_zap_tests_local.sh

Run security tests on jenkins

./run_zap_tests.sh

Run accessibility tests locally

./run_accessibility_tests.sh

License

This code is open source software licensed under the Apache 2.0 License.