This test automation solution is a POC to implement the BDD automated testing of the JSON Web APIs.
- Java 8
- Cucumber v6.8.1 for writing the BDD features.
- Spring java development framework.
- H2 Database for in-memory embedded database.
- Rest Assured v4.3.3 for testing and validating REST services in java.
- Apache Log4j v1.2.17 for creating logs
- Gradle as build tool.
- IntelliJ IDEA - Community edition used as IDE to develop this solution.
- To open the project in IntelliJ, browse to 'build.gradle' file (located at '...\DronePoc' and choose option ‘Open as Project’). Make sure that project is opened as gradle project in IntelliJ.
- In IntelliJ, go to File -> Project Structure....Under Project Settings -> Project, make sure that 'Project SDK:' selected for Java version is 1.8 or higher and 'Project language level' is 8 or higher.
- In IntelliJ Project Explorer, verify that under 'External Libraries', JDK and libraries for Cucumber, Spring, H2 Database, Rest Assured and Log4j are loaded via Gradle (live internet connection required to resolve these dependencies, else, if there is a local libraries' server in the organisation, go to File - > Settings...Build, Execution, Deployment -> Gradle - > Use Gradle from and choose ' Specified location').
- User should have 'write' permissions to the location where '...\DronePoc' directory is located. This is required only for creating and writing report and log files at the locations '...\DronePoc\reports' and '...\DronePoc\logs' respectively.
- Ensure that 'Cucumber for Java' and 'Gherkin' plugins are installed in IntelliJ (from File -> Settings... -> Plugins) .
From IntelliJ :
- Click the 'Run' icon for 'DronePocApplication' class (at ' ....\DronePoc\src\main\java\com.drone.poc.DronePocApplication).
From IntelliJ :
- To run all the tests, click the 'Run Test' icon for 'TestRunner' class (at ' ....\DronePoc\src\test\java\com.drone.poc.runner.TestRunner).
- To run a particular feature or scenario, click the 'Run Test' icon at feature level or scenario level (feature files located at '....\DronePoc\src\test\resources\features).
API server must me running before running any tests.
- Execution report: Execution report file 'cucumber-tests.html' will be generated and located at ' ....\DronePoc\reports'.
- Execution logs: Log file 'cucumber-tests.log' will be generated and located at '....\DronePoc\logs'.