FOMO Daily
Feed
Gleb Bahmutovยท

Cypress Test For Optional Data

Frontend & WebCypressEnd-to-End Testing

TL;DR

Optional shipping predictions make UI tests tricky because the backend may return data or nothing. The approach uses Cypress to delay requests and selectively remove or replace prediction data, while cy-spok checks real predictions when present and mock data against the same schema. This makes loading, missing-data, and successful-display tests predictable while helping catch backend schema changes without replacing unrelated response fields.

Read the original post Sign in to mark as read or skip