Skip to content

Bug 2073095 - make the home screen tests safe to be run with different configurations of pinned and sponsored shortcuts - #367

Open
pollym wants to merge 2 commits into
mozilla-firefox:autolandfrom
pollym:fix-ui-tests-for-nightly
Open

pollym wants to merge 2 commits into
mozilla-firefox:autolandfrom
pollym:fix-ui-tests-for-nightly

Conversation

@pollym

@pollym pollym commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Sponsored shortcuts were located by their absolute position in the top sites list, which assumes a fixed number of pinned shortcuts precedes them. getSponsoredShortcutTitle and verifySponsoredShortcutDetails now take an index among the sponsored shortcuts only, resolved through the sponsored label that only sponsored shortcuts carry.

TopSitesTest's setUp asserted the entire default top sites list where, as its comment says, it only needs to wait for the list to be displayed.

This makes the tests more resilient to changes in top sites and will allow these tests to pass on a nightly build as well as a debug build.

try after rebase is running here


Lando: link
Bugzilla: bug 2073095

⚠️ This pull request has 4 warnings.
🚫 This pull request has 2 blockers.

@github-actions

Copy link
Copy Markdown
Contributor

View this pull request in Lando to land it once approved.

@lando-web
lando-web Bot requested a review from a team September 23, 2026 15:30
@pollym pollym changed the title Bug 2073095 - locate sponsored shortcuts by their sponsored label Bug 2073095 - make the home screen tests safe to be run with different configurations of pinned and sponsored shortcuts. Sep 23, 2026
@pollym pollym changed the title Bug 2073095 - make the home screen tests safe to be run with different configurations of pinned and sponsored shortcuts. Bug 2073095 - make the home screen tests safe to be run with different configurations of pinned and sponsored shortcuts Sep 23, 2026
@pollym
pollym force-pushed the fix-ui-tests-for-nightly branch 2 times, most recently from 5d3c2cc to 7aa647a Compare September 24, 2026 13:29
Sponsored shortcuts were located by their absolute position in the top sites
list, which assumes a fixed number of pinned shortcuts precedes them.
getSponsoredShortcutTitle and verifySponsoredShortcutDetails now take an index
among the sponsored shortcuts only, resolved through the sponsored label that
only sponsored shortcuts carry.

TopSitesTest's setUp asserted the entire default top sites list where, as its
comment says, it only needs to wait for the list to be displayed.
…t configurations of pinned and sponsored shortcuts.

Such as one might find across different locales and build types (:
@pollym
pollym force-pushed the fix-ui-tests-for-nightly branch from 7aa647a to 642c093 Compare September 24, 2026 14:01
val secondSponsoredShortcutTitle by lazy { getSponsoredShortcutTitle(2) }

// Expected for en-us defaults
val defaultTopSitesList by lazy {

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.

should this also be removed, since it's not used in tests anymore?

@mcarare mcarare 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!
Should we also remove hardcoded IDs from verifySponsoredShortcutDoesNotExist?

This branch has not been deployed

No deployments
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