forked from mosip/mosip-functional-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mosip#1643 from mosip/mohanachandran-s-patch-1
MOSIP-36480 - Apitest commons 1.2.2 release
- Loading branch information
Showing
1 changed file
with
38 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,47 @@ | ||
# Functional Tests | ||
# MOSIP Functional Tests | ||
|
||
## Overview | ||
This repo contains API automation test rig. The automation written using Java REST Assured and TestNG framework. The following modules are covered: | ||
1. Pre-registration | ||
1. Masterdata | ||
1. Partner Management | ||
1. ID Repository | ||
1. IDA | ||
1. Resident | ||
1. E-Signet | ||
1. Mimoto | ||
|
||
The test rig has multi-language support - input can be provided in any of the languages configured in a given MOSIP installation. | ||
|
||
## Test categories | ||
* Smoke: only positive scenarios. | ||
* Regression: all scenarios. | ||
|
||
## Coverage | ||
Only external API endpoints are covered. | ||
|
||
## Pre-requisites: | ||
1. Java 11 and Maven (3.6.0) software should be installed on the machine from where the automation tests will be executed | ||
2. Lombok should be configured. Ref. https://projectlombok.org/ | ||
|
||
|
||
The API Test Rig Commons is a shared code base that is used for the execution of module-wise automation API tests. This uses Java REST Assured and TestNG frameworks to automate testing for different modules like Pre-registration, Masterdata, Partner Management, PMS, ID Repository, IDA, Resident, E-Signet, and Mimoto. | ||
|
||
## Pre-requisites | ||
|
||
Ensure the following software is installed on the machine from where the automation tests will be executed: | ||
|
||
- Java 21 | ||
- Maven 3.9.6 or higher | ||
- Lombok (Refer to [Lombok Project](https://projectlombok.org/)) | ||
|
||
### For Windows | ||
1. Git bash (2.18.0.windows.1) | ||
2. `settings.xml` needs to be present in one place in `.\m2`. | ||
|
||
|
||
- Git Bash 2.18.0 or higher | ||
- `settings.xml` needs to be present in the `.m2` folder. | ||
|
||
### For Linux | ||
1. `settings.xml` file needs to be present in two places: | ||
* regular maven conf folder | ||
* copy the same settings.xml under /usr/local/maven/conf | ||
|
||
## Access test automation code | ||
1. From Browser: | ||
* ‘Clone or download’ https://github.com/mosip/mosip-functional-tests as zip | ||
* Unzip the contents | ||
* Continue with below steps from a terminal (Linux) or command prompt (Windows) | ||
|
||
2. From Git Bash: | ||
* Copy the git link i.e "https://github.com/mosip/mosip-functional-tests" | ||
* On your local sytem, gitbash at any location | ||
* Run the "git clone https://github.com/mosip/mosip-functional-tests" command | ||
|
||
## Build Authentication Demo Service | ||
``` | ||
cd authentication-demo-service | ||
``` | ||
``` | ||
mvn clean install | ||
``` | ||
|
||
- `settings.xml` file needs to be present in two places: | ||
- Regular Maven conf folder | ||
- Copy the same `settings.xml` under `/usr/local/maven/conf` | ||
|
||
## Access Test Automation Code | ||
|
||
### From Browser | ||
|
||
1. Clone or download the repository as a zip file from [GitHub](https://github.com/mosip/mosip-functional-tests). | ||
2. Unzip the contents. | ||
3. Continue with the steps below from a terminal (Linux) or command prompt (Windows). | ||
|
||
### From Git Bash | ||
|
||
1. Copy the git link: `https://github.com/mosip/mosip-functional-tests` | ||
2. On your local system, open Git Bash at any location. | ||
3. Run the following command: | ||
```sh | ||
git clone https://github.com/mosip/mosip-functional-tests | ||
|
||
## Build Test Automation Code | ||
``` | ||
cd ../automationtests | ||
``` | ||
``` | ||
mvn clean install | ||
``` | ||
This creates the jar file in the ‘target’ folder | ||
|
||
## Execute Test Automation Suite | ||
|
||
Execute the jar from the target folder on the application code deployed. In this example, the application code is run on <base_env> | ||
|
||
### Command to use: | ||
``` | ||
cd target/ | ||
java -jar -Dmodules=prereg -Denv.user=dev2 -Denv.endpoint= <base_env> -Denv.testLevel=smokeAndRegression automationtests-1.2.0.1-SNAPSHOT-jar-with-dependencies.jar | ||
``` | ||
### Details of the arguments used | ||
* env.user = user of the env on which you will run the jar file. | ||
* env.endpoint = env where the application under test is deployed. Change the env hostname from <base_env> to any env that you will work on | ||
* env.testlevel = this parameter has to be ‘smoke’ to run only smoke test cases, and it has to be ‘smokeandRegression’ to run all tests of all modules | ||
* jar = specify the jar file to be executed | ||
* The version of the jar file name changes as per development code version. | ||
Example: Current version of Dev Code Base is 1.2.0.1 so the jar name will be automationtests-1.2.0.1-SNAPSHOT-jar-with-dependencies.jar | ||
|
||
## Build and run | ||
|
||
* Run smoke and regression | ||
1. cd ../apitest-commons | ||
2. `mvn clean install -Dgpg.skip=true -Dmaven.gitcommitid.skip=true` | ||
|
||
## License | ||
This project is licensed under the terms of [Mozilla Public License 2.0](https://github.com/mosip/mosip-platform/blob/master/LICENSE) |