Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-37793 - Updated the Readme file #1127

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions api-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,30 @@

The **Masterdata API Test Rig** is designed for the execution of module-wise automation API tests for the admin services. This test rig utilizes **Java REST Assured** and **TestNG** frameworks to automate testing of the masterdata(admin-services) API functionalities. The key focus is to validate the device creation, registration center creation, zone creation, machine creation and related functionalities provided by the admin 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 admin services module.

---

## Pre-requisites

Before running the automation tests, ensure the following software is installed on the machine:

- **Java 21** (or a compatible version)
- **Maven 3.9.6** (or higher)
- **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

Expand All @@ -32,6 +40,8 @@ Before running the automation tests, ensure the following software is installed
- 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:
Expand All @@ -51,6 +61,8 @@ You can access the test automation code using either of the following methods:
git clone https://github.com/mosip/admin-services
```

---

## Build Test Automation Code

Once the repository is cloned or downloaded, follow these steps to build and install the test automation code:
Expand All @@ -67,6 +79,8 @@ Once the repository is cloned or downloaded, follow these steps to build and ins

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:
Expand Down Expand Up @@ -114,7 +128,7 @@ To execute the tests using Eclipse IDE, use the following steps:
- 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.esignet.testrunner.MosipTestRunner`.
- 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.masterdata.testrunner.MosipTestRunner`.
- In the **Arguments** tab, add the necessary **VM arguments**:
- **VM Arguments**:
```
Expand All @@ -131,22 +145,24 @@ To execute the tests using Eclipse IDE, use the following steps:

- After the tests are executed, you can view the detailed results in the `api-test\testng-report` directory.

---


### Details of Arguments Used
## 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-masterdata-1.3.0-SNAPSHOT-jar-with-dependencies.jar`.

## Build and Run
### 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 admin services API functionalities.

---

## License

This project is licensed under the terms of the [Mozilla Public License 2.0]
This project is licensed under the terms of the [Mozilla Public License 2.0](https://github.com/mosip/mosip-platform/blob/master/LICENSE)