This automation framework is using Selenium Webdriver tool with Cucumber and also API testing using RestAssured library. To run the tests on your windows machine do the following.
git clone https://github.com/survepravin/petstore-qa-api-test.git
cd petstore-qa-api-test
mvn install -DskipTests
mvn test
git clone https://github.com/survepravin/petstore-qa-api-test.git
- Import project in IDE as a maven project
- Right click on pom.xml -> Run As -> Maven install
or
Navigate to
\src\test\java\runner
and Run As TestRunner.java as JUnit
Note: You can individually run each feature by navigating to \src\test\java\features and Run As Cucumber feature. Reports won't be created via this approach.
Report will be generated in \target\cucumber-html-report.html
Report is also published on cucumber cloud, once execution is completed. Unique URL will be generated, open that url in browser.
Example:
? View your Cucumber Report at: ?
? https://reports.cucumber.io/reports/2957216a-6940-4392-9acc-e16fa7598746 ?
? ?
? This report will self-destruct in 24h. ?
? Keep reports forever: https://reports.cucumber.io/profile ?
Framework is built with an intention to test RestAPIs with RestAssured library and Cucumber BDD. Cucumber is an open-source testing framework that supports Behavior Driven Development for automation testing of web applications. The tests are first written in a simple scenario form that describes the expected behavior of the system from the user’s perspective.REST Assured is a Java library that provides a domain-specific language (DSL) for writing powerful, maintainable tests for RESTful APIs
Web and Api configurations are stored in this file as key value pair. EnvironmentVariables.java class will access all the values.
Utility classes that can be used across the project. EnvironmentVariables.java global variables are set here.
This includes Runner class. Run As JUnit to execute tests based on tags.You can configure cucumber options like report name, features, stepDefinitions, etc.
Feature files as per functionality, includes '.feature' files.
Cucumber Steps are implemented in this package.