Skip to content

Closes #441: Validate renew banner wording, grandfather and OCD cases - #442

Draft
Mai-Saad wants to merge 2 commits into
developfrom
test/441-renew-banner-text-validation
Draft

Mai-Saad wants to merge 2 commits into
developfrom
test/441-renew-banner-text-validation

Conversation

@Mai-Saad

@Mai-Saad Mai-Saad commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI-generated — created by an automated pipeline. Review before acting on this.

Closes #441

Description

Fixes #441
Adds text assertions to the renewal banner scenarios so the suite catches wording regressions (title and body) for expiring-soon and expired licenses, plus grandfathered Plus licenses and the "expired 2 days ago" banner with Optimize CSS Delivery (OCD) on and off.

Prerequisites checklist (do not merge before these are done):

  • wp-media/wp-rocket-e2e-test-helper PR adding the created_in_2020 creation-date option is merged
  • e2e environment snapshot refreshed with that helper version
  • wp-rocket#9098 (fix/9095-renewal-promo-banners-align) is merged

Type of change

  • New feature (non-breaking change which adds functionality).
  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as before).
  • Sub-task of #(issue number)
  • Chore
  • Release

Detailed scenario

What was tested

How to test

Environment: a confirmed-free e2e hostname (not yet confirmed; AGENTS.md §9), a WP Rocket build containing wp-rocket#9098, and the helper version that provides created_in_2020.

  1. Run the renewal scenarios against the build under test:
    E2E_WPR_NEW_REF=branch:fix/9095-renewal-promo-banners-align node ./node_modules/@cucumber/cucumber/bin/cucumber-js -p default --retry 0 --tags "@renewal"
  2. Run one existing @promo scenario to confirm the shared @renewal or @promo After hook still leaves the site clean.
  3. Negative check: run the new scenarios against a build without #9098 (wp-rocket develop). The title and body assertions must fail; the expired-banner presence assertions should still pass.

Acceptance criteria covered:

  1. Renew banner title and body are validated for single, plus, multi_50, multi_100 and multi_500, for expiring soon and expired.
  2. Grandfathered Plus (creation date in 2020) expiring soon and expired cases exist.
  3. Expired license (2 days ago) cases exist with OCD enabled and disabled.

Affected Features & Quality Assurance Scope

  • src/features/notices/renewal-notice.feature (@renewal): new text assertions in the two existing outlines, a grandfather outline, and two OCD scenarios.
  • src/support/steps/renewal-notice.ts: new banner title/message/price/date steps; expired banner is displayed no longer asserts the old title literal.
  • Renewal banners in the WP Rocket dashboard (standard, OCD and OCD-disabled expired banners).
  • Shared After hook for @renewal or @promo (reused, not changed).
  • Test helper plugin (outside this repo): new created_in_2020 creation-date option.

Technical description

Documentation

No developer docs changed. The feature file keeps its tags and Background; wording lives in the feature file, so a wording change is a data-only edit. New and changed steps in src/support/steps/renewal-notice.ts (JSDoc on each, locators kept as module constants in that file):

  • license was created in {string}: selects the helper option created_in_<year>.
  • Optimize CSS Delivery is {string} ("enabled" or "disabled"): opens the File Optimization tab and asserts the saved checkbox state. Used in the two OCD scenarios (one added line each, after turn on 'RUCSS' for ON and explicit for OFF) so a silent no-op toggle fails clearly.
  • renew banner title is {string}: exact title text.
  • renew banner message contains {string} / does not contain {string}: scoped to the message paragraphs (.rocket-renew-message p, .rocket-expired-message p), never the title.
  • renew banner shows the renewal price: amount in $, € or £ followed by "(excl. taxes)", scoped to the message paragraphs.
  • renew banner shows a date 12 to 14 days from today: parsed date must be 12 to 14 days after today (UTC); only F j, Y and Y-m-d are parsed, otherwise it fails with an explicit message.
  • expired banner is displayed now only asserts that #rocket-renewal-banner is visible (the title is asserted by renew banner title is).

Deviations from the spec's Proposed Scenarios: the date step is a 12 to 14 day window instead of "13 days from today" (site timezone and date format); message steps target the p elements because the expiring-soon title sits inside .rocket-renew-message; the two Optimize CSS Delivery is lines were added (challenger guidance); double blank lines between scenarios were collapsed.

Reused steps: {string} license is active, auto renew is disabled, license is {string} (just_expired), turn on {string} (RUCSS), plugin is installed, plugin is activated, expiring soon banner is displayed.

New dependencies

None in this repo. Cross-repo prerequisite: the test helper plugin option created_in_2020 (see Description).

Risks

  • Wording and price format depend on wp-rocket#9098, which is still open with changes requested. Any wording change there requires an update to the feature file.
  • The expiring-soon banner is assumed to render the price in its message paragraph, as in #9098.
  • The date step parses only F j, Y and Y-m-d; the 12 to 14 day window absorbs the site timezone offset.
  • The grandfather scenario only proves the absence of the legacy "discount" wording, not the grandfather pricing logic.
  • The grandfather scenarios depend on the helper option, which lives in another repo and is only available after its PR is merged and the environment snapshot is refreshed.
  • Unverified until the first real run: the @renewal After hook resets the helper overrides, and the default site creation date is not grandfathered (otherwise the baseline outlines also need creation date is old).
  • Against wp-rocket develop, the new text assertions fail by design until #9098 is in the tested build.

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Unticked items justification

No real run has been done yet: the target hostname has not been confirmed free, so the scenarios have not been executed against a live site. Only static checks (lint, tsc --noEmit, and a Cucumber dry run) have been performed. The Code validation items stay unticked until the real run and the negative check above are done. Code style items are left unticked for reviewer confirmation.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

🤖 Generated with Claude Code

…ners

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Mai-Saad Mai-Saad added the Made by AI Created or assisted by an AI agent label Oct 26, 2026
@Mai-Saad Mai-Saad self-assigned this Oct 26, 2026
Comment thread src/support/steps/renewal-notice.ts Outdated
Comment thread src/support/steps/renewal-notice.ts Outdated
@Mai-Saad

Mai-Saad commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Note

Generated by the AI delivery pipeline (lead-reviewer · Claude Sonnet 5.5).

Review: ✅ PASS (re-review of 1dcd621)

Previous 3 MEDIUM blockers resolved: message steps are scoped to .rocket-renew-message p, .rocket-expired-message p (title excluded; structure checked against the renewal view templates), the OCD date step asserts a 12 to 14 day UTC window (matches expiration + 15 days with just_expired), and the PR body now matches the diff. --dry-run --tags "@renewal": 14 scenarios, 173 steps, no undefined or ambiguous steps (whole-suite dry-run also clean). Lint errors are only in the gitignored config/wp.config.ts. No real run was done (QA is running in parallel).

Nice-to-haves:

  • src/support/steps/renewal-notice.ts — the date step docblock says other date formats fail "with an explicit message"; they actually fail on the toHaveCount mismatch. Reword the docblock.
  • src/support/steps/renewal-notice.ts — Optimize CSS Delivery is is an assertion registered as When; consider Then wording later (no functional impact).
  • First real run: confirm the default creation date is not grandfathered, that the price regex matches the real format, and run the negative check against develop.

Not blocking, documented in the PR: wording depends on open wp-rocket#9098; the created_in_2020 helper option lives in another repo and must be merged and the snapshot refreshed before merge.

…d the date

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Mai-Saad

Copy link
Copy Markdown
Contributor Author

Note

Generated by the AI delivery pipeline (qa-engineer · Claude Sonnet 5.5).

QA: ⚠️ PARTIAL (execution not run, no behavioral proof yet)

Acceptance Criterion Method Result Why
Banner title and body validated for single/plus/multi50/100/500, expiring soon and expired Dry-run + analysis ⚠️ CANNOT_VERIFY Steps and Examples resolve (dry-run: 18 @renewal/@promo scenarios, 0 undefined or ambiguous steps), but nothing was run on a site. The configured target mai.e2e is not the host confirmed free for this run (mai2.e2e), and config/wp.config.ts must not be edited.
Grandfathered Plus (created 2020) expiring soon and expired exist and pass Dry-run + analysis ⚠️ CANNOT_VERIFY Both Examples rows exist. Not run (same guard). Also needs helper option created_in_2020 in wp-rocket-e2e-test-helper, which is not confirmed.
Expired-2-days-ago with OCD enabled and disabled exist and pass Dry-run + analysis ⚠️ CANNOT_VERIFY Both scenarios exist. Not run (same guard).

Blockers:

  • Execution: WP_BASE_URL and WP_SSH_ROOT_DIR in config/wp.config.ts point at mai.e2e, not mai2.e2e. Re-run once the config targets the confirmed site (or the user confirms mai.e2e is free), with E2E_WPR_NEW_REF=branch:fix/9095-renewal-promo-banners-align.
  • Grandfather scenarios need created_in_2020 in the helper plugin.

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

Labels

Made by AI Created or assisted by an AI agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Renew banner text validation

1 participant