bbc / simorgh

The BBC's Open Source Web Application. Contributions welcome! Used on some of our biggest websites, e.g.
https://www.bbc.com/thai
Other
1.39k stars 219 forks source link

Fix E2Es - topic test failing because does not return from live page to topic page #11767

Closed LilyL0u closed 1 month ago

LilyL0u commented 1 month ago

Overall changes

There was a step in a test on the topic page tests that was failing because it was missing a command to go back to the topic page after visiting a live page. This didn't fail before because the next test that runs that checks for a message banner only runs if there is a message banner on the page, and on article pages there is never a message banner, so this test just passed without doing any assertions. It now shows as failing because there is a beforeEach for every test that check the page data for information it needs to run the tests - the live pages cannot have their data accessed in the same way, so it failed. Usually this step would happen on an article page (incorrectly because the test was missing a cy.go('back'), and would pass. It is supposed to happen on a topic page.

This makes me think that none of our assets actually have a message banner on a topic page. I haven't managed to find one yet to use.

Code changes

Testing

  1. List the steps used to test this PR.

Helpful Links

Add Links to useful resources related to this PR if applicable.

Coding Standards

Repository use guidelines

amoore108 commented 1 month ago

Should we change the title of the test: https://github.com/bbc/simorgh/blob/6ec38f217be2140490405941afb537c0c7966635/cypress/e2e/pages/topicPage/tests.js#L102

It mentions 'article' although other page types can be rendered now.

LilyL0u commented 1 month ago

Should we change the title of the test:

https://github.com/bbc/simorgh/blob/6ec38f217be2140490405941afb537c0c7966635/cypress/e2e/pages/topicPage/tests.js#L102

It mentions 'article' although other page types can be rendered now.

Yes good point. I'll change that.