Migrate MostRead e2es to Next.js app#13855
Conversation
| atiAnalytics: { | ||
| ...data.pageData.metadata.atiAnalytics, | ||
| pageTitle: data.pageData.title || null, | ||
| }, |
There was a problem hiding this comment.
I'm going to add this logic in the API. This is just a temporary measure.
| path: '/arabic/popular/read', | ||
| service: 'arabic', | ||
| runforEnv: ['local', 'test', 'live'], | ||
| runforEnv: ['test', 'live'], |
There was a problem hiding this comment.
Is there a benefit to having at least one test on local? It looks like we've removed them all.
There was a problem hiding this comment.
Pidgin still has a local test for the page and ATI data:
There was a problem hiding this comment.
Pull request overview
This PR migrates Most Read Cypress E2E coverage into the ws-nextjs-app (Next.js) test setup and aligns Most Read SSR metadata so ATI analytics has a pageTitle for the Most Read route (which is implemented as a Topic page under the hood).
Changes:
- Updates Most Read Next.js SSR props to populate
metadata.atiAnalytics.pageTitlefrom the page title. - Moves/rewires Most Read Cypress suites to use
ws-nextjs-app/cypresshelpers and updated assertion exports. - Removes AMP Most Read E2E coverage and limits suites to canonical + lite where applicable.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ws-nextjs-app/pages/[service]/popular/[read]/[[...variant]].page.tsx | Adds atiAnalytics.pageTitle to Most Read SSR pageData.metadata. |
| ws-nextjs-app/cypress/e2e/mostReadPage/testsForCanonicalOnly.ts | Fixes helper import path for Chartbeat tests after migration. |
| ws-nextjs-app/cypress/e2e/mostReadPage/tests.ts | Switches to default export for Most Read assertions. |
| ws-nextjs-app/cypress/e2e/mostReadPage/mostReadAssertions.ts | Simplifies assertions to canonical-only (removes AMP-only branch) and exports default. |
| ws-nextjs-app/cypress/e2e/mostReadPage/index.cy.ts | Repoints imports to Next.js app Cypress helpers, removes AMP suites, updates ATI suite config and pageType constant. |
Comments suppressed due to low confidence (1)
ws-nextjs-app/cypress/e2e/mostReadPage/index.cy.ts:72
atiAnalyticsTestSuitesis passed intorunTestsForPagewithout being typed/cast toTestDataType[], but it containssiteIdvalues as numbers (e.g.70).runTestsForPage'sTestDataTypecurrently definessiteId?: string, so this will fail TypeScript checking unless you either (a) cast like other e2e entrypoints do (e.g.topicPage/index.cy.tsuses] as unknown as TestDataType[];) or (b) fix the underlying types to acceptnumberforsiteId(which also matches how the ATI assertions compare it).
Part of JIRA: https://bbc.atlassian.net/browse/WS-203
Summary
Migrate MostRead e2es from Express app to Next.js app
Deletes the
errorPage404tests from the Express app as the Next.js app already has these testsCode changes
errorPage404testsTesting
Useful Links