Control Next.js Server-Side Data During Cypress Tests

1 · Gleb Bahmutov · July 16, 2021, 8:43 p.m.
Let's take a Next.js example application that passes data from the server to the client-side through props. You can find my example in the repo bahmutov/next-state-overwrite-example. Here is the home page pages/index.js:pages/index.js12345678910111213141516171819202122232425262728293031323334import Head from 'next/head'import styles from '../styles/Home.module.css'export async function getServerSideProps() { const props = { experiments: { greeting: 'Server-side says hello!', }, } c...