This framework uses Rest-Assured Library With TestNG for API Testing
- JsonPath for JSON Parsing
- JsonSchemaMatchers for JSON Schema validations
- It has TestNG DataProviders in
"TestUtils.class"
used for test cases #2 and #3 - For logging Log4J is used
- All tests are stored in
"ApiTestSuite" class
, under package"com.hellofresh.api.tests"
under Undersrc/test/java
"com.hellofresh.api.globalutils"
package which contains test helper methods- All utility classes are stored in
"com.hellofresh.api.utilities"
under Undersrc/main/java
"config.properties"
contains all the configuration settings- Schemas against which response validation are done under
"schemas"
folder insrc/test/resources
package
Task Mapping:
- Task#1 : ApiTestSuite test method T01_GET_AllCountriesTest
- Task#2 : ApiTestSuite test method T02_GET_IndividualCountryTestforCountryCodes
- Task#3 : ApiTestSuite test method T03_GET_InexistentCountryTest
- Task#4 : ApiTestSuite test method T04_POST_AddNewCountryTest
Method#1
- Goto
src/test/java
>com.hellofresh.api.tests"
- Right click on
"ApiTestSuite.java"
>Run As
>TestNG Test
Method#2
-
Open "Command Prompt"
-
Goto Project directory
-
type following command :
> mvn install > mvn test or mvn -DApiTestSuite test
Logs are stored under respective date folder under "logs" directory (Created after initial run)
Successful Run via UI:
Via Command line