Welcome to Confiance API Automation Framework. This is very simple yet powerful automation framework for RESTful WebServices automation based on JAVA.
- Rest-Assured
- Maven
- TestNG
- Jackson for POJO class mapping
- org.json for response parsing
- Jxl to extract test data from Excel files
- Extent Reports
- This project is already uploaded to Maven central repo. So, just add the below dependency to your POM.xml.
<dependency> <groupId>com.github.nainappa</groupId> <artifactId>confiance-api</artifactId> <version>1.0.2</version> </dependency>
- Perform
mvn clean install
- You can start writing your test cases now.
- The sample Tests in the repo will help you to get start. All Sample tests run against http://restapi.demoqa.com/customer/register.
-
Containerized implementation for response body, headers and cookies etc. Response object provided by the each type of method will have all these embedded with it. You can access any data that you need from this object. This helps users not to duplicate their code for any data.
-
You can also get direct pojo as response. You just need to pass the corresponding response pojo class as parameter to the method.
-
Generates excellent execution reports using Extent Reports.
-
Utilizes the capabilities of TestNG such as Data provider annotation to separate test data in external file and flexible test suites configuration and management.
-
This also has utilities such as Reading data from excel sheets, Date utilities, Random data generators which are most frequently used utils in API automation.
This framework generates default TestNG Html reports as we use TestNG framework. It also generates very attractive and comprehensive Extent Reports. To get Extent Report, add the below listener to your testng.xml
<listeners>
<listener class-name="com.confiance.framework.api.report.ExtentReportListener"/>
</listeners>
Along with the listener,there are also few parameters which you have to send from your TestNG.xml file for reports.
-
archive.confiance.report
If you want to archive the reports send value 'true' (Your reports would be generated underC:\Users\#urusrname#\Confiance_Execution_Reports\yyyy\mm\ddMMMyy_hhmmss_TestExecution\ConfianceExecutionReport.html
). Otherwise you can ignore this parameter. -
confiance.report.host
You can add the host information on which you are running your tests. This information would be shown in Dashboard view of Extent Report. You can ignore it, if you don't want. -
confiance.report.env
You can add the Environment information on which you are running your tests. This information would be shown in Dashboard view of Extent Report. You can ignore it, if you don't want. -
confiance.report.reportheader
If you want to customize the Report header, you can use this parameter in your TestNg.xml file. You can also choose not to add any name. By default, it shows "Confiance Execution Report" as the header.
For adding log in your test method, use the object ExtentReportUtil.logger
. This has several options like info, debug, error etc. Please refer the test case example in the repo.
If you want to report any issues or enhancements, please do so in the issue tracker. I'd love to hear what you think, so please take a moment to let me know.
- Supporting SOAP APIs testing
- supporting various DBs such as SQL, Mongo etc
- Supporting Behavior-driven development (BDD) test cases