Skip to content

fix(functional): scope CMS logo locator to avoid PromoQrMobile collision#20784

Merged
vbudhram merged 1 commit into
mainfrom
fxa-14008
Jun 23, 2026
Merged

fix(functional): scope CMS logo locator to avoid PromoQrMobile collision#20784
vbudhram merged 1 commit into
mainfrom
fxa-14008

Conversation

@vbudhram

Copy link
Copy Markdown
Contributor

Because

  • The PromoQrMobile promo renders a second <img alt="Firefox logo"> (in a complementary landmark) on the Sync signin/signup screens.
  • assertCmsCustomization's logo locator (getByRole('img', { name: 'Firefox logo', exact: true })) then matched two elements, throwing a Playwright strict-mode violation before any assertion ran.
  • This broke four CMS #smoke tests on stage: signup, signin, signin login confirmation, and 2FA TOTP sign-in (all with Sync). Only Sync variants failed; 123Done uses a unique logo alt.

This pull request

  • Scopes the logo locator with .and(page.locator('[src="${logoUrl}"]')) so it targets only the CMS header logo (CDN src), not the promo's bundled ff-logo.svg.
  • Applies the identical fix in cms.spec.ts and cms-2fa.spec.ts (the helper is duplicated across both).

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-14008

Checklist

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

Other information

How to test (runs against stage; requires a WAF bypass token):

cd packages/functional-tests
CI_WAF_TOKEN='' yarn playwright test --project=stage
tests/cms/cms.spec.ts tests/cms/cms-2fa.spec.ts -g "with Sync|TOTP - Sync"

Expected: all 4 pass. Verified on stage (the 2FA test needs the SMS/redis gate enabled to run).

Note: These specs skip locally — the local auth-server returns an empty CMS config (/cms/config{}), so there are no customizations to assert without a Strapi dev instance.

Because:
- PromoQrMobile renders a second img with alt "Firefox logo" on the Sync
  signin/signup screens, so assertCmsCustomization's logo locator matched two
  elements and threw a Playwright strict-mode violation.

This commit:
- Scopes the logo locator by src to the CMS header logo, fixing the signup,
  signin, signin login confirmation, and 2FA TOTP sign-in Sync smoke tests.
@vbudhram vbudhram requested a review from a team as a code owner June 23, 2026 01:30
@vbudhram vbudhram self-assigned this Jun 23, 2026

@LZoog LZoog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Only comment is this:

The Kit QR code image can come from a URL/changed in Strapi, I am not sure if that's accounted for here? If that's an issue, if only one of these is a complementary, that could give us a landmark to look for this img and logo in instead of checking the URL directly?

@vbudhram vbudhram merged commit cdc3c6c into main Jun 23, 2026
20 checks passed
@vbudhram vbudhram deleted the fxa-14008 branch June 23, 2026 15:58
@vbudhram

Copy link
Copy Markdown
Contributor Author

@LZoog I don't think it will conflict, this change looks for the logo url as well.

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.

2 participants