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

Cypress tests failing on non local environments if you're in the UK #2123

Closed jamesbhobbs closed 4 years ago

jamesbhobbs commented 5 years ago

Describe the bug Run all E2E tests on test, stage or live and three different groups of tests will fail:

To Reproduce Steps to reproduce the behavior:

  1. Be in UK
  2. Run E2Es against test, stage or live.

Expected behavior Tests pass

Screenshots n/a

Desktop (please complete the following information): n/a

Smartphone (please complete the following information): n/a

Additional context

PriyaKR commented 5 years ago

@PriyaKR To verify whether refactoring of cookieBanner.canonical.js and cookieBanner.amp.js into one test file would still have the second domain issue.

PriyaKR commented 5 years ago

Can't refactor think the cookieBanner.canonical.js and cookieBanner.amp.js into one test file as the cookie banner in canonical and amp page seem to behave differently(AMP doesn’t do first-party cookies, the data is stored in localstorage).

Also @benjaminhobbs Amp Cookie Banner Test and Canonical Cookie Banner Test fail no more on non local environments if you're in the UK as this was fixed by this PR https://github.com/bbc/simorgh/pull/2038 some changes has been done to the config file.

So this issue will then basically be are we able to fix the domain issue for articleBodyspec.js where in a single test file looping through the news article(domain .co.uk) and then the persian(domain .com) article.

jamesbhobbs commented 5 years ago

Relates to https://github.com/bbc/simorgh/issues/2046

PriyaKR commented 5 years ago

Are we able to do something like this https://github.com/cypress-io/cypress/issues/2671#issuecomment-444069577 as mentioned here try adding some fake geolocation to the visit command.

jamesbhobbs commented 5 years ago

The fix was reverted due to cypress clearCookies not clearing all cookies, creating flakey tests.