Commit 2ca20994 authored by Rajat Ranjan Tripathy's avatar Rajat Ranjan Tripathy

My First Commit

parents
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/API_POC.iml" filepath="$PROJECT_DIR$/API_POC.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>API_Framework</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>cucumber.eclipse.builder.stepdefinition</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>cucumber.eclipse.builder.gherkin</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>cucumber.eclipse.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Request method: POST
Request URI: https://rahulshettyacademy.com/maps/api/place/add/json?key=qaclick123
Proxy: <none>
Request params: <none>
Query params: key=qaclick123
Form params: <none>
Path params: <none>
Headers: Accept=*/*
Content-Type=application/json
Cookies: <none>
Multiparts: <none>
Body:
{
"accuracy": 50,
"name": "Varshini",
"phone_number": "(+91) 983 893 3937",
"address": "abc cde center",
"website": "https://rahulshettyacademy.com",
"language": "English",
"location": {
"lat": -38.383494,
"lng": 33.427362
},
"types": [
"shoe park",
"shop"
]
}
HTTP/1.1 200 OK
Date: Fri, 04 Apr 2025 14:04:40 GMT
Server: Apache/2.4.52 (Ubuntu)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With
Content-Length: 194
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
{
"status": "OK",
"place_id": "6bf1a08866e555aefd9c7aa91022e863",
"scope": "APP",
"reference": "36e9d4958226052e967b78de802beac436e9d4958226052e967b78de802beac4",
"id": "36e9d4958226052e967b78de802beac4"
}
Request method: GET
Request URI: https://rahulshettyacademy.com/maps/api/place/get/json?key=qaclick123&place_id=6bf1a08866e555aefd9c7aa91022e863
Proxy: <none>
Request params: <none>
Query params: key=qaclick123
place_id=6bf1a08866e555aefd9c7aa91022e863
Form params: <none>
Path params: <none>
Headers: Accept=*/*
Content-Type=application/json
Cookies: <none>
Multiparts: <none>
Body: <none>
HTTP/1.1 200 OK
Date: Fri, 04 Apr 2025 14:04:41 GMT
Server: Apache/2.4.52 (Ubuntu)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With
Content-Length: 250
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
{
"location": {
"latitude": "-38.383494",
"longitude": "33.427362"
},
"accuracy": "50",
"name": "Varshini",
"phone_number": "(+91) 983 893 3937",
"address": "abc cde center",
"types": "shoe park,shop",
"website": "https://rahulshettyacademy.com",
"language": "English"
}
Request method: POST
Request URI: https://rahulshettyacademy.com/maps/api/place/add/json?key=qaclick123
Proxy: <none>
Request params: <none>
Query params: key=qaclick123
Form params: <none>
Path params: <none>
Headers: Accept=*/*
Content-Type=application/json
Cookies: <none>
Multiparts: <none>
Body:
{
"accuracy": 50,
"name": "Genelia",
"phone_number": "(+91) 983 893 3937",
"address": "hello hi center",
"website": "https://rahulshettyacademy.com",
"language": "Tamil",
"location": {
"lat": -38.383494,
"lng": 33.427362
},
"types": [
"shoe park",
"shop"
]
}
HTTP/1.1 200 OK
Date: Fri, 04 Apr 2025 14:04:43 GMT
Server: Apache/2.4.52 (Ubuntu)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With
Content-Length: 194
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
{
"status": "OK",
"place_id": "e04928a70d3c60de7793c28bfa5558b2",
"scope": "APP",
"reference": "ae1de5a42b444c4daffac2b2c0e90bd6ae1de5a42b444c4daffac2b2c0e90bd6",
"id": "ae1de5a42b444c4daffac2b2c0e90bd6"
}
Request method: GET
Request URI: https://rahulshettyacademy.com/maps/api/place/get/json?key=qaclick123&place_id=e04928a70d3c60de7793c28bfa5558b2
Proxy: <none>
Request params: <none>
Query params: key=qaclick123
place_id=e04928a70d3c60de7793c28bfa5558b2
Form params: <none>
Path params: <none>
Headers: Accept=*/*
Content-Type=application/json
Cookies: <none>
Multiparts: <none>
Body: <none>
HTTP/1.1 200 OK
Date: Fri, 04 Apr 2025 14:04:43 GMT
Server: Apache/2.4.52 (Ubuntu)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With
Content-Length: 248
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
{
"location": {
"latitude": "-38.383494",
"longitude": "33.427362"
},
"accuracy": "50",
"name": "Genelia",
"phone_number": "(+91) 983 893 3937",
"address": "hello hi center",
"types": "shoe park,shop",
"website": "https://rahulshettyacademy.com",
"language": "Tamil"
}
Request method: POST
Request URI: https://rahulshettyacademy.com/maps/api/place/delete/json?key=qaclick123
Proxy: <none>
Request params: <none>
Query params: key=qaclick123
Form params: <none>
Path params: <none>
Headers: Accept=*/*
Content-Type=application/json
Cookies: <none>
Multiparts: <none>
Body:
{
"place_id": "e04928a70d3c60de7793c28bfa5558b2"
}
HTTP/1.1 200 OK
Date: Fri, 04 Apr 2025 14:04:45 GMT
Server: Apache/2.4.52 (Ubuntu)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With
Content-Length: 15
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
{
"status": "OK"
}
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>bdd</groupId>
<artifactId>APIFramework</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- ✅ Rest Assured -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>5.4.0</version>
</dependency>
<!-- ✅ Cucumber Dependencies -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.17.0</version> <!-- Updated -->
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>7.17.0</version> <!-- Updated -->
<scope>test</scope>
</dependency>
<!-- ✅ Log4j Dependencies (Latest) -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.22.1</version> <!-- Latest stable -->
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.22.1</version> <!-- Latest stable -->
</dependency>
<!-- ✅ Jackson Databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.0</version>
</dependency>
<!-- ✅ Groovy (For Rest-Assured) -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.21</version>
</dependency>
<!-- ✅ Extent Reports -->
<dependency>
<groupId>tech.grasshopper</groupId>
<artifactId>extentreports-cucumber7-adapter</artifactId>
<version>1.14.0</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>5.1.2</version>
</dependency>
</dependencies>
</project>
package com.pojoclass;
import java.util.List;
public class AddPlace {
private int accuracy;
private String name;
private String phone_number;
private String address;
private String website;
private String language;
private Location location;
private List<String> types;
public int getAccuracy() {
return accuracy;
}
public void setAccuracy(int accuracy) {
this.accuracy = accuracy;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone_number() {
return phone_number;
}
public void setPhone_number(String phone_number) {
this.phone_number = phone_number;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getWebsite() {
return website;
}
public void setWebsite(String website) {
this.website = website;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
public List<String> getTypes() {
return types;
}
public void setTypes(List<String> types) {
this.types = types;
}
}
\ No newline at end of file
package com.pojoclass;
public class Location {
private double lat;
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
public double getLng() {
return lng;
}
public void setLng(double lng) {
this.lng = lng;
}
private double lng;
}
Feature: Validating Place API's
@AddPlace
Scenario Outline: Verify if Place is being Succesfully added using AddPlaceAPI
Given Add Place Payload with "<name>" "<language>" "<address>"
When user calls "AddPlaceAPI" with "POST" http request
Then the API call got success with status code 200
And "status" in response body is "OK"
And "scope" in response body is "APP"
And verify place_Id created maps to "<name>" using "getPlaceAPI"
Examples:
|name | language |address |
|Varshini| English |abc cde center |
|Genelia | Tamil |hello hi center |
@DeletePlace
Scenario: Verify if Delete Place functionality is working
Given DeletePlace Payload
When user calls "deletePlaceAPI" with "POST" http request
Then the API call got success with status code 200
And "status" in response body is "OK"
\ No newline at end of file
package com.resource;
public enum APIResources {
AddPlaceAPI("/maps/api/place/add/json"), getPlaceAPI("/maps/api/place/get/json"),
deletePlaceAPI("/maps/api/place/delete/json");
private String resource;
APIResources(String resource) {
this.resource = resource;
}
public String getResource() {
return resource;
}
}
package com.resource;
public class Payload {
private String fname;
public String getFname() {
return fname;
}
public void setFname(String fname) {
this.fname = fname;
}
public String getLname() {
return lname;
}
public void setLname(String lname) {
this.lname = lname;
}
private String lname;
}
package com.resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
public class Practice {
public static void main(String[] args) {
HashMap<String, Integer> map = new HashMap<String, Integer>();
map.put("Apple", 3);
map.put("Banana", 2);
map.put("Cherry", 5);
// Access by key
System.out.println(map.get("Banana")); // Output: 2
// Check if key exists
System.out.println(map.containsKey("Apple")); // Output: true
// Remove a key-value pair
// Iterate over entries
for (Entry<String, Integer> entry : map.entrySet()) {
System.out.println(entry.getKey() + ": " + entry.getValue());
}
ArrayList<Integer> al = new ArrayList<>();
LinkedList<Integer> ll = new LinkedList<>();
HashSet<Integer> hs = new HashSet<>();
}
}
package com.resource;
import java.util.ArrayList;
import java.util.List;
import com.pojoclass.AddPlace;
import com.pojoclass.Location;
public class TestBuilder {
public AddPlace addPlacePayLoad(String name, String language, String address) {
AddPlace p = new AddPlace();
p.setAccuracy(50);
p.setAddress(address);
p.setLanguage(language);
p.setPhone_number("(+91) 983 893 3937");
p.setWebsite("https://rahulshettyacademy.com");
p.setName(name);
List<String> myList = new ArrayList<String>();
myList.add("shoe park");
myList.add("shop");
p.setTypes(myList);
Location l = new Location();
l.setLat(-38.383494);
l.setLng(33.427362);
p.setLocation(l);
return p;
}
public String deletePlacePayload(String placeId) {
return "{\r\n \"place_id\":\"" + placeId + "\"\r\n}";
}
}
package com.resource;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Properties;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.filter.log.RequestLoggingFilter;
import io.restassured.filter.log.ResponseLoggingFilter;
import io.restassured.http.ContentType;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;
public class Utilis {
public static RequestSpecification req;
public RequestSpecification requestSpecification() throws IOException {
if (req == null) {
PrintStream log = new PrintStream(new FileOutputStream("logging.txt"));
req = new RequestSpecBuilder().setBaseUri(getGlobalValue("baseUrl")).addQueryParam("key", "qaclick123")
.addFilter(RequestLoggingFilter.logRequestTo(log))
.addFilter(ResponseLoggingFilter.logResponseTo(log)).setContentType(ContentType.JSON).build();
return req;
}
return req;
}
public static String getGlobalValue(String key) throws IOException {
Properties prop = new Properties();
FileInputStream fis = new FileInputStream(
"C:\\Users\\rrtripathy\\Downloads\\API_POC\\API_Framework\\src\\test\\resources\\global.properties");
prop.load(fis);
return prop.getProperty(key);
}
public String getJsonPath(Response response, String key) {
String resp = response.asString();
JsonPath js = new JsonPath(resp);
return js.get(key).toString();
}
}
package com.runner;
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(features = "C:\\Users\\rrtripathy\\Downloads\\API_POC\\API_Framework\\src\\test\\java\\com\\feature\\placeValidations.feature", glue = {
"com.stepDef" }, plugin = { "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" })
public class TestRunner {
}
package com.stepDef;
import java.io.IOException;
import io.cucumber.java.Before;
public class Hooks {
@Before("@DeletePlace")
public void beforeScenario() throws IOException {
StepDef sd = new StepDef();
if (StepDef.place_id == null) {
sd.add_Place_Payload_with("frankysv", "Latin", "Europe");
sd.user_calls_with_http_request("addPlaceAPI", "POST");
sd.verify_place_Id_created_maps_to_using("frankysv", "getPlaceAPI");
}
}
}
package com.stepDef;
import static io.restassured.RestAssured.given;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import com.resource.APIResources;
import com.resource.TestBuilder;
import com.resource.Utilis;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.http.ContentType;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
public class StepDef extends Utilis {
RequestSpecification res;
ResponseSpecification resspec;
Response response;
TestBuilder data = new TestBuilder();
static String place_id;
@Given("Add Place Payload with {string} {string} {string}")
public void add_Place_Payload_with(String name, String language, String address) throws IOException {
// Write code here that turns the phrase above into concrete actions
res = given().spec(requestSpecification()).body(data.addPlacePayLoad(name, language, address));
}
@When("user calls {string} with {string} http request")
public void user_calls_with_http_request(String resource, String method) {
// Write code here that turns the phrase above into concrete actions
//constructor will be called with value of resource which you pass
APIResources resourceAPI = APIResources.valueOf(resource);
System.out.println(resourceAPI.getResource());
resspec = new ResponseSpecBuilder().expectStatusCode(200).expectContentType(ContentType.JSON).build();
if (method.equalsIgnoreCase("POST"))
response = res.when().post(resourceAPI.getResource());
else if (method.equalsIgnoreCase("GET"))
response = res.when().get(resourceAPI.getResource());
}
@Then("the API call got success with status code {int}")
public void the_API_call_got_success_with_status_code(Integer int1) {
// Write code here that turns the phrase above into concrete actions
assertEquals(response.getStatusCode(), 200);
}
@Then("{string} in response body is {string}")
public void in_response_body_is(String keyValue, String Expectedvalue) {
// Write code here that turns the phrase above into concrete actions
assertEquals(getJsonPath(response, keyValue), Expectedvalue);
}
@Then("verify place_Id created maps to {string} using {string}")
public void verify_place_Id_created_maps_to_using(String expectedName, String resource) throws IOException {
// requestSpec
place_id = getJsonPath(response, "place_id");
res = given().spec(requestSpecification()).queryParam("place_id", place_id);
user_calls_with_http_request(resource, "GET");
String actualName = getJsonPath(response, "name");
assertEquals(actualName, expectedName);
}
@Given("DeletePlace Payload")
public void deleteplace_Payload() throws IOException {
// Write code here that turns the phrase above into concrete actions
res = given().spec(requestSpecification()).body(data.deletePlacePayload(place_id));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme -->
<!-- standard, dark -->
<theme>dark</theme>
<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>
<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>http</protocol>
<!-- title of the document -->
<documentTitle>API Report HTML</documentTitle>
<!-- report name - displayed at top-nav -->
<reportName>API Automation Suite Report</reportName>
<!-- location of charts in the test view -->
<!-- top, bottom -->
<testViewChartLocation>bottom</testViewChartLocation>
<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>
<!-- custom styles -->
<styles>
<![CDATA[
]]>
</styles>
</configuration>
</extentreports>
\ No newline at end of file
extent.reporter.spark.start=true
extent.reporter.json.start=true
extent.reporter.pdf.start=true
extent.reporter.html.start=true
extent.reporter.excel.start=true
extent.reporter.spark.out=test-output/Spark/ExtentSpark.html
extent.reporter.json.out=test-output/Json/ExtentJson.json
extent.reporter.pdf.out=test-output/Pdf/ExtentPdf.pdf
extent.reporter.html.out=test-output/Html/ExtentHtml.html
extent.reporter.excel.out=test-output/Excel/ExtentExcel.xlsx
#test,dashboard,category,exception,author,device,log
extent.reporter.spark.vieworder=dashboard,test,category,exception,author,device,log
systeminfo.os=windows
systeminfo.version=10
\ No newline at end of file
baseUrl=https://rahulshettyacademy.com
passColor: 05a167
failColor: ff00ff
skipColor: a89132
displayFeature: true
displayScenario: true
displayDetailed: true
displayAttached: true
displayExpanded: false
dashboardConfig:
title: Grasshopper PDF Report
dataBackgroundColor: 4F0CC8
titleColor: FF0000
dateColor: 969696
timeColor: 000000
dial:
featureRanges: 60 95
scenarioRanges: 70 90
stepRanges: 75 85
badColor: f768a1
averageColor: 93ffff
goodColor: 32ecab
summaryConfig:
totalColor: FF0000
durationColor: FF0000
tagConfig:
totalColor: FF0000
featureConfig:
totalColor: FF0000
durationColor: FF0000
scenarioConfig:
totalColor: FF0000
durationColor: FF0000
detailedFeatureConfig:
featureNameColor: FF0000
startEndTimeColor: 000000
tagColor: 404040
dataHeaderColor: FFFFFF
dataBackgroundColor: 404040
totalColor: 0000FF
durationColor: FFFFFF
durationBackgroundColor: 404040
detailedScenarioConfig:
featureNameColor: 404040
scenarioNameColor: FF0000
startEndTimeColor: 000000
tagColor: 404040
dataHeaderColor: FFFFFF
dataBackgroundColor: 404040
totalColor: 0000FF
durationColor: FFFFFF
durationBackgroundColor: 404040
stepChartBarColor: 7f32a8
detailedStepHookConfig:
stepTextColor: 0000FF
stepBackgroundColor: FFFFFF
hookTextColor: 00FF00
hookBackgroundColor: FFFFFF
durationColor: FF0000
errorMsgColor: 000000
logMsgColor: 000000
#skipHooks: true
#skipScenarioHooks: false
#skipStepHooks: false
#skipScenarioBeforeHooks: false
#skipScenarioAfterHooks: false
#skipStepBeforeHooks: false
#skipStepAfterHooks: false
\ No newline at end of file
Manifest-Version: 1.0
Build-Jdk-Spec: 21
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Wed Apr 30 11:19:41 IST 2025
artifactId=APIFramework
groupId=bdd
m2e.projectLocation=C\:\\Users\\rrtripathy\\Downloads\\API_POC\\API_Framework
m2e.projectName=APIFramework
version=0.0.1-SNAPSHOT
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>bdd</groupId>
<artifactId>APIFramework</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- ✅ Rest Assured -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>5.4.0</version>
</dependency>
<!-- ✅ Cucumber Dependencies -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.17.0</version> <!-- Updated -->
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>7.17.0</version> <!-- Updated -->
<scope>test</scope>
</dependency>
<!-- ✅ Log4j Dependencies (Latest) -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.22.1</version> <!-- Latest stable -->
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.22.1</version> <!-- Latest stable -->
</dependency>
<!-- ✅ Jackson Databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.0</version>
</dependency>
<!-- ✅ Groovy (For Rest-Assured) -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.21</version>
</dependency>
<!-- ✅ Extent Reports -->
<dependency>
<groupId>tech.grasshopper</groupId>
<artifactId>extentreports-cucumber7-adapter</artifactId>
<version>1.14.0</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>5.1.2</version>
</dependency>
</dependencies>
</project>
Feature: Validating Place API's
@AddPlace
Scenario Outline: Verify if Place is being Succesfully added using AddPlaceAPI
Given Add Place Payload with "<name>" "<language>" "<address>"
When user calls "AddPlaceAPI" with "POST" http request
Then the API call got success with status code 200
And "status" in response body is "OK"
And "scope" in response body is "APP"
And verify place_Id created maps to "<name>" using "getPlaceAPI"
Examples:
|name | language |address |
|Varshini| English |abc cde center |
|Genelia | Tamil |hello hi center |
@DeletePlace
Scenario: Verify if Delete Place functionality is working
Given DeletePlace Payload
When user calls "deletePlaceAPI" with "POST" http request
Then the API call got success with status code 200
And "status" in response body is "OK"
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme -->
<!-- standard, dark -->
<theme>dark</theme>
<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>
<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>http</protocol>
<!-- title of the document -->
<documentTitle>API Report HTML</documentTitle>
<!-- report name - displayed at top-nav -->
<reportName>API Automation Suite Report</reportName>
<!-- location of charts in the test view -->
<!-- top, bottom -->
<testViewChartLocation>bottom</testViewChartLocation>
<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>
<!-- custom styles -->
<styles>
<![CDATA[
]]>
</styles>
</configuration>
</extentreports>
\ No newline at end of file
extent.reporter.spark.start=true
extent.reporter.json.start=true
extent.reporter.pdf.start=true
extent.reporter.html.start=true
extent.reporter.excel.start=true
extent.reporter.spark.out=test-output/Spark/ExtentSpark.html
extent.reporter.json.out=test-output/Json/ExtentJson.json
extent.reporter.pdf.out=test-output/Pdf/ExtentPdf.pdf
extent.reporter.html.out=test-output/Html/ExtentHtml.html
extent.reporter.excel.out=test-output/Excel/ExtentExcel.xlsx
#test,dashboard,category,exception,author,device,log
extent.reporter.spark.vieworder=dashboard,test,category,exception,author,device,log
systeminfo.os=windows
systeminfo.version=10
\ No newline at end of file
baseUrl=https://rahulshettyacademy.com
passColor: 05a167
failColor: ff00ff
skipColor: a89132
displayFeature: true
displayScenario: true
displayDetailed: true
displayAttached: true
displayExpanded: false
dashboardConfig:
title: Grasshopper PDF Report
dataBackgroundColor: 4F0CC8
titleColor: FF0000
dateColor: 969696
timeColor: 000000
dial:
featureRanges: 60 95
scenarioRanges: 70 90
stepRanges: 75 85
badColor: f768a1
averageColor: 93ffff
goodColor: 32ecab
summaryConfig:
totalColor: FF0000
durationColor: FF0000
tagConfig:
totalColor: FF0000
featureConfig:
totalColor: FF0000
durationColor: FF0000
scenarioConfig:
totalColor: FF0000
durationColor: FF0000
detailedFeatureConfig:
featureNameColor: FF0000
startEndTimeColor: 000000
tagColor: 404040
dataHeaderColor: FFFFFF
dataBackgroundColor: 404040
totalColor: 0000FF
durationColor: FFFFFF
durationBackgroundColor: 404040
detailedScenarioConfig:
featureNameColor: 404040
scenarioNameColor: FF0000
startEndTimeColor: 000000
tagColor: 404040
dataHeaderColor: FFFFFF
dataBackgroundColor: 404040
totalColor: 0000FF
durationColor: FFFFFF
durationBackgroundColor: 404040
stepChartBarColor: 7f32a8
detailedStepHookConfig:
stepTextColor: 0000FF
stepBackgroundColor: FFFFFF
hookTextColor: 00FF00
hookBackgroundColor: FFFFFF
durationColor: FF0000
errorMsgColor: 000000
logMsgColor: 000000
#skipHooks: true
#skipScenarioHooks: false
#skipStepHooks: false
#skipScenarioBeforeHooks: false
#skipScenarioAfterHooks: false
#skipStepBeforeHooks: false
#skipStepAfterHooks: false
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment