Agile Testing Days 2018 - API Fundamentals - postman collection

JoEllen Carter
JoEllen CarterLead Software QA Engineer at Olo um Olo

Postman collection used in the API Fundamentals workshop. Saved as txt but can be renamed and imported into Postman as json.

{
"info": {
"_postman_id": "b34b7a28-42d6-44e2-9571-9ae4e6038b62",
"name": "ATD 2018 USA",
"schema":
"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "1 - Getting our feet wet",
"description": "",
"item": [
{
"name": "Get weather from the Dark Sky API",
"event": [
{
"listen": "test",
"script": {
"id": "0426bcd9-ce79-4df2-9657-
bebf60804b8a",
"type": "text/javascript",
"exec": [
"pm.test("Request with
valid lat and long returns a 200 status code", function () {",
"
pm.response.to.have.status(200);",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/219a4cc6ef64023fdcee03a7335372b9/{{latitude}},
{{longitude}}",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"219a4cc6ef64023fdcee03a7335372b9
",
"{{latitude}},{{longitude}}"
]
}
},
"response": []
}
]
},
{
"name": "2 - Fundamental - Exploratory Tests",
"description": "**5 minutes**rnrnExploratory testing
approachrn- Identify the variable parts (we'll write these on a flip
chart).rn- Apply Heuristics to the variables (not all of these may be
applicable to our example)rn-- Zero, One, Manyrn-- Some, None, Allrn--
Beginning, Middle, Endrn-- Too Many, Too Fewrn-- Relative Position, i.e.
content",
"item": [
{
"name": "Exploratory Testing the Weather API -
Equator at Prime Meridian",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/0,0",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"0,0"
]
}
},
"response": []
},
{
"name": "Exploratory Testing the Weather API -
100,100",
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/100,100",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"100,100"
]
}
},
"response": []
},
{
"name": "Exploratory Testing the Weather API -
South Pole",
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/-90,0",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"-90,0"
]
}
},
"response": []
},
{
"name": "Exploratory Testing the Weather API -
North Pole",
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/90,0",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"90,0"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "2d66424f-1d29-46b6-ade6-
76227492b395",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "b5233ac5-661b-4478-bb2b-
d4512cf6f8be",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "3 - Fundamental - Functional Tests (aka Component
tests)",
"description": "**10 minutes**rnrnIn this activity, we'll
add an assertion to our GET weather request.rnrnOpen a new tab.rnType or
paste your request from 1-GET weather activity.rnClick the 'Tests' tab (check
out Dan's screen).rnFirst we'll add a test for the status code (Dan will talk
us through this).rnThen we'll check our response to make sure we're getting
the weather forecast for our desired location.rn",
"item": [
{
"name": "Response codes",
"event": [
{
"listen": "test",
"script": {
"id": "7bcda5fd-d76e-4c2f-a3d9-
4df0473532ed",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}?
exclude=minutely,hourly,daily,flags",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"{{latitude}},{{longitude}}"
],
"query": [
{
"key": "exclude",
"value":
"minutely,hourly,daily,flags"
}
]
}
},
"response": []
},
{
"name": "Weather on New Years Day 2018",
"event": [
{
"listen": "prerequest",
"script": {
"id": "0a218173-9e24-4126-b91a-
4ff6d90434d4",
"type": "text/javascript",
"exec": [
"postman.setGlobalVariable(
"NewYearsDay", "2018-01-01T00:00:01");"
]
}
},
{
"listen": "test",
"script": {
"id": "2ca5abb6-f8f5-47c0-8168-
ab35a37c1dc3",
"type": "text/javascript",
"exec": [
"pm.test("Forecast matches
recorded weather", function() {",
" var jsonData =
pm.response.json();",
"
pm.expect(jsonData.currently.summary).to.eql("Clear");",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}},
{{NewYearsDay}}",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"{{latitude}},{{longitude}},
{{NewYearsDay}}"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "a934cf78-10c3-4efa-845b-
677969f53e76",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "0b950846-9920-4059-a605-
4796f79dcc30",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "4 - Fundamental - Contract Tests",
"description": "**10 minutes**rnrnContract tests verify
that what you send back in your response matches what you told users would come
back in your response.rnrnOne way of doing this in Postman is throught a
schema validation.rnrnA schema defines the data structure of the response,
and the rules around the structure. Rules meaning like what is required, what
values can be null, what the max or min length of a string can be, and so
on.rnrnWe have rules around specifying this data structure, or schema, in
json, so that we can all understand what is expected.rnrnPostman has a
built-in schema validator that we can use - we just need to specify the schema
that we want our response validated against.rnrnjsonschema.net is a sweet
tool for doing this.",
"item": [
{
"name": "Response json schema should match
expected schema",
"event": [
{
"listen": "test",
"script": {
"id": "6b9b095b-6026-4a1c-98e2-
59c7655c92fb",
"type": "text/javascript",
"exec": [
"var data =
JSON.parse(responseBody);",
"var schema = {",
" "$id": "http://exampl
e.com/example.json",",
" "type": "object",",
" "definitions": {},",
" "$schema": "http://js
on-schema.org/draft-07/schema#",",
" "additionalProperties"
: false,",
" "properties": {",
" "latitude": {",
" "$id": "/properti
es/latitude",",
" "type": "number"
",
" },",
" "longitude": {",
" "$id": "/properti
es/longitude",",
" "type": "number"
",
" },",
" "timezone": {",
" "$id": "/properti
es/timezone",",
" "type": "string"
",
" },",
" "offset": {",
" "$id": "/properti
es/offset",",
" "type": "integer
"",
" }",
" },",
" "required": [",
" "latitude",",
" "longitude",",
" "timezone",",
" "offset"",
" ]",
"}",
"",
"pm.test("Response matches
schema", function () {",
"
pm.expect(tv4.validate(data, schema),tv4.error).to.be.true;",
" console.log("Schema
Validation failed: ", tv4.error);",
"",
" });"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}?
exclude=currently,minutely,hourly,daily,flags,alerts",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"{{latitude}},{{longitude}}"
],
"query": [
{
"key": "exclude",
"value":
"currently,minutely,hourly,daily,flags,alerts"
}
]
}
},
"response": []
},
{
"name": "Response json schema should match
expected schema (change query to exclude flags)",
"event": [
{
"listen": "test",
"script": {
"id": "fbb33ba0-c1ae-4a35-9a62-
9749c7128f24",
"type": "text/javascript",
"exec": [
"var data =
JSON.parse(responseBody);",
"var schema = {",
" "$id": "http://exampl
e.com/example.json",",
" "type": "object",",
" "definitions": {},",
" "$schema": "http://js
on-schema.org/draft-07/schema#",",
" "additionalProperties"
: false,",
" "properties": {",
" "latitude": {",
" "$id": "/properti
es/latitude",",
" "type": "number"
",
" },",
" "longitude": {",
" "$id": "/properti
es/longitude",",
" "type": "number"
",
" },",
" "timezone": {",
" "$id": "/properti
es/timezone",",
" "type": "string"
",
" },",
" "offset": {",
" "$id": "/properti
es/offset",",
" "type": "integer
"",
" }",
" },",
" "required": [",
" "latitude",",
" "longitude",",
" "timezone",",
" "offset"",
" ]",
"}",
"",
"pm.test("Response matches
schema", function () {",
"
pm.expect(tv4.validate(data, schema),tv4.error).to.be.true;",
" console.log("Schema
Validation failed: ", tv4.error);",
"",
" });"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}?
exclude=currently,minutely,hourly,daily,alerts",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"{{latitude}},{{longitude}}"
],
"query": [
{
"key": "exclude",
"value":
"currently,minutely,hourly,daily,alerts"
}
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "ed0bb033-08b0-4331-9253-
10572e2a2590",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "f3e701e9-c74b-4964-a42b-
1d95cb54061b",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "5 - Fundamental - Performance, Load & Security
Tests",
"description": "**10 minutes**rnrnWe can easily extract a
value from our json response.rnLet's add more than an assertion to the post-
response javascript code.",
"item": [
{
"name": "Response time should be less than 200
ms",
"event": [
{
"listen": "test",
"script": {
"id": "5b51f9c8-5965-40a7-a352-
ad3ed370ea7c",
"type": "text/javascript",
"exec": [
"pm.test("Response time is
less than 200ms", function () {",
"
pm.expect(pm.response.responseTime).to.be.below(200);",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"{{latitude}},{{longitude}}"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "757cfab0-f421-40ff-9ce9-
aa195d4088d9",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "ccdfed8d-a3ee-4a39-ad3c-
f9f4d398d122",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "6 - Fundamental - "EndToEnd" Tests (aka Integration
Tests)",
"description": "",
"item": [
{
"name": "Get lat and long from darksky Geo",
"event": [
{
"listen": "test",
"script": {
"id": "828ec1a8-dac9-4ac7-b1a6-
5b61e7780d6e",
"type": "text/javascript",
"exec": [
"var jsonData =
pm.response.json();",
"pm.environment.set("latit
ude", jsonData.latitude);",
"pm.environment.set("longi
tude", jsonData.longitude);"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "https://darksky.net/geo?
q={{location}}",
"protocol": "https",
"host": [
"darksky",
"net"
],
"path": [
"geo"
],
"query": [
{
"key": "q",
"value": "{{location}}"
}
]
}
},
"response": []
},
{
"name": "GET forecast from darksky",
"event": [
{
"listen": "test",
"script": {
"id": "31bd0dd6-ffaa-47e0-a522-
47acd0d1d89f",
"type": "text/javascript",
"exec": [
"//extract time",
"var jsonData =
pm.response.json();",
"pm.environment.set("forec
ast_time", jsonData.hourly.data[0].time);",
"pm.environment.set("darks
ky_temp", jsonData.hourly.data[0].temperature);",
"pm.test("Request with
valid lat and long returns a 200 status code", function () {",
"
pm.response.to.have.status(200);",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}?
exclude=minutely,currently,daily,flags,alerts",
"protocol": "https",
"host": [
"api",
"darksky",
"net"
],
"path": [
"forecast",
"{{darkskyKey}}",
"{{latitude}},{{longitude}}"
],
"query": [
{
"key": "exclude",
"value":
"minutely,currently,daily,flags,alerts"
}
]
}
},
"response": []
},
{
"name": "GET forecast from aeris API",
"event": [
{
"listen": "test",
"script": {
"id": "cad93d58-6e4e-4f5f-b533-
d9dda125355d",
"type": "text/javascript",
"exec": [
"var jsonData =
pm.response.json();",
"",
"pm.test("Darksky latitude
for location matches aeris latitude", function () {",
"
pm.expect(jsonData.response[0].loc.lat.toPrecision(2)).to.eql(pm.environment.get
("latitude").toPrecision(2));",
"});",
"",
"pm.test("Darksky
longitude for location matches aeris longitude", function () {",
"
pm.expect(jsonData.response[0].loc.long.toPrecision(2)).to.eql(pm.environment.ge
t("longitude").toPrecision(2));",
"});",
"",
"// pm.test("Darksky temp
for current time matches aeris temp for same time", function () {",
"//
pm.expect(jsonData.response[0].periods[0].tempF).to.eql(Math.round(pm.environmen
t.get("darksky_temp")));",
"// });",
"console.log("Darksky
time, lat, long, temp = " + pm.environment.get("forecast_time") + "," +
pm.environment.get("latitude") + "," + pm.environment.get("longitude")
+ "," + Math.round(pm.environment.get("darksky_temp")));",
"console.log("Aeris time,
lat, long, temp = " + jsonData.response[0].periods[0].timestamp + "," +
jsonData.response[0].loc.lat + "," + jsonData.response[0].loc.long + "," +
jsonData.response[0].periods[0].tempF);",
""
]
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"body": {},
"url": {
"raw":
"https://api.aerisapi.com/forecasts/{{location}}?
from={{forecast_time}}&filter=1hr&client_id={{aerisID}}&client_secret={{aerisSec
ret}}",
"protocol": "https",
"host": [
"api",
"aerisapi",
"com"
],
"path": [
"forecasts",
"{{location}}"
],
"query": [
{
"key": "from",
"value":
"{{forecast_time}}"
},
{
"key": "filter",
"value": "1hr"
},
{
"key": "client_id",
"value": "{{aerisID}}"
},
{
"key": "client_secret",
"value": "{{aerisSecret}}"
}
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "10f38ba5-9d50-431e-b144-
1a2f376b0c9b",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "e82cf4bd-d7d5-45a0-bdd8-
206b4ecadb0b",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "7 - Running tests in Postman",
"description":
"location.jsonnn[{n "location": "Boston, MA"n },
{n "location": "Atlanta, GA"n }, {n "location": "Denver,
CO"n }, {n "location": "San Diego, CA"n}]",
"item": [],
"event": [
{
"listen": "prerequest",
"script": {
"id": "dd1fad99-2aba-4f5e-b57c-
b6ac6db91013",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "41f8913a-b3fe-4653-948d-
409fa08466d1",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "8 - Running tests in CI & Test Reporting",
"description": "",
"item": [],
"event": [
{
"listen": "prerequest",
"script": {
"id": "dd1fad99-2aba-4f5e-b57c-
b6ac6db91013",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "41f8913a-b3fe-4653-948d-
409fa08466d1",
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "e40f1f39-5b04-4d3e-82f6-f9044f4676f5",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "4128584d-7354-4ff3-976b-773ae868ade5",
"type": "text/javascript",
"exec": [
""
]
}
}
]
}

Recomendados

Anwendungsfaelle für Elasticsearch von
Anwendungsfaelle für ElasticsearchAnwendungsfaelle für Elasticsearch
Anwendungsfaelle für ElasticsearchFlorian Hopf
6.8K views64 Folien
Apache CouchDB talk at Ontario GNU Linux Fest von
Apache CouchDB talk at Ontario GNU Linux FestApache CouchDB talk at Ontario GNU Linux Fest
Apache CouchDB talk at Ontario GNU Linux FestMyles Braithwaite
821 views84 Folien
Philipp Krenn "Make Your Data FABulous" von
Philipp Krenn "Make Your Data FABulous"Philipp Krenn "Make Your Data FABulous"
Philipp Krenn "Make Your Data FABulous"Fwdays
203 views101 Folien
EWD 3 Training Course Part 25: Document Database Capabilities von
EWD 3 Training Course Part 25: Document Database CapabilitiesEWD 3 Training Course Part 25: Document Database Capabilities
EWD 3 Training Course Part 25: Document Database CapabilitiesRob Tweed
905 views49 Folien
elasticsearch - advanced features in practice von
elasticsearch - advanced features in practiceelasticsearch - advanced features in practice
elasticsearch - advanced features in practiceJano Suchal
13K views19 Folien
Specification-Driven Development of REST APIs by Alexander Zinchuk von
Specification-Driven Development of REST APIs by Alexander Zinchuk   Specification-Driven Development of REST APIs by Alexander Zinchuk
Specification-Driven Development of REST APIs by Alexander Zinchuk OdessaJS Conf
409 views61 Folien

Más contenido relacionado

Was ist angesagt?

WSO2Con USA 2015: Securing your APIs: Patterns and More von
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2
372 views22 Folien
Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018 von
Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018
Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018Codemotion
99 views101 Folien
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co... von
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...Codemotion
2.2K views103 Folien
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017 von
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017Codemotion
945 views148 Folien
Mongo db for C# Developers von
Mongo db for C# DevelopersMongo db for C# Developers
Mongo db for C# DevelopersSimon Elliston Ball
10.6K views46 Folien
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB von
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB
300 views124 Folien

Was ist angesagt?(20)

WSO2Con USA 2015: Securing your APIs: Patterns and More von WSO2
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2372 views
Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018 von Codemotion
Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018
Philipp Krenn | Make Your Data FABulous | Codemotion Madrid 2018
Codemotion99 views
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co... von Codemotion
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...
Codemotion2.2K views
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017 von Codemotion
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Codemotion945 views
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB von MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB300 views
APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande... von apidays
APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande...APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande...
APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande...
apidays319 views
Cross Domain Web
Mashups with JQuery and Google App Engine von Andy McKay
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
Andy McKay3.7K views
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira... von Lucidworks
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...
Lucidworks979 views
CouchDB on Android von Sven Haiges
CouchDB on AndroidCouchDB on Android
CouchDB on Android
Sven Haiges5.4K views
NoSQL & MongoDB von Shuai Liu
NoSQL & MongoDBNoSQL & MongoDB
NoSQL & MongoDB
Shuai Liu1.7K views
Terms of endearment - the ElasticSearch Query DSL explained von clintongormley
Terms of endearment - the ElasticSearch Query DSL explainedTerms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explained
clintongormley29.2K views
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015 von NoSQLmatters
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
NoSQLmatters1.2K views
MongoDB World 2016: Deciphering .explain() Output von MongoDB
MongoDB World 2016: Deciphering .explain() OutputMongoDB World 2016: Deciphering .explain() Output
MongoDB World 2016: Deciphering .explain() Output
MongoDB2.3K views
HashiCorp Vault configuration as code via HashiCorp Terraform- stories from t... von Andrey Devyatkin
HashiCorp Vault configuration as code via HashiCorp Terraform- stories from t...HashiCorp Vault configuration as code via HashiCorp Terraform- stories from t...
HashiCorp Vault configuration as code via HashiCorp Terraform- stories from t...
Andrey Devyatkin781 views
Elasticsearch und die Java-Welt von Florian Hopf
Elasticsearch und die Java-WeltElasticsearch und die Java-Welt
Elasticsearch und die Java-Welt
Florian Hopf2.1K views

Similar a Agile Testing Days 2018 - API Fundamentals - postman collection

Peggy elasticsearch應用 von
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用LearningTech
304 views29 Folien
SDKs, the good the bad the ugly - Japan von
SDKs, the good the bad the ugly - JapanSDKs, the good the bad the ugly - Japan
SDKs, the good the bad the ugly - Japantristansokol
275 views44 Folien
Os Pruett von
Os PruettOs Pruett
Os Pruettoscon2007
1.1K views46 Folien
Coding Ajax von
Coding AjaxCoding Ajax
Coding AjaxTed Husted
610 views84 Folien
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al... von
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...apidays
314 views61 Folien
AST - the only true tool for building JavaScript von
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptIngvar Stepanyan
13.7K views40 Folien

Similar a Agile Testing Days 2018 - API Fundamentals - postman collection(20)

Peggy elasticsearch應用 von LearningTech
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
LearningTech304 views
SDKs, the good the bad the ugly - Japan von tristansokol
SDKs, the good the bad the ugly - JapanSDKs, the good the bad the ugly - Japan
SDKs, the good the bad the ugly - Japan
tristansokol275 views
Os Pruett von oscon2007
Os PruettOs Pruett
Os Pruett
oscon20071.1K views
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al... von apidays
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...
apidays314 views
AST - the only true tool for building JavaScript von Ingvar Stepanyan
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScript
Ingvar Stepanyan13.7K views
node.js and the AR.Drone: building a real-time dashboard using socket.io von Steven Beeckman
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.io
Steven Beeckman15.9K views
Elasticsearch in 15 Minutes von Karel Minarik
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 Minutes
Karel Minarik6.6K views
JSON Schema in Web Frontend #insideFE von Hiroyuki Anai
JSON Schema in Web Frontend #insideFEJSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFE
Hiroyuki Anai5.2K views
ELK Stack - Turn boring logfiles into sexy dashboard von Georg Sorst
ELK Stack - Turn boring logfiles into sexy dashboardELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboard
Georg Sorst5.4K views
WordPressでIoTをはじめよう von Yuriko IKEDA
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめよう
Yuriko IKEDA703 views
Closing the Loop in Extended Reality with Kafka Streams and Machine Learning ... von confluent
Closing the Loop in Extended Reality with Kafka Streams and Machine Learning ...Closing the Loop in Extended Reality with Kafka Streams and Machine Learning ...
Closing the Loop in Extended Reality with Kafka Streams and Machine Learning ...
confluent497 views
Vert.x using Groovy - Simplifying non-blocking code von sascha_klein
Vert.x using Groovy - Simplifying non-blocking codeVert.x using Groovy - Simplifying non-blocking code
Vert.x using Groovy - Simplifying non-blocking code
sascha_klein3.4K views

Más de JoEllen Carter

Agile Testing Days 2018 USA - API Testing Fundamentals von
Agile Testing Days 2018 USA - API Testing FundamentalsAgile Testing Days 2018 USA - API Testing Fundamentals
Agile Testing Days 2018 USA - API Testing FundamentalsJoEllen Carter
347 views19 Folien
Api FUNdamentals #MHA2017 von
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017JoEllen Carter
422 views39 Folien
Mapping Mashup Story Mapping Exercise 3 uncolored cards von
Mapping Mashup Story Mapping Exercise 3 uncolored cardsMapping Mashup Story Mapping Exercise 3 uncolored cards
Mapping Mashup Story Mapping Exercise 3 uncolored cardsJoEllen Carter
144 views4 Folien
Mapping Mashup Exercise solutions von
Mapping Mashup Exercise solutionsMapping Mashup Exercise solutions
Mapping Mashup Exercise solutionsJoEllen Carter
257 views15 Folien
Mapping Mashup Exercise handouts von
Mapping Mashup Exercise handoutsMapping Mashup Exercise handouts
Mapping Mashup Exercise handoutsJoEllen Carter
144 views8 Folien
Atd 2016-mapping-mashup von
Atd 2016-mapping-mashupAtd 2016-mapping-mashup
Atd 2016-mapping-mashupJoEllen Carter
1.3K views23 Folien

Más de JoEllen Carter(7)

Agile Testing Days 2018 USA - API Testing Fundamentals von JoEllen Carter
Agile Testing Days 2018 USA - API Testing FundamentalsAgile Testing Days 2018 USA - API Testing Fundamentals
Agile Testing Days 2018 USA - API Testing Fundamentals
JoEllen Carter347 views
Mapping Mashup Story Mapping Exercise 3 uncolored cards von JoEllen Carter
Mapping Mashup Story Mapping Exercise 3 uncolored cardsMapping Mashup Story Mapping Exercise 3 uncolored cards
Mapping Mashup Story Mapping Exercise 3 uncolored cards
JoEllen Carter144 views
Mapping Mashup Exercise solutions von JoEllen Carter
Mapping Mashup Exercise solutionsMapping Mashup Exercise solutions
Mapping Mashup Exercise solutions
JoEllen Carter257 views
Mapping Mashup Exercise handouts von JoEllen Carter
Mapping Mashup Exercise handoutsMapping Mashup Exercise handouts
Mapping Mashup Exercise handouts
JoEllen Carter144 views
Agile testing to build the right thing - Lisa Crispin and JoEllen Carter von JoEllen Carter
Agile testing to build the right thing - Lisa Crispin and JoEllen CarterAgile testing to build the right thing - Lisa Crispin and JoEllen Carter
Agile testing to build the right thing - Lisa Crispin and JoEllen Carter
JoEllen Carter301 views

Último

Data-centric AI and the convergence of data and model engineering: opportunit... von
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...Paolo Missier
34 views40 Folien
20231123_Camunda Meetup Vienna.pdf von
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
28 views73 Folien
Business Analyst Series 2023 - Week 3 Session 5 von
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5DianaGray10
209 views20 Folien
handbook for web 3 adoption.pdf von
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdfLiveplex
19 views16 Folien
Voice Logger - Telephony Integration Solution at Aegis von
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at AegisNirmal Sharma
17 views1 Folie
HTTP headers that make your website go faster - devs.gent November 2023 von
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
19 views151 Folien

Último(20)

Data-centric AI and the convergence of data and model engineering: opportunit... von Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier34 views
Business Analyst Series 2023 - Week 3 Session 5 von DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10209 views
handbook for web 3 adoption.pdf von Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex19 views
Voice Logger - Telephony Integration Solution at Aegis von Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma17 views
HTTP headers that make your website go faster - devs.gent November 2023 von Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn19 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors von sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab15 views
Web Dev - 1 PPT.pdf von gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet55 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 von IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Igniting Next Level Productivity with AI-Infused Data Integration Workflows von Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software225 views
Case Study Copenhagen Energy and Business Central.pdf von Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana12 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... von Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker26 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... von James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson33 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 von Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi120 views
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! von sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart939 views
Transcript: The Details of Description Techniques tips and tangents on altern... von BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada130 views

Agile Testing Days 2018 - API Fundamentals - postman collection

  • 1. { "info": { "_postman_id": "b34b7a28-42d6-44e2-9571-9ae4e6038b62", "name": "ATD 2018 USA", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "1 - Getting our feet wet", "description": "", "item": [ { "name": "Get weather from the Dark Sky API", "event": [ { "listen": "test", "script": { "id": "0426bcd9-ce79-4df2-9657- bebf60804b8a", "type": "text/javascript", "exec": [ "pm.test("Request with valid lat and long returns a 200 status code", function () {", " pm.response.to.have.status(200);", "});" ] } } ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/219a4cc6ef64023fdcee03a7335372b9/{{latitude}}, {{longitude}}", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "219a4cc6ef64023fdcee03a7335372b9 ", "{{latitude}},{{longitude}}" ] } }, "response": [] } ] }, { "name": "2 - Fundamental - Exploratory Tests", "description": "**5 minutes**rnrnExploratory testing approachrn- Identify the variable parts (we'll write these on a flip chart).rn- Apply Heuristics to the variables (not all of these may be applicable to our example)rn-- Zero, One, Manyrn-- Some, None, Allrn-- Beginning, Middle, Endrn-- Too Many, Too Fewrn-- Relative Position, i.e.
  • 2. content", "item": [ { "name": "Exploratory Testing the Weather API - Equator at Prime Meridian", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/0,0", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "0,0" ] } }, "response": [] }, { "name": "Exploratory Testing the Weather API - 100,100", "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/100,100", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "100,100" ] } }, "response": [] }, { "name": "Exploratory Testing the Weather API - South Pole", "request": { "method": "GET", "header": [], "body": {}, "url": { "raw":
  • 3. "https://api.darksky.net/forecast/{{darkskyKey}}/-90,0", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "-90,0" ] } }, "response": [] }, { "name": "Exploratory Testing the Weather API - North Pole", "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/90,0", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "90,0" ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "id": "2d66424f-1d29-46b6-ade6- 76227492b395", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "b5233ac5-661b-4478-bb2b- d4512cf6f8be", "type": "text/javascript", "exec": [ "" ] }
  • 4. } ] }, { "name": "3 - Fundamental - Functional Tests (aka Component tests)", "description": "**10 minutes**rnrnIn this activity, we'll add an assertion to our GET weather request.rnrnOpen a new tab.rnType or paste your request from 1-GET weather activity.rnClick the 'Tests' tab (check out Dan's screen).rnFirst we'll add a test for the status code (Dan will talk us through this).rnThen we'll check our response to make sure we're getting the weather forecast for our desired location.rn", "item": [ { "name": "Response codes", "event": [ { "listen": "test", "script": { "id": "7bcda5fd-d76e-4c2f-a3d9- 4df0473532ed", "type": "text/javascript", "exec": [ "" ] } } ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}? exclude=minutely,hourly,daily,flags", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "{{latitude}},{{longitude}}" ], "query": [ { "key": "exclude", "value": "minutely,hourly,daily,flags" } ] } }, "response": [] }, { "name": "Weather on New Years Day 2018", "event": [ { "listen": "prerequest", "script": {
  • 5. "id": "0a218173-9e24-4126-b91a- 4ff6d90434d4", "type": "text/javascript", "exec": [ "postman.setGlobalVariable( "NewYearsDay", "2018-01-01T00:00:01");" ] } }, { "listen": "test", "script": { "id": "2ca5abb6-f8f5-47c0-8168- ab35a37c1dc3", "type": "text/javascript", "exec": [ "pm.test("Forecast matches recorded weather", function() {", " var jsonData = pm.response.json();", " pm.expect(jsonData.currently.summary).to.eql("Clear");", "});" ] } } ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}, {{NewYearsDay}}", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "{{latitude}},{{longitude}}, {{NewYearsDay}}" ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "id": "a934cf78-10c3-4efa-845b- 677969f53e76", "type": "text/javascript", "exec": [ "" ] } },
  • 6. { "listen": "test", "script": { "id": "0b950846-9920-4059-a605- 4796f79dcc30", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "4 - Fundamental - Contract Tests", "description": "**10 minutes**rnrnContract tests verify that what you send back in your response matches what you told users would come back in your response.rnrnOne way of doing this in Postman is throught a schema validation.rnrnA schema defines the data structure of the response, and the rules around the structure. Rules meaning like what is required, what values can be null, what the max or min length of a string can be, and so on.rnrnWe have rules around specifying this data structure, or schema, in json, so that we can all understand what is expected.rnrnPostman has a built-in schema validator that we can use - we just need to specify the schema that we want our response validated against.rnrnjsonschema.net is a sweet tool for doing this.", "item": [ { "name": "Response json schema should match expected schema", "event": [ { "listen": "test", "script": { "id": "6b9b095b-6026-4a1c-98e2- 59c7655c92fb", "type": "text/javascript", "exec": [ "var data = JSON.parse(responseBody);", "var schema = {", " "$id": "http://exampl e.com/example.json",", " "type": "object",", " "definitions": {},", " "$schema": "http://js on-schema.org/draft-07/schema#",", " "additionalProperties" : false,", " "properties": {", " "latitude": {", " "$id": "/properti es/latitude",", " "type": "number" ", " },", " "longitude": {", " "$id": "/properti es/longitude",", " "type": "number" ", " },", " "timezone": {", " "$id": "/properti
  • 7. es/timezone",", " "type": "string" ", " },", " "offset": {", " "$id": "/properti es/offset",", " "type": "integer "", " }", " },", " "required": [", " "latitude",", " "longitude",", " "timezone",", " "offset"", " ]", "}", "", "pm.test("Response matches schema", function () {", " pm.expect(tv4.validate(data, schema),tv4.error).to.be.true;", " console.log("Schema Validation failed: ", tv4.error);", "", " });" ] } } ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}? exclude=currently,minutely,hourly,daily,flags,alerts", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "{{latitude}},{{longitude}}" ], "query": [ { "key": "exclude", "value": "currently,minutely,hourly,daily,flags,alerts" } ] } }, "response": [] }, { "name": "Response json schema should match expected schema (change query to exclude flags)",
  • 8. "event": [ { "listen": "test", "script": { "id": "fbb33ba0-c1ae-4a35-9a62- 9749c7128f24", "type": "text/javascript", "exec": [ "var data = JSON.parse(responseBody);", "var schema = {", " "$id": "http://exampl e.com/example.json",", " "type": "object",", " "definitions": {},", " "$schema": "http://js on-schema.org/draft-07/schema#",", " "additionalProperties" : false,", " "properties": {", " "latitude": {", " "$id": "/properti es/latitude",", " "type": "number" ", " },", " "longitude": {", " "$id": "/properti es/longitude",", " "type": "number" ", " },", " "timezone": {", " "$id": "/properti es/timezone",", " "type": "string" ", " },", " "offset": {", " "$id": "/properti es/offset",", " "type": "integer "", " }", " },", " "required": [", " "latitude",", " "longitude",", " "timezone",", " "offset"", " ]", "}", "", "pm.test("Response matches schema", function () {", " pm.expect(tv4.validate(data, schema),tv4.error).to.be.true;", " console.log("Schema Validation failed: ", tv4.error);", "", " });" ] } }
  • 9. ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}? exclude=currently,minutely,hourly,daily,alerts", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "{{latitude}},{{longitude}}" ], "query": [ { "key": "exclude", "value": "currently,minutely,hourly,daily,alerts" } ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "id": "ed0bb033-08b0-4331-9253- 10572e2a2590", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "f3e701e9-c74b-4964-a42b- 1d95cb54061b", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "5 - Fundamental - Performance, Load & Security Tests", "description": "**10 minutes**rnrnWe can easily extract a value from our json response.rnLet's add more than an assertion to the post- response javascript code.", "item": [
  • 10. { "name": "Response time should be less than 200 ms", "event": [ { "listen": "test", "script": { "id": "5b51f9c8-5965-40a7-a352- ad3ed370ea7c", "type": "text/javascript", "exec": [ "pm.test("Response time is less than 200ms", function () {", " pm.expect(pm.response.responseTime).to.be.below(200);", "});" ] } } ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "{{latitude}},{{longitude}}" ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "id": "757cfab0-f421-40ff-9ce9- aa195d4088d9", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "ccdfed8d-a3ee-4a39-ad3c- f9f4d398d122", "type": "text/javascript", "exec": [ "" ]
  • 11. } } ] }, { "name": "6 - Fundamental - "EndToEnd" Tests (aka Integration Tests)", "description": "", "item": [ { "name": "Get lat and long from darksky Geo", "event": [ { "listen": "test", "script": { "id": "828ec1a8-dac9-4ac7-b1a6- 5b61e7780d6e", "type": "text/javascript", "exec": [ "var jsonData = pm.response.json();", "pm.environment.set("latit ude", jsonData.latitude);", "pm.environment.set("longi tude", jsonData.longitude);" ] } } ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://darksky.net/geo? q={{location}}", "protocol": "https", "host": [ "darksky", "net" ], "path": [ "geo" ], "query": [ { "key": "q", "value": "{{location}}" } ] } }, "response": [] }, { "name": "GET forecast from darksky", "event": [ { "listen": "test", "script": { "id": "31bd0dd6-ffaa-47e0-a522- 47acd0d1d89f", "type": "text/javascript", "exec": [
  • 12. "//extract time", "var jsonData = pm.response.json();", "pm.environment.set("forec ast_time", jsonData.hourly.data[0].time);", "pm.environment.set("darks ky_temp", jsonData.hourly.data[0].temperature);", "pm.test("Request with valid lat and long returns a 200 status code", function () {", " pm.response.to.have.status(200);", "});" ] } } ], "request": { "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.darksky.net/forecast/{{darkskyKey}}/{{latitude}},{{longitude}}? exclude=minutely,currently,daily,flags,alerts", "protocol": "https", "host": [ "api", "darksky", "net" ], "path": [ "forecast", "{{darkskyKey}}", "{{latitude}},{{longitude}}" ], "query": [ { "key": "exclude", "value": "minutely,currently,daily,flags,alerts" } ] } }, "response": [] }, { "name": "GET forecast from aeris API", "event": [ { "listen": "test", "script": { "id": "cad93d58-6e4e-4f5f-b533- d9dda125355d", "type": "text/javascript", "exec": [ "var jsonData = pm.response.json();", "", "pm.test("Darksky latitude for location matches aeris latitude", function () {", " pm.expect(jsonData.response[0].loc.lat.toPrecision(2)).to.eql(pm.environment.get ("latitude").toPrecision(2));",
  • 13. "});", "", "pm.test("Darksky longitude for location matches aeris longitude", function () {", " pm.expect(jsonData.response[0].loc.long.toPrecision(2)).to.eql(pm.environment.ge t("longitude").toPrecision(2));", "});", "", "// pm.test("Darksky temp for current time matches aeris temp for same time", function () {", "// pm.expect(jsonData.response[0].periods[0].tempF).to.eql(Math.round(pm.environmen t.get("darksky_temp")));", "// });", "console.log("Darksky time, lat, long, temp = " + pm.environment.get("forecast_time") + "," + pm.environment.get("latitude") + "," + pm.environment.get("longitude") + "," + Math.round(pm.environment.get("darksky_temp")));", "console.log("Aeris time, lat, long, temp = " + jsonData.response[0].periods[0].timestamp + "," + jsonData.response[0].loc.lat + "," + jsonData.response[0].loc.long + "," + jsonData.response[0].periods[0].tempF);", "" ] } } ], "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "body": {}, "url": { "raw": "https://api.aerisapi.com/forecasts/{{location}}? from={{forecast_time}}&filter=1hr&client_id={{aerisID}}&client_secret={{aerisSec ret}}", "protocol": "https", "host": [ "api", "aerisapi", "com" ], "path": [ "forecasts", "{{location}}" ], "query": [ { "key": "from", "value": "{{forecast_time}}" }, { "key": "filter", "value": "1hr" }, { "key": "client_id", "value": "{{aerisID}}" },
  • 14. { "key": "client_secret", "value": "{{aerisSecret}}" } ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "id": "10f38ba5-9d50-431e-b144- 1a2f376b0c9b", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "e82cf4bd-d7d5-45a0-bdd8- 206b4ecadb0b", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "7 - Running tests in Postman", "description": "location.jsonnn[{n "location": "Boston, MA"n }, {n "location": "Atlanta, GA"n }, {n "location": "Denver, CO"n }, {n "location": "San Diego, CA"n}]", "item": [], "event": [ { "listen": "prerequest", "script": { "id": "dd1fad99-2aba-4f5e-b57c- b6ac6db91013", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "41f8913a-b3fe-4653-948d- 409fa08466d1", "type": "text/javascript", "exec": [ "" ] }
  • 15. } ] }, { "name": "8 - Running tests in CI & Test Reporting", "description": "", "item": [], "event": [ { "listen": "prerequest", "script": { "id": "dd1fad99-2aba-4f5e-b57c- b6ac6db91013", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "41f8913a-b3fe-4653-948d- 409fa08466d1", "type": "text/javascript", "exec": [ "" ] } } ] } ], "event": [ { "listen": "prerequest", "script": { "id": "e40f1f39-5b04-4d3e-82f6-f9044f4676f5", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "4128584d-7354-4ff3-976b-773ae868ade5", "type": "text/javascript", "exec": [ "" ] } } ] }