{cypress}

for API Testing: Beyond UI Automation

Anna Patterson

Principal Quality Engineer at EVERFI

https://slides.com/tester-anna/cypress-api-highway

 

 

June 21, 2024

cy.hello()

Anna Patterson, Principal Quality Engineer at EVERFI

https://www.linkedin.com/in/tester-anna/

- 10+ years in QA industry

- Applitools & Cypress Ambassador

- QA Career Mentor

- Mom of two

What we will cover today:

  • Benefits of API testing 
  • Cypress for API testing
  • Live Demo
  • Final thoughts and resources for further learning

Let's embark on this

learning journey

together!

  • Conceptualization
  • Product Design
  • Development
  • UI/UX Testing
  • Branding

Text

Early Detection of Issues

Enhanced Test Coverage

Automation and Efficiency

Decoupled Testing

Early Detection of Issues

Early Detection of Issues

{Benefits of API Testing}

Modern JavaScript framework with robust features

 

 

1.

2.

Ease of Use and Minimal Setup

 

3.

 

Comprehensive documentation and active ecosystem

 

 

 

{Why Cypress?}

Capabilities

Seamless API Requests

Automatic Assertions

Easy Stubbing and Mocking

Premium support

Capabilities

Seamless API Requests

Automatic Assertions

Easy Stubbing and Mocking

Integration with UI Tests

Real-Time Debugging

{Cypress for API testing}

Capabilities

Seamless API Requests

Automatic Assertions

Easy Stubbing and Mocking

Premium support

Benefits

Unified Testing Framework

Real-Time Interaction and Feedback 

Enhanced Debugging Capabilities

Automatic Waiting

Seamless CI/CD Integration

npm install cypress

# PRESENTING CODE

Pre-requisits:

  • Node.js
  • Code Editor (e.g. VS Code)

npx cypress open

# PRESENTING CODE

Demo: Basic Cypress API tests

# PRESENTING CODE

Demo: Mocking API Responses

# PRESENTING CODE

Demo: UI and API Integration

# PRESENTING CODE

Demo: Authentication Example

# PRESENTING CODE

Demo: Testing Error Scenarios

# PRESENTING CODE

Cons

Limited Support for Advanced API Testing Scenarios

Dependency on Browser Environment

Learning Curve

Pros

Seamless Integration with UI Tests

Built-in Command and Assertion Library

Real-time Feedback and Debugging

{Final Thoughts}

{Resources}

HOMEWORK

Our design team has a cWrollective 75 years of experience in crafting digital products. Our diverse backgrounds offer a thorough mix of points of view.

Write your first Cypress API test!

Get in touch

https://www.linkedin.com/in/tester-anna/

Cypress for API Testing: Beyond UI Automation

By Anna Patterson

Cypress for API Testing: Beyond UI Automation

  • 389