RestAssuredAPIFramework development for TrusTrace Assignment - 2
RestAssured Framword helps in automating the API's POST call. It is developed using JAVA and several other components like Maven, TestNG, ExtentReports and JSON Libraries. The current setup can be scaled up to accomadate other methods like GET, PUT, DELETE and etc. For POST Method, Faker library is used to generate random values for input params.
The following tools are required to run the automation scripts in local machine.
- Eclipse IDE for Java Developers (includes Incubating components) - Version: 2022-03 (4.23.0)
- Install Eclipse m2e - Maven support in Eclipse IDE from Eclipse Marketplace
- Install TestNG for Eclipse plugin from Eclipse Marketplace
The following process will help in setting up the project.
- Import/Pull the project in Eclipse
- Edit the config.properties file present inside the folder - \src\test\resources\Configuration\config.properties (a) URI (b) PATHPARAM
- Once the project is setup in Eclipse, right click on the project and click "Run As" and Select "Maven Test"
- This will executre the classes configured in testng.xml
- In order to run specific set of tests, create new testng.xml and change the properties of maven-surefire-plugin from "<suiteXmlFile>testng.xml</suiteXmlFile>" to the new suite file name
- Extent Report is used to document all the test execution.
- Report will be automatically opened once the execution is completed.
- We can also find the reports under user.dir/extent-test-output/