Skip to content

E2E: Fix LOHP theme signup selection#110561

Open
lancewillett wants to merge 3 commits intotrunkfrom
fix/lohp-theme-signup-waits
Open

E2E: Fix LOHP theme signup selection#110561
lancewillett wants to merge 3 commits intotrunkfrom
fix/lohp-theme-signup-waits

Conversation

@lancewillett
Copy link
Copy Markdown
Contributor

Proposed Changes

  • Add page-object waits for the logged-out home page to themes showcase navigation and the themes filter state.
  • Start the LOHP theme signup flow from the first card's explicit Get started URL instead of clicking the theme card/image.
  • Preserve the selected theme slug from the start URL so the existing post-purchase theme assertion still verifies the chosen theme.

Why are these changes being made?

The modern logged-out themes card uses a hover overlay with Preview demo and Get started actions. Playwright's click path hovers the image link before clicking it, which can reveal the overlay and let the Preview demo button intercept pointer events. This restores the older CTA-href pattern for this flow and removes the flaky card/image click from the release E2E path.

Testing Instructions

  • yarn workspace @automattic/calypso-e2e build
  • ./node_modules/.bin/eslint --ext .ts --cache packages/calypso-e2e/src/lib/pages/logged-out-home-page.ts packages/calypso-e2e/src/lib/pages/logged-out-themes-page.ts test/e2e/specs/onboarding/signup__with-theme-LOHP.spec.ts
  • git diff --check
  • Ran the targeted Playwright desktop spec against the pre-release Calypso environment with --reporter=list.
  • Confirmed locally: 2 passed.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@lancewillett lancewillett marked this pull request as ready for review May 7, 2026 22:20
@lancewillett lancewillett requested a review from lucatume May 7, 2026 22:20
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 7, 2026
@lancewillett lancewillett requested a review from arthur791004 May 7, 2026 22:21
@lancewillett
Copy link
Copy Markdown
Contributor Author

This change helps solve intermittent E2E test failures in TeamCity that show up with this error:

Test: signup__with-theme-LOHP.spec.ts: As a new WordPress.com user I can sign up for a new Premium plan site using a theme from the Logged Out Home Page
Error:
FAILURE: signup__with-theme-LOHP.spec.ts:25:7 One: As a new WordPress.com user I can sign up for a new Premium plan site using a theme from the Logged Out Home Page

@lancewillett
Copy link
Copy Markdown
Contributor Author

Follow-up after an adversarial E2E/CI pass:

  • Kept this as E2E coverage because the LOHP theme signup path exercises a critical full-stack workflow: signup, checkout, theme activation, and cancellation.
  • Tightened the helper so the visible Get started CTA must pass Playwright actionability checks before the test uses controlled navigation to the configured Calypso target.
  • Removed explicit 30s overrides from simple click actions so the global 10s action timeout remains effective.
  • Added cheap unit coverage for the href-to-Calypso URL normalization so that logic is not only guarded by the expensive signup E2E.

Validation passed locally: package unit test, calypso-e2e build, lint on touched files, and the LOHP spec on desktop and mobile against wpcalypso.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 110561
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 110561
    

@lancewillett
Copy link
Copy Markdown
Contributor Author

Follow-up from the refreshed TeamCity run:

The pixel job exposed one more wait-order issue in the helper. filterBy() was waiting for a theme card before applying the Free filter, but the LOHP /themes?... entry can defer card rendering before the filter transition. The helper now waits only for the View control before filtering, then waits for the first card after the filter route has changed.

Revalidated locally against wpcalypso.wordpress.com:

  • package unit test for the href normalization helper
  • lint on touched files
  • git diff --check
  • LOHP signup spec on desktop
  • LOHP signup spec on mobile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants