simorgh icon indicating copy to clipboard operation
simorgh copied to clipboard

test(WESTEAMA-1180): update topicPage tests to not use BFF

Open MeriemMechri opened this issue 1 year ago • 1 comments

Resolves JIRA [WSTEAMA-1180]

Overall changes

Refactor and stabilise tests for topic page.

Code changes

  1. Removed cy.getPageData function and replaced it with getPageDataFromWindow
  2. Used window.SIMORGH_DATA.pageData for canonical tests
  3. Unskipped test
  4. 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.

Coding Standards

Repository use guidelines

MeriemMechri avatar Apr 23 '24 16:04 MeriemMechri

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.

LilyL0u avatar Apr 26 '24 09:04 LilyL0u