1. Cucumber API Automation Framework
As the name describes, this framework concentrates on automating API. This
framework contains all the configurations and execution related features so testers
can only focus on writing test scripts as per the scenarios described.
Pre-Requisites –
1. Java (JDKv1.8)
2. Maven
3. NodeJS
Key Components of the framework
These are the below components used to configure and execution the test scripts
using this framework –
1. Framework Jar
2. Configuration Properties
3. Test Scripts Creation
4. Test Scripts Runner
5. Reporter
Framework Jar –
Follow the installation document for installing the framework library
(cucumberapiautomation-1.0.jar).
1. Download the jar and install script from the location -
https://drive.google.com/open?id=1hYzTv4Q_Dr7bDr68x07FbxpJKykbq5Gb
2. Run the script (.sh or bat) as per the OS.
Configuration Properties –
These are few important property keys, which can used to execute scripts to
generate the desired results –
a. BASE_URI
Set the base URl. Ex – (http://localhost:5000). User can also pass the URI
from terminal/jenkins
Test Script Creation
Follow the below process to use the sample project –
1. Download the automation project and extract it.
2. 2. Use the same extracted project or you can create your own maven-based
project.
3. Launch Eclipse (Please find the eclipse configuration document for more
detail to install eclipse and their plugin)
4. Click on File->Import
5. Select the option “Existing Maven Projects” and click on Next button
3. 6. Select the project root directory and click on Finish button
5. 8. Feature file can be found under the “src/test/resources”
Test Case Execution
For execution, follow the below steps –
1. Open the “config.properties” file and set the desired browser name. Ex – Set
“BASE_URI = http://localhost:5000”
2. Now open the terminal and navigate to project root directory.
3. Execute the command –
baseURI=http://localhost:5000mvn clean "-Dbase_url=http://localhost:5000"
verify
baseURI – API Base URL
Dbase – This URL will appear on report
4. Test
Report Details –
Once the execution completes, report will be available under the directory - <Project
Root>/target/Report. The report name is “index.html”.