Skip to content

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

Closed
pollym wants to merge 1 commit into
mozilla-firefox:autolandfrom
pollym:fix-ui-tests-for-nightly
Closed

pollym wants to merge 1 commit 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 3 warnings.
🚫 This pull request has 1 blocker.

@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 3 times, most recently from 7aa647a to 642c093 Compare September 24, 2026 14:01

@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?

@pollym

pollym commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

thanks for the review! 🙌

Should we also remove hardcoded IDs from verifySponsoredShortcutDoesNotExist?

hmm. looks like that's using appContext.packageName already so that part should be good on nightly.
i don't want to get too sidetracked by test refactoring here that doesn't help with the goal of running on nightly, but maybe that is a question for later!

…t configurations of pinned and sponsored shortcuts.

Such as one might find across different locales and build types (:

Also locate sponsored shortcuts by their sponsored label.
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.
@pollym
pollym force-pushed the fix-ui-tests-for-nightly branch from 642c093 to 5838fac Compare September 28, 2026 14:03
@lando-web
lando-web Bot requested a review from a team September 28, 2026 14:03
@pollym

pollym commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

added mihai's suggestion + squashed

lando-worker Bot pushed a commit that referenced this pull request Sep 28, 2026
…t configurations of pinned and sponsored shortcuts r=mcarare

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]( https://treeherder.mozilla.org/jobs?repo=try&revision=4eed3db2680212ca0e700810435c932a029d1bfd)

Pull request: #367
@lando-worker

lando-worker Bot commented Sep 28, 2026

Copy link
Copy Markdown

Pull request closed by commit a187dc0

@lando-worker lando-worker Bot closed this Sep 28, 2026
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