Luca Pelosi
Angela Distratis
Rome | March 22 - 23, 2019
Howtoearnablackbelt
inGraphQLtesting
2
What is GraphQL
3
/users/<id>
/users/<id>/posts
/users/<id>/followers{
"user": {
"id": "123456",
"name": "Mary",
"address": {
...
},
"birthday": "July 26,
1982"
}
}
GET
1
GraphQL vs Rest
4
/users/<id>
/users/<id>/posts
/users/<id>/followers{
"posts": [
{
"id": "newrtyu567",
"title": "Learn Graphql today",
"content": "Bla bla bla",
"comments": [...]
}
]
}
2
GraphQL vs Rest
GET
5
/users/<id>
/users/<id>/posts
/users/<id>/followers{
"followers": [
{
"id": ”Pete2345",
"name": ”Peter Thomas",
"address": { ... },
"birthday": "July 26,1970"
},
...
]
}
3
GraphQL vs Rest
GET
6
GraphQL vs Rest
POST
7
Karate
https://github.com/intuit/karate
HCOMInnovationtime
8
What is Karate
Data-driven testing
Karate vs REST-Assured
Key features
Reporting
Topics
9
# https://github.com/intuit/karate
# DSL, Cucumber based
# Gherkin syntax (Given/When/Then)
# No need deep programming skill
?
What is Karate?
10
Karate Architecture
11
JSON is ‘native’ to the
syntax
Intuitive DSL
for HTTP
Payload
assertion in
one line
Second HTTP
call using
response data
Testing made simple (REST example)
12
Karate
&
GraphQL
13
QUERY
RESPONSE
# read/transform from file
# placeholder substitution
# multi-line text variables
# dynamic schema validation
# fuzzy matching
# native smart compare
Karate & GraphQL
14
# multi-line text variables
# placeholder substitution
# read/transform from file
Manage the
plain text query
15
# multi-line text variables
# placeholder substitution
Manage the plain text query
16
*symbol as jolly for any of Given/And/When/Then ‘#(var)’ for embed variables in the JSON
# read from file
Manage the plain text query
17
# native smart compare
Manage the
JSON response
18
# native smart compare
See also: match each, !contains, contains only, contains any, … or shortcuts: ^, ^^, !^, …
Manage the JSON response
19
# fuzzy matching
# dynamic schema validation
Manage the
JSON response
20
# fuzzy matching
GraphQL responses:
# change dynamically depending on query
# tend to be deeply nested
# optional response fields
Karate can:
# validate expected patterns, using markers
Manage the JSON response
21
# fuzzy matching
_ = current value$ = response root
Manage the JSON response
22
# dynamic schema validation
Manage the JSON response
23
JSON Schema Karate Validation
# dynamic schema validation
Manage the JSON response
24
EarnaBlackBelt
# data-driven tests
# reporting
25
# data-driven tests
Data driven tests (Cucumber way)
26
# data-driven tests
Data driven tests
27
# reporting
Reporting
# reporting
28
Karate Rest-Assured
29
Karate vs REST-Assured: features
30
https://github.com/mwinteringham/api-framework/pull/3
Karate vs Rest-Assured:
code lines reduction
431 vs 67
31
Karate vs Rest-Assured:
code lines reduction
ApiTest.java
BookingDates.java:52
Booking.java:102
BookingApi.java:37
api-test.feature
32
Gatling feature reuse Mock support
Graphic
interface
Postman import
Retry until
Karate additional features
33
Thankyou!
Luca Pelosi
lucap84@gmail.com
Angela Distratis
angela.distratis@gmail.com
Rome | March 22 - 23, 2019

More Related Content

PPTX
API Test Automation Using Karate (Anil Kumar Moka)
PDF
MongoDB
PDF
GitConnect
PPTX
Karate - MoT Dallas 26-Oct-2017
PPTX
Karate for Complex Web-Service API Testing by Peter Thomas
PDF
Karate - Web-Service API Testing Made Simple
PPTX
Testing Graph QL Presentation (Test Automation)
PPTX
Introduction to Testing GraphQL Presentation
API Test Automation Using Karate (Anil Kumar Moka)
MongoDB
GitConnect
Karate - MoT Dallas 26-Oct-2017
Karate for Complex Web-Service API Testing by Peter Thomas
Karate - Web-Service API Testing Made Simple
Testing Graph QL Presentation (Test Automation)
Introduction to Testing GraphQL Presentation

Similar to Angela Distratis, Luca Pelosi - How to earn a black belt in GraphQL testing - Codemotion Rome 2019 (20)

PPTX
GraphQL research summary
PDF
apidays LIVE India - Karate for REST and GraphQL test automation by Peter Tho...
PPTX
Karate DSL
PDF
Flavours - Classic/Technical BDD
PDF
PDF
GraphQL- Presentation
PPTX
GraphQL.pptx
PPTX
GraphQL.pptx
PDF
Modern APIs with GraphQL
PDF
PDF
codersera_com (1).pdf
PDF
Introduction to GraphQL
PDF
React and GraphQL at Stripe
PDF
REST to GraphQL migration: Pros, cons and gotchas
PDF
Wax on, wax off
PDF
Elixir + GraphQL = Absinthe 2019.04.10
PDF
GraphQL with .NET Core Microservices.pdf
PPTX
Data-driven development with GraphQL and Flow
PDF
API Test Automation using Karate.pdf
PDF
Karate API Testing-Complete Guidance by Testrig
GraphQL research summary
apidays LIVE India - Karate for REST and GraphQL test automation by Peter Tho...
Karate DSL
Flavours - Classic/Technical BDD
GraphQL- Presentation
GraphQL.pptx
GraphQL.pptx
Modern APIs with GraphQL
codersera_com (1).pdf
Introduction to GraphQL
React and GraphQL at Stripe
REST to GraphQL migration: Pros, cons and gotchas
Wax on, wax off
Elixir + GraphQL = Absinthe 2019.04.10
GraphQL with .NET Core Microservices.pdf
Data-driven development with GraphQL and Flow
API Test Automation using Karate.pdf
Karate API Testing-Complete Guidance by Testrig
Ad

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Ad

Recently uploaded (20)

PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
Auditboard EB SOX Playbook 2023 edition.
PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
Co-training pseudo-labeling for text classification with support vector machi...
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PPTX
future_of_ai_comprehensive_20250822032121.pptx
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PPTX
Module 1 Introduction to Web Programming .pptx
giants, standing on the shoulders of - by Daniel Stenberg
Auditboard EB SOX Playbook 2023 edition.
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
4 layer Arch & Reference Arch of IoT.pdf
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
Enhancing plagiarism detection using data pre-processing and machine learning...
Co-training pseudo-labeling for text classification with support vector machi...
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
MuleSoft-Compete-Deck for midddleware integrations
Advancing precision in air quality forecasting through machine learning integ...
Convolutional neural network based encoder-decoder for efficient real-time ob...
NewMind AI Weekly Chronicles – August ’25 Week IV
Basics of Cloud Computing - Cloud Ecosystem
Connector Corner: Transform Unstructured Documents with Agentic Automation
future_of_ai_comprehensive_20250822032121.pptx
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
Data Virtualization in Action: Scaling APIs and Apps with FME
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Module 1 Introduction to Web Programming .pptx

Angela Distratis, Luca Pelosi - How to earn a black belt in GraphQL testing - Codemotion Rome 2019