CORS API Mocking via Service Worker

Image source: https://mswjs.io/

2020 Dec Hack Day #16
Kevin C Chen

Today DevExp - Testing Website

https://pendo.improveops.com/

https://d05fmabcdo23e9.cloudfront.net/

https://qa.improveops.com/

https://e17fmwxyzo16a.cloudfront.net/

Custom AWS CloudFront
Distribution URL

Today DevExp - Testing Website

✅ Testing In Parallel

✅ Independent Environment

✅ No Impact to Staging & Prod

Today DevExp - Testing Website

https://pendo.improveops.com/

https://d05fmabcdo23e9.cloudfront.net/

https://qa.improveops.com/

https://e17fmwxyzo16a.cloudfront.net/

Custom AWS CloudFront
Distribution URL

https://pendo.improveops.com/

https://d05fmabcdo23e9.cloudfront.net/

https://qa.improveops.com/

https://e17fmwxyzo16a.cloudfront.net/

Custom AWS CloudFront
Distribution URL

Dedicated https://ssov1.dev-cloud.../

Waiting...

Testing...

Waiting...

Waiting...timeout...giving up

CORS - Failed Attempts via Frontend

Won't work with credential mode with cookie forwarding...

CORS - Failed Attempts via Frontend

Won't intercept API fetch calls blocked by CORS...

Need a way to automate the provisioning of backend service with appropriate CORS headers set...

 

 

But ... it's complicated

Testing Productivity Throughput

📉 Goes Down 📉

Service Worker API Mocking

Image source: https://mswjs.io/

DEMO

New Experience?

REST
GraphQL

Test with Confidence

Network Level Interception

Tech Stack
Agnostic

Tomorrow DevExp - Testing Website

https://pendo.improveops.com/

https://d05fmabcdo23e9.cloudfront.net/

https://qa.improveops.com/

https://e17fmwxyzo16a.cloudfront.net/

Custom AWS CloudFront
Distribution URL

😍 Improved Dev & Test Exp
🚀 Restore Productivity Throughput 📈

✅ Zero Application Code Change

✅ No Impact to Staging & Prod

🎁😊 Thank you 😊🎄

Made with Slides.com