-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
319 additions
and
23 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,3 +1,173 @@ | ||
# Automation test | ||
# ESignet Signup API Test Rig | ||
|
||
All automation test code. | ||
## Overview | ||
|
||
The **ESignet Signup API Test Rig** is designed for the execution of module-wise automation API tests for the esignet signup services. This test rig utilizes **Java REST Assured** and **TestNG** frameworks to automate testing of the esignet signup service API functionalities. The key focus is to validate the Register user, Reset password, Identity verification and related functionalities provided by the esignet signup service module. | ||
|
||
--- | ||
|
||
## Test Categories | ||
|
||
- **Smoke**: Contains only positive test scenarios for quick verification. | ||
- **Regression**: Includes all test scenarios, covering both positive and negative cases. | ||
|
||
--- | ||
|
||
## Coverage | ||
|
||
This test rig covers only **external API endpoints** exposed by the esignet signup services module. | ||
|
||
--- | ||
|
||
## Pre-requisites | ||
|
||
Before running the automation tests, ensure the following software is installed on the machine: | ||
|
||
- **Java 21** ([download here](https://jdk.java.net/)) | ||
- **Maven 3.9.6** or higher ([installation guide](https://maven.apache.org/install.html)) | ||
- **Lombok** (Refer to [Lombok Project](https://projectlombok.org/)) | ||
- **setting.xml** ([download here](https://github.com/mosip/mosip-functional-tests/blob/master/settings.xml)) | ||
- **apitest-commons** library should be cloned and the JAR should be built. Refer to ([README](https://github.com/mosip/mosip-functional-tests/blob/release-1.3.0/apitest-commons/README.md)) | ||
|
||
### For Windows | ||
|
||
- **Git Bash 2.18.0** or higher | ||
- Ensure the `settings.xml` file is present in the `.m2` folder. | ||
|
||
### For Linux | ||
|
||
- The `settings.xml` file should be present in two places: | ||
- In the regular Maven configuration folder (`/conf`) | ||
- Under `/usr/local/maven/conf/` | ||
|
||
--- | ||
|
||
## Access Test Automation Code | ||
|
||
You can access the test automation code using either of the following methods: | ||
|
||
### From Browser | ||
|
||
1. Clone or download the repository as a zip file from [GitHub](https://github.com/mosip/esignet-signup). | ||
2. Unzip the contents to your local machine. | ||
3. Open a terminal (Linux) or command prompt (Windows) and continue with the following steps. | ||
|
||
### From Git Bash | ||
|
||
1. Copy the Git repository URL: `https://github.com/mosip/esignet-signup` | ||
2. Open **Git Bash** on your local machine. | ||
3. Run the following command to clone the repository: | ||
```sh | ||
git clone https://github.com/mosip/esignet-signup | ||
``` | ||
|
||
--- | ||
|
||
## Build Test Automation Code | ||
|
||
Once the repository is cloned or downloaded, follow these steps to build and install the test automation code: | ||
|
||
1. Navigate to the project directory: | ||
```sh | ||
cd api-test | ||
``` | ||
|
||
2. Build the project using Maven: | ||
```sh | ||
mvn clean install -Dgpg.skip=true -Dmaven.gitcommitid.skip=true | ||
``` | ||
|
||
This will download the required dependencies and prepare the test suite for execution. | ||
|
||
--- | ||
|
||
## Execute Test Automation Suite | ||
|
||
You can execute the test automation code using either of the following methods: | ||
|
||
### Using Jar | ||
|
||
To execute the tests using Jar, use the following steps: | ||
|
||
1. Navigate to the `target` directory where the JAR file is generated: | ||
```sh | ||
cd target/ | ||
``` | ||
|
||
2. Run the automation test suite JAR file: | ||
``` | ||
java -jar -Dmodules=signup -Denv.user=api-internal.<env_name> -Denv.endpoint=<base_env> -Denv.testLevel=smokeAndRegression -jar apitest-signup-1.3.0-SNAPSHOT-jar-with-dependencies.jar | ||
``` | ||
|
||
# Using Eclipse IDE | ||
|
||
To execute the tests using Eclipse IDE, use the following steps: | ||
|
||
## 1. **Install Eclipse (Latest Version)** | ||
- Download and install the latest version of Eclipse IDE from the [Eclipse Downloads](https://www.eclipse.org/downloads/). | ||
|
||
## 2. **Import the Maven Project** | ||
|
||
After Eclipse is installed, follow these steps to import the Maven project: | ||
|
||
- Open Eclipse IDE. | ||
- Go to `File` > `Import`. | ||
- In the **Import** wizard, select `Maven` > `Existing Maven Projects`, then click **Next**. | ||
- Browse to the location where the `api-test` folder is saved (either from the cloned Git repository or downloaded zip). | ||
- Select the folder, and Eclipse will automatically detect the Maven project. Click **Finish** to import the project. | ||
|
||
## 3. **Build the Project** | ||
|
||
- Right-click on the project in the **Project Explorer** and select `Maven` > `Update Project`. | ||
- This will download the required dependencies as defined in the `pom.xml` and ensure everything is correctly set up. | ||
|
||
## 4. **Run the Tests** | ||
|
||
To execute the test automation suite, you need to configure the run parameters in Eclipse: | ||
|
||
- Go to `Run` > `Run Configurations`. | ||
- In the **Run Configurations** window, create a new configuration for your tests: | ||
- Right-click on **Java Application** and select **New**. | ||
- In the **Main** tab, select the project by browsing the location where the `api-test` folder is saved, and select the **Main class** as `io.mosip.testrig.apirig.signup.testrunner.MosipTestRunner`. | ||
- In the **Arguments** tab, add the necessary **VM arguments**: | ||
- **VM Arguments**: | ||
``` | ||
-Dmodules=signup -Denv.user=api-internal.<env_name> -Denv.endpoint=<base_env> -Denv.testLevel=smokeAndRegression``` | ||
## 5. **Run the Configuration** | ||
- Once the configuration is set up, click **Run** to execute the test suite. | ||
- The tests will run, and the results will be shown in the **Console** tab of Eclipse. | ||
**Note**: You can also run in **Debug Mode** to troubleshoot issues by setting breakpoints in your code and choosing `Debug` instead of `Run`. | ||
--- | ||
## 6. **View Test Results** | ||
- After the tests are executed, you can view the detailed results in the `api-test\testng-report` directory. | ||
- Two reports will gets generated | ||
- First report is for pre-requisite testcases | ||
- Second report is for core testcases | ||
--- | ||
## Details of Arguments Used | ||
- **env.user**: Replace `<env_name>` with the appropriate environment name (e.g., `dev`, `qa`, etc.). | ||
- **env.endpoint**: The environment where the application under test is deployed. Replace `<base_env>` with the correct base URL for the environment (e.g., `https://api-internal.<env_name>.mosip.net`). | ||
- **env.testLevel**: Set this to `smoke` to run only smoke test cases, or `smokeAndRegression` to run both smoke and regression tests. | ||
- **jar**: Specify the name of the JAR file to execute. The version will change according to the development code version. For example, the current version may look like `apitest-signup-1.3.0-SNAPSHOT-jar-with-dependencies.jar`. | ||
### Build and Run Info | ||
To run the tests for both **Smoke** and **Regression**: | ||
1. Ensure the correct environment and test level parameters are set. | ||
2. Execute the tests as shown in the command above to validate esignet signup services API functionalities. | ||
--- | ||
## License | ||
This project is licensed under the terms of the [Mozilla Public License 2.0](https://github.com/mosip/mosip-platform/blob/master/LICENSE) |
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
8 changes: 4 additions & 4 deletions
8
api-test/src/main/resources/config/idaCertDataDeleteQueries.txt
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,8 +1,8 @@ | ||
##### DB queries to be executed to tear down the data used and generated during the test rig run | ||
|
||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=esignet_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=esignet_ekyc_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=esignet_device_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=esignet_ftm_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=signup_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=signup_ekyc_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=signup_device_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=signup_ftm_pid%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' | ||
delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' |
16 changes: 8 additions & 8 deletions
16
api-test/src/main/resources/config/keyManagerCertDataDeleteQueries.txt
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,14 +1,14 @@ | ||
##### DB queries to be executed to tear down the data used and generated during the test rig run | ||
|
||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=esignet_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=esignet_ekyc_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=esignet_device_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=esignet_ftm_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=signup_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=signup_ekyc_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=signup_device_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=signup_ftm_pid%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' | ||
delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=esignet_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=esignet_ekyc_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=esignet_device_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=esignet_ftm_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=signup_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=signup_ekyc_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=signup_device_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=signup_ftm_pid%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' | ||
delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' |
8 changes: 4 additions & 4 deletions
8
api-test/src/main/resources/config/masterDataCertDataDeleteQueries.txt
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,8 +1,8 @@ | ||
##### DB queries to be executed to tear down the data used and generated during the test rig run | ||
|
||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=esignet_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=esignet_ekyc_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=esignet_device_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=esignet_ftm_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=signup_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=signup_ekyc_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=signup_device_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=signup_ftm_pid%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' | ||
delete from master.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' |
3 changes: 3 additions & 0 deletions
3
...esources/signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusNegTC.hbs
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"idvSlotAllotted": "{{idvSlotAllotted}}" | ||
} |
96 changes: 96 additions & 0 deletions
96
...esources/signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusNegTC.yml
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
GetIdentityVerificationStatusNegTC: | ||
Signup_ESignet_GetIdentityVerificationStatus_AuthToken_Xsrf_STransId_uin_Empty_GetSlot_Id_Neg: | ||
endPoint: /v1/signup/identity-verification/status | ||
uniqueIdentifier: TC_Signup_ESignet_GetIdentityVerificationStatusNegTC_01 | ||
description: Get Identity Verification Status with an empty getSlotId | ||
role: resident | ||
restMethod: get | ||
inputTemplate: signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusNegTC | ||
outputTemplate: signup/error | ||
input: '{ | ||
"idvSlotAllotted": "" | ||
}' | ||
output: '{ | ||
"errors": [ | ||
{ | ||
"errorCode": "invalid_transaction", | ||
"errorMessage": "invalid_transaction" | ||
} | ||
] | ||
}' | ||
Signup_ESignet_GetIdentityVerificationStatus_AuthToken_Xsrf_STransId_uin_all_without_IDV_SLOT_ALLOTTED_in_the_cookie_Neg: | ||
endPoint: /v1/signup/identity-verification/status | ||
uniqueIdentifier: TC_Signup_ESignet_GetIdentityVerificationStatusNegTC_02 | ||
description: Get Identity Verification Status without an IDV slot assigned in the cookie | ||
role: resident | ||
restMethod: get | ||
inputTemplate: signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusNegTC | ||
outputTemplate: signup/error | ||
input: '{ | ||
"idvSlotAllotted": "$REMOVE$" | ||
}' | ||
output: '{ | ||
"errors": [ | ||
{ | ||
"errorCode": "invalid_transaction", | ||
"errorMessage": "invalid_transaction" | ||
} | ||
] | ||
}' | ||
Signup_ESignet_GetIdentityVerificationStatus_AuthToken_Xsrf_STransId_uin_all_with_invalid_IDV_SLOT_ALLOTTED_in_the_cookie_Neg: | ||
endPoint: /v1/signup/identity-verification/status | ||
uniqueIdentifier: TC_Signup_ESignet_GetIdentityVerificationStatusNegTC_03 | ||
description: Get Identity Verification Status with invalid an IDV slot assigned in the cookie | ||
role: resident | ||
restMethod: get | ||
inputTemplate: signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusNegTC | ||
outputTemplate: signup/error | ||
input: '{ | ||
"idvSlotAllotted": "1234567892" | ||
}' | ||
output: '{ | ||
"errors": [ | ||
{ | ||
"errorCode": "invalid_transaction", | ||
"errorMessage": "invalid_transaction" | ||
} | ||
] | ||
}' | ||
Signup_ESignet_GetIdentityVerificationStatus_AuthToken_Xsrf_STransId_uin_all_before_initiating_websocket_connection_Neg: | ||
endPoint: /v1/signup/identity-verification/status | ||
uniqueIdentifier: TC_Signup_ESignet_GetIdentityVerificationStatusNegTC_04 | ||
description: Get Identity Verification Status with invalid an IDV slot assigned in the cookie | ||
role: resident | ||
restMethod: get | ||
inputTemplate: signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusNegTC | ||
outputTemplate: signup/error | ||
input: '{ | ||
"idvSlotAllotted": "$ID:ESignet_InitiateIdVerification_STransId_AuthToken_Xsrf_NegTC_Valid_Smoke_Sid_Neg_idvTransactionID$" | ||
}' | ||
output: '{ | ||
"errors": [ | ||
{ | ||
"errorCode": "invalid_transaction", | ||
"errorMessage": "invalid_transaction" | ||
} | ||
] | ||
}' | ||
Signup_ESignet_GetIdentityVerificationStatus_AuthToken_Xsrf_STransId_uin_all_when_KYC_process_fails_in_websocket_Neg: | ||
endPoint: /v1/signup/identity-verification/status | ||
uniqueIdentifier: TC_Signup_ESignet_GetIdentityVerificationStatusNegTC_04 | ||
description: Get Identity Verification Status with invalid an IDV slot assigned in the cookie | ||
role: resident | ||
restMethod: get | ||
inputTemplate: signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusNegTC | ||
outputTemplate: signup/error | ||
input: '{ | ||
"idvSlotAllotted": "$ID:ESignet_InitiateIdVerification_STransId_AuthToken_Xsrf_NegTC_Valid_Smoke_Sid_Neg_idvTransactionID$" | ||
}' | ||
output: '{ | ||
"errors": [ | ||
{ | ||
"errorCode": "invalid_transaction", | ||
"errorMessage": "invalid_transaction" | ||
} | ||
] | ||
}' |
1 change: 1 addition & 0 deletions
1
...es/signup/GetIdentityVerificationStatusNegTC/GetIdentityVerificationStatusResultNegTC.hbs
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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
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
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
Oops, something went wrong.