CPS E2E testing framework built with Java, Maven, Cucumber PICO container, and RestAssured. It allows writing readable and maintainable test scenarios for REST APIs.
- Java 25
- Maven 3.9.12
- IDE (IntelliJ)
- stepdefs: Contains Java methods that map to Gherkin steps.
- runners/: Holds the Cucumber test runner classes (e.g., using JUnit).
- utils/: Utility classes for config management, API requests, etc.
- features/: Contains .feature files written in Gherkin syntax.
- .env.*: Environment-specific variables for API base URLs, tokens, etc.
- pom.xml: Maven dependencies and build configuration.
The repository contains template files:
.env.dev.sample.env.qa.sample
These files contain placeholder values and serve as templates only.
-
In the project root directory, locate the sample file:
.env.dev.sample(for Development).env.qa.sample(for QA)
-
Right-click the file → Copy
-
Right-click in the same folder → Paste
-
Rename the copied file:
- From
.env.devSample→.env.dev - From
.env.qaSample→.env.qa
- From
-
Open the new file and update the value of the CPS_USER= and PASSWORD= credentials.
- Do NOT commit
.env.devor.env.qato Git. - Only the
Samplefiles should exist in the repository. - Each developer/QA must maintain their own local
.envfile.
Generate encoded password using SecurePassCode.class
Create intellij cucumber default configuration Edit run configuration --> Edit Configuration Template --> Cucumber Template
NOTE:- CPS_USER should not be added with .CIN3 or .CIN5
all the tests should be tagged with @ui, else browser instance won't get created
New page is created, newly created page reference needs to added in Pages.class
TWIF cases uses messaging up, for now run locally instructions are found Link https://dev.azure.com/CPSDTS/Information%20Management/_git/Cps-Police-Message-Simulator-Api?path=/README.md
npx playwright codegen --target=java
To execute all Cucumber API tests, run the following command from the project root:
mvn clean test -DargLine="--enable-native-access=ALL-UNNAMED" //Enables native access to suppress Java 17+ warnings
mvn clean test -Denv=qa -Dbrowser=edge -Dheadless=true -Dtracing=true -Dvideo=true
mvn clean test -Dcucumber.filter.tags="@ui and @api"
mvn clean test -Dcucumber.filter.tags="not @ui" // not ui tests
To integrate your feature branch into the develop branch with a clean history and without force pushing, follow these steps:
git checkout your-branch-name
git rebase develop
git checkout develop
git merge your-branch-name
git push origin develop
Maintainer and contributor to the E2E testing .
- Arvin Thoom – QA Tester
- Murali Govindachar – QA Tester
- Venkata Mannepalli – QA Tester
- Patrick Obiaso – QA Tester
