SlideShare a Scribd company logo
NS E-commerce integration tests
A test-first approach
Summary
• REST API integration tests.
• SAP Hybris integration tests.
PROBLEM
• We want to create correct test cases before the API is in place.
• We have a specification.
Testing a REST API before it’s implemented
• The mocked responses are set in Mock Server through its API (thus
programmatically).
• The specification is the blueprint for the mocked response.
PROBLEM
• How can we create test scenarios that include sending JSON messages to the API in a
business-friendly language?
Using Cucumber for checking an HTTP response
code (error 404)
Debugging with Fiddler
PROBLEM
• How can we create scenarios that check JSON expectations in a readable and
business-friendly way?
Checking JSON expectations – rigid approach
• Difficult to test partial
fulfillment of expectations,
which is important while
stories are under active
development.
Checking JSON expectations – leveraging JSON
Path and Cucumber
Advantages of the flexible approach
• Partial expectations (partial JSON correctness) can be tested.
• The semantics of the JSON message are abstracted from the actual messaging.
• It’s easy to create new test cases, because we don’t need to deal with JSON.
Debugging with Fiddler
PROBLEM
• Some fields in the response are dynamically generated, how can we create scenarios
that check these?
Dealing with dynamic fields: expression language
SAP Hybris testing
• In addition to the difficulties that apply to the REST API there is an additional one:
race conditions between tests.
• Test scenarios cannot be launched in parallel.
• Even when the scenarios are run sequentially, manual testing can still interfere and
create race conditions.
From test-first to test-driven
• Dependency on seed data.
• Need to test development branches (on CI server or local dev computer), since code
that fulfills acceptance criteria only partially should not be committed to the master
branch.
• Incorporate test-driven on the software development process of the team.

More Related Content

PPTX
Karate DSL
PDF
Wax on, wax off
PPT
Paper CS
PPTX
API Test Automation Using Karate (Anil Kumar Moka)
PDF
Testing APIs in the Cloud
PPTX
Story Testing Approach for Enterprise Applications using Selenium Framework
PPTX
Functional REST API testing in ASP.NET Core
PDF
Karate DSL
Wax on, wax off
Paper CS
API Test Automation Using Karate (Anil Kumar Moka)
Testing APIs in the Cloud
Story Testing Approach for Enterprise Applications using Selenium Framework
Functional REST API testing in ASP.NET Core

What's hot (20)

DOC
Resume
PPTX
Bdd – with cucumber and gherkin
PDF
Why vREST?
PDF
Continuous Quality with Postman
PDF
Automation testing API in Java
PPTX
Automated Test Framework with Cucumber
PPTX
Hands on BDD with cucumber - Agile Goa Sept 2013
PPTX
Introduction to Bdd and cucumber
PPTX
BDD for APIs
PPTX
Tutorial on the integration of Selenium with cucumber for experts and fresher’s
PPTX
API Testing with Open Source Code and Cucumber
PDF
Design First API's with RAML and SoapUI
PPTX
How to be an awesome test automation professional
PPTX
Introduction to APIs & how to automate APIs testing with selenium web driver?
PPTX
Cucumber BDD
PPTX
API Test Automation Tips and Tricks
PPT
Presentation for soap ui
PDF
API Testing
PPTX
API Virtualization: Mocking on Steroids
PDF
An Introduction To Automated API Testing
Resume
Bdd – with cucumber and gherkin
Why vREST?
Continuous Quality with Postman
Automation testing API in Java
Automated Test Framework with Cucumber
Hands on BDD with cucumber - Agile Goa Sept 2013
Introduction to Bdd and cucumber
BDD for APIs
Tutorial on the integration of Selenium with cucumber for experts and fresher’s
API Testing with Open Source Code and Cucumber
Design First API's with RAML and SoapUI
How to be an awesome test automation professional
Introduction to APIs & how to automate APIs testing with selenium web driver?
Cucumber BDD
API Test Automation Tips and Tricks
Presentation for soap ui
API Testing
API Virtualization: Mocking on Steroids
An Introduction To Automated API Testing
Ad

Similar to Ns e commerce integration tests (20)

PPTX
Rest assured
PDF
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...
PDF
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
PPTX
Tools for Software Testing
PDF
Webservicex.pdf
PPT
Test automation lessons from WebSphere Application Server
PPTX
ASP.NET Core Unit Testing
PPTX
Helpful Automation Techniques - Selenium Camp 2014
PDF
Can you trust your APIs - White Paper on API Testing
DOCX
Karuna Resume
PPTX
ATAGTR2017 Test the REST
PDF
DevSecCon Asia 2017 - Abhay Bhargav: Building an Application Vulnerability To...
PDF
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
PDF
Was liberty
PPTX
API Driven Design
PDF
Testing Ajax, Mobile Apps the Agile Way
PDF
Performance Engineering Case Study V1.0
PDF
Pitney Bowes Uses Development and Testing Tools to Drive Early API Developmen...
PDF
Testing in the Cloud using Panda
PPTX
Chef onlinuxonpower
Rest assured
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Tools for Software Testing
Webservicex.pdf
Test automation lessons from WebSphere Application Server
ASP.NET Core Unit Testing
Helpful Automation Techniques - Selenium Camp 2014
Can you trust your APIs - White Paper on API Testing
Karuna Resume
ATAGTR2017 Test the REST
DevSecCon Asia 2017 - Abhay Bhargav: Building an Application Vulnerability To...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Was liberty
API Driven Design
Testing Ajax, Mobile Apps the Agile Way
Performance Engineering Case Study V1.0
Pitney Bowes Uses Development and Testing Tools to Drive Early API Developmen...
Testing in the Cloud using Panda
Chef onlinuxonpower
Ad

More from Roberto Perez-Rodriguez (6)

PPTX
Ansible E2E Testing
PPTX
Branching by abstraction
PDF
PPTX
EDUCON 2010: Adaptation in a PoEML-based E-learning Platform
PPTX
ICALT 2010: Supporting Exception Handling in Scripted Collaborative Courses
PPTX
FIE2010: Orchestrating Groupware in Engineering Education
Ansible E2E Testing
Branching by abstraction
EDUCON 2010: Adaptation in a PoEML-based E-learning Platform
ICALT 2010: Supporting Exception Handling in Scripted Collaborative Courses
FIE2010: Orchestrating Groupware in Engineering Education

Recently uploaded (20)

PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
innovation process that make everything different.pptx
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPTX
E -tech empowerment technologies PowerPoint
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
Introduction to Information and Communication Technology
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Slides PPTX World Game (s) Eco Economic Epochs.pptx
innovation process that make everything different.pptx
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Unit-1 introduction to cyber security discuss about how to secure a system
presentation_pfe-universite-molay-seltan.pptx
E -tech empowerment technologies PowerPoint
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Decoding a Decade: 10 Years of Applied CTI Discipline
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Design_with_Watersergyerge45hrbgre4top (1).ppt
Job_Card_System_Styled_lorem_ipsum_.pptx
tcp ip networks nd ip layering assotred slides
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Introduction to Information and Communication Technology
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
introduction about ICD -10 & ICD-11 ppt.pptx

Ns e commerce integration tests

  • 1. NS E-commerce integration tests A test-first approach
  • 2. Summary • REST API integration tests. • SAP Hybris integration tests.
  • 3. PROBLEM • We want to create correct test cases before the API is in place. • We have a specification.
  • 4. Testing a REST API before it’s implemented • The mocked responses are set in Mock Server through its API (thus programmatically). • The specification is the blueprint for the mocked response.
  • 5. PROBLEM • How can we create test scenarios that include sending JSON messages to the API in a business-friendly language?
  • 6. Using Cucumber for checking an HTTP response code (error 404)
  • 8. PROBLEM • How can we create scenarios that check JSON expectations in a readable and business-friendly way?
  • 9. Checking JSON expectations – rigid approach • Difficult to test partial fulfillment of expectations, which is important while stories are under active development.
  • 10. Checking JSON expectations – leveraging JSON Path and Cucumber
  • 11. Advantages of the flexible approach • Partial expectations (partial JSON correctness) can be tested. • The semantics of the JSON message are abstracted from the actual messaging. • It’s easy to create new test cases, because we don’t need to deal with JSON.
  • 13. PROBLEM • Some fields in the response are dynamically generated, how can we create scenarios that check these?
  • 14. Dealing with dynamic fields: expression language
  • 15. SAP Hybris testing • In addition to the difficulties that apply to the REST API there is an additional one: race conditions between tests. • Test scenarios cannot be launched in parallel. • Even when the scenarios are run sequentially, manual testing can still interfere and create race conditions.
  • 16. From test-first to test-driven • Dependency on seed data. • Need to test development branches (on CI server or local dev computer), since code that fulfills acceptance criteria only partially should not be committed to the master branch. • Incorporate test-driven on the software development process of the team.