Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress-tests-transliteration-script-switching #12500

Open
wants to merge 14 commits into
base: latest
Choose a base branch
from

Conversation

MeriemMechri
Copy link
Contributor

@MeriemMechri MeriemMechri commented Mar 11, 2025

Resolves JIRA [WORLDSERVICE-106]

Overall changes

  • Unskipped and fixed the flakiness for transliteration/script switching.
  • Updated fixture data for the following services: Uzbek, Serbia, zohongwen.
  • Removed onDemandAudio tests.

Testing

  • PR checks passing

  • Smoke Tests passing on test: CYPRESS_APP_ENV=test yarn cypress:interactive

  • Smoke Tests passing on live: CYPRESS_APP_ENV=live yarn cypress:interactive

  • Non-Smoke Tests (Scheduled E2Es) passing on test: CYPRESS_SMOKE=false CYPRESS_APP_ENV=test yarn cypress:interactive

  • Non-Smoke Tests (Scheduled E2Es) passing on live: CYPRESS_SMOKE=false CYPRESS_APP_ENV=live yarn cypress:interactive

Helpful Links

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

Coding Standards

Repository use guidelines

@MeriemMechri MeriemMechri changed the title (DRAFT) Cypress-tests-transliteration-script-switching Cypress-tests-transliteration-script-switching Mar 13, 2025
@karinathomasbbc
Copy link
Contributor

We can fix the broken integration tests by running yarn test:integration:updatesnapshots (which have failed because we've updated the fixture data used by some of these tests).

@@ -21,6 +21,7 @@ Object.keys(config)
.filter(
pageType =>
serviceHasPageType(serviceId, pageType) &&
pageType !== 'onDemandAudio' &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also remove the routes from the main settings.js file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, did we plan to refactor how the tests run to be more like this: #12364?

@@ -22,20 +23,25 @@ export const clickScriptSwitcher = variant => {
cy.get(`a[data-variant="${variant}"]`).click();
};

export const clickHomePageLink = product => {
// ToDo: double check this method is not used elsewhere
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this comment?

Suggested change
// ToDo: double check this method is not used elsewhere

clickFirstLink();
}
});
// If it is a MAP test, find first MAP within a StoryPromoLi item and click it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If it is a MAP test, find first MAP within a StoryPromoLi item and click it
// If it is a MAP test, find first MAP on the homepage and click it

Comment on lines +9 to +10
// cy.get('header[role="banner"]').first().within(() => {
// cy.get(`a[data-variant="${scriptToSwitchTo}"]`).should('exist');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put these back now?

@@ -44,7 +44,7 @@ const defaultCyrillicConfig = {
datetimeLocale: `uz`,
externalLinkText: ', ташқи',
frontPageTitle: 'Бош саҳифа',
lang: `uz-Cyrl`,
lang: `uz-cyrl`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check with anyone (Product?) whether this is OK to change?

@LilyL0u
Copy link
Contributor

LilyL0u commented Mar 13, 2025

When I run the tests against test, one of the tests has a problem where when it is looking for the first <a> on the page to visit the next page in the user journey, it is including the cookie banner <a> in it, because for some reason the cookie banner pops up on this page! This means the next test then fails as it goes to https://www.bbc.co.uk/userinfo which doesn't have the elements we are expecting on it.

Screenshot 2025-03-13 at 13 57 10

So we need to work out a fix for this for it to not fail in the test e2es.

@LilyL0u
Copy link
Contributor

LilyL0u commented Mar 13, 2025

When I ran the tests locally and on test I noticed that (like we were talking about this morning) the article pages clicked on locally always go to an error page, and then the script switch tests run on the error page. They are then not failing because the test then just checks the script switch works, and it does work on error pages, but it means locally and on test it is not testing article pages work with the script switch, just a lot of error page tests!

However, on live it does click valid article pages, and so the tests do run on article pages on live. Do we mind that article pages are not having the script switch checked on local and test, as long as they are covered on live?

@LilyL0u
Copy link
Contributor

LilyL0u commented Mar 13, 2025

When I run the tests against test, one of the tests has a problem where when it is looking for the first <a> on the page to visit the next page in the user journey, it is including the cookie banner <a> in it, because for some reason the cookie banner pops up on this page! This means the next test then fails as it goes to https://www.bbc.co.uk/userinfo which doesn't have the elements we are expecting on it.
Screenshot 2025-03-13 at 13 57 10

So we need to work out a fix for this for it to not fail in the test e2es.

I also ran against live and had the same issue BUT I realised this only happens the first time I run the tests. The next time I run the tests it doesn't happen (probably related to the cookie banner behaviour beign different after first visit). So the question is will this accidential cookie banner click happen in the AWS E2E runs, or not? Does this make the test flakey or does it never do this 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants