simorgh
simorgh copied to clipboard
test(WESTEAMA-1180): update topicPage tests to not use BFF
Resolves JIRA [WSTEAMA-1180]
Overall changes
Refactor and stabilise tests for topic page.
Code changes
- Removed
cy.getPageData functionand replaced it withgetPageDataFromWindow - Used window.SIMORGH_DATA.pageData for canonical tests
- Unskipped test
- Added a
BeforeEach()function, to ensure we always start from the path being tested and make the tests deterministic
Testing
- [x] Cypress Tests on PR passing
| Environment | Smoke | Command | Status |
|---|---|---|---|
| local | true | CYPRESS_APP_ENV=local CYPRESS_SMOKE=true yarn test:e2e | N/A |
| local | false | CYPRESS_APP_ENV=local yarn test:e2e | N/A |
| test | true | CYPRESS_APP_ENV=test CYPRESS_SMOKE=true yarn cypress | Pass |
| test | false | CYPRESS_APP_ENV=test yarn cypress | Pass |
| live | true | CYPRESS_APP_ENV=live CYPRESS_SMOKE=true yarn cypress | Pass |
| live | false | CYPRESS_APP_ENV=live yarn cypress | Pass |
Helpful Links
Add Links to useful resources related to this PR if applicable.
https://github.com/bbc/simorgh/pull/11554#discussion_r1580715329
I'm not sure about having it in a position where it runs for all the tests, as the pagination tests are a sequential user journey (e.g go to second page by clicking number 2, check page number, go to third page by clicking the next arrow, check page number. Next/Previous button tests won't have the same results if we go back to the same page before each test). For the page content tests this is fine, but not the pagination ones.