Skip to content

Conversation

@cmraible
Copy link
Collaborator

@cmraible cmraible commented Nov 4, 2025

no issue

This PR does two things in the e2e package:

  • Installs and enables eslint-plugin-playwright for our e2e test suite using the recommended configuration
  • Disables mocha rules from the main ghost eslint plugin in the e2e package, which just create noise currently

Note: If you run yarn lint in the e2e package in this PR, you'll see a bunch of warnings. I'd like to tackle some of these in follow up PRs, and potentially change a few rules from "warn" to "error" for the more impactful ones.


Note

Enables eslint-plugin-playwright with recommended config for e2e and disables Mocha-specific rules; adds the Playwright ESLint plugin dependency.

  • Linting/Config:
    • Add playwright plugin and apply plugin:playwright/recommended in e2e/.eslintrc.js for tests/**, helpers/playwright/**, and helpers/pages/**.
    • Disable all ghost/mocha/* rules in e2e/tests/.eslintrc.js to avoid Mocha-specific linting in Playwright tests.
  • Dependencies:
    • Add eslint-plugin-playwright to e2e/package.json and update yarn.lock.

Written by Cursor Bugbot for commit ecc930a. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The PR updates the e2e testing configuration to add Playwright ESLint support and related dev dependencies. e2e/.eslintrc.js adds the eslint-plugin-playwright and an overrides block applying plugin:playwright/recommended to test-related paths. e2e/package.json adds devDependencies (@tryghost/debug, @tryghost/logging, @types/dockerode, eslint-plugin-playwright). e2e/tests/.eslintrc.js replaces a single no-console disable with a block that disables many Mocha/Ghost-specific rules and adds a comment noting Playwright is used instead.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify the overrides paths in e2e/.eslintrc.js match actual test directories (tests/**, helpers/playwright/**, helpers/pages/**).
  • Confirm the long list of disabled Mocha/Ghost rules in e2e/tests/.eslintrc.js is intentional and doesn’t unintentionally silence needed checks.
  • Review added devDependencies in e2e/package.json for correct versions, duplicates, and necessity in the e2e environment.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding eslint-plugin-playwright linting to the e2e package, which is the primary focus of the changeset.
Description check ✅ Passed The description clearly explains the two main changes (installing eslint-plugin-playwright and disabling mocha rules) and provides context about follow-up plans, directly relating to the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch e2e-playwright-lint

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 203fd35 and ecc930a.

📒 Files selected for processing (1)
  • e2e/.eslintrc.js (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to e2e/** : End-to-end tests should live under the e2e/ directory (Playwright-based)
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/comments-ui/.cursor/rules/playwright-e2e.mdc:0-0
Timestamp: 2025-07-19T21:18:10.726Z
Learning: Set PLAYWRIGHT_REPORTER=list environment variable before running Playwright e2e tests as an AI agent
Learnt from: niranjan-uma-shankar
Repo: TryGhost/Ghost PR: 24557
File: apps/admin-x-settings/src/components/settings/general/TimeZone.tsx:7-7
Timestamp: 2025-08-01T12:44:07.467Z
Learning: In Ghost development, PRs may depend on unpublished changes from SDK packages. When this occurs, TypeScript compilation errors for missing exports are expected and documented in the PR description until the dependency packages are published and updated. This is normal workflow for cross-repository feature development.
Learnt from: kevinansfield
Repo: TryGhost/Ghost PR: 24651
File: ghost/core/test/utils/urlUtils.js:53-57
Timestamp: 2025-08-11T19:39:00.428Z
Learning: In Ghost's test utilities, when fixing specific issues like async behavior, it's preferred to maintain existing error handling patterns (even if suboptimal) to keep PRs focused on their primary objective. Error handling improvements can be addressed in separate, dedicated PRs.
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/**/*.ts : Test suite titles should follow: 'Ghost Admin - Feature' or 'Ghost Public - Feature'
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/public/**/*.ts : Public site end-to-end tests should reside under tests/public/
📚 Learning: 2025-10-09T17:25:12.439Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to e2e/** : End-to-end tests should live under the e2e/ directory (Playwright-based)

Applied to files:

  • e2e/.eslintrc.js
📚 Learning: 2025-07-19T21:18:10.726Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/comments-ui/.cursor/rules/playwright-e2e.mdc:0-0
Timestamp: 2025-07-19T21:18:10.726Z
Learning: Set PLAYWRIGHT_REPORTER=list environment variable before running Playwright e2e tests as an AI agent

Applied to files:

  • e2e/.eslintrc.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Acceptance tests (Node 22.13.1, sqlite3)
  • GitHub Check: Signup-form tests
  • GitHub Check: Admin-X Settings tests
  • GitHub Check: Legacy tests (Node 22.13.1, sqlite3)
  • GitHub Check: Acceptance tests (Node 22.13.1, mysql8)
  • GitHub Check: Legacy tests (Node 22.13.1, mysql8)
  • GitHub Check: Unit tests (Node 22.13.1)
  • GitHub Check: Ghost-CLI tests
  • GitHub Check: Admin tests - Chrome
  • GitHub Check: ActivityPub tests
  • GitHub Check: Comments-UI tests
  • GitHub Check: Lint
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Build & Push
🔇 Additional comments (2)
e2e/.eslintrc.js (2)

3-6: LGTM! Plugin registration is correct.

The plugin is correctly registered using the short name 'playwright', which is the proper ESLint convention and matches the usage in the overrides block (plugin:playwright/recommended).

Note: The past review comment about plugin name mismatch appears to have been resolved.


17-22: LGTM! Overrides configuration is well-structured.

The overrides block correctly applies Playwright's recommended rules to the appropriate test-related paths. The targeted paths (tests/**, helpers/playwright/**, helpers/pages/**) align well with a Playwright test suite structure.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cmraible cmraible mentioned this pull request Nov 4, 2025
3 tasks
@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.10%. Comparing base (40d390a) to head (ecc930a).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25344      +/-   ##
==========================================
+ Coverage   72.08%   72.10%   +0.01%     
==========================================
  Files        1515     1515              
  Lines      115137   115104      -33     
  Branches    13791    13781      -10     
==========================================
- Hits        83002    82995       -7     
+ Misses      31119    31114       -5     
+ Partials     1016      995      -21     
Flag Coverage Δ
admin-tests 51.53% <ø> (+0.06%) ⬆️
e2e-tests 72.10% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cmraible cmraible marked this pull request as ready for review November 4, 2025 17:52
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
e2e/.eslintrc.js (1)

3-6: Consider using the conventional short form for the plugin name.

While 'eslint-plugin-playwright' works, ESLint convention is to use the short form 'playwright' when the plugin package is named eslint-plugin-playwright.

Apply this diff for consistency with ESLint conventions:

     plugins: [
         'ghost',
-        'eslint-plugin-playwright'
+        'playwright'
     ],
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebb0ba2 and 203fd35.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • e2e/.eslintrc.js (1 hunks)
  • e2e/package.json (1 hunks)
  • e2e/tests/.eslintrc.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

End-to-end tests should live under the e2e/ directory (Playwright-based)

Files:

  • e2e/package.json
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to e2e/** : End-to-end tests should live under the e2e/ directory (Playwright-based)
Learnt from: kevinansfield
Repo: TryGhost/Ghost PR: 24651
File: ghost/core/test/utils/urlUtils.js:53-57
Timestamp: 2025-08-11T19:39:00.428Z
Learning: In Ghost's test utilities, when fixing specific issues like async behavior, it's preferred to maintain existing error handling patterns (even if suboptimal) to keep PRs focused on their primary objective. Error handling improvements can be addressed in separate, dedicated PRs.
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-10-15T07:53:49.814Z
Learning: Run yarn lint, yarn test, and validate in Storybook before opening a PR; always run yarn lint to fix ESLint issues before committing
📚 Learning: 2025-10-09T17:25:12.439Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to e2e/** : End-to-end tests should live under the e2e/ directory (Playwright-based)

Applied to files:

  • e2e/tests/.eslintrc.js
  • e2e/.eslintrc.js
📚 Learning: 2025-08-11T19:39:00.428Z
Learnt from: kevinansfield
Repo: TryGhost/Ghost PR: 24651
File: ghost/core/test/utils/urlUtils.js:53-57
Timestamp: 2025-08-11T19:39:00.428Z
Learning: In Ghost's test utilities, when fixing specific issues like async behavior, it's preferred to maintain existing error handling patterns (even if suboptimal) to keep PRs focused on their primary objective. Error handling improvements can be addressed in separate, dedicated PRs.

Applied to files:

  • e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/**/*.ts : Test suite titles should follow: 'Ghost Admin - Feature' or 'Ghost Public - Feature'

Applied to files:

  • e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/**/*.ts : Follow ADR-0001 (AAA pattern) in all test files

Applied to files:

  • e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/{tests,helpers/pages}/**/*.ts : Use only semantic locators (getByRole/getByLabel/getByText); fallback to data-testid; never use CSS/XPath/nth-child/class names

Applied to files:

  • e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: After changes, run `yarn lint` and `yarn test:types`

Applied to files:

  • e2e/tests/.eslintrc.js
  • e2e/package.json
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/**/*.ts : Keep all assertions in test files (not in page objects)

Applied to files:

  • e2e/tests/.eslintrc.js
📚 Learning: 2025-10-15T07:53:49.814Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-10-15T07:53:49.814Z
Learning: Applies to apps/shade/test/unit/**/*.test.@(ts|tsx|js) : Unit tests live under test/unit with *.test.(ts|tsx|js) naming

Applied to files:

  • e2e/tests/.eslintrc.js
📚 Learning: 2025-08-01T12:44:07.467Z
Learnt from: niranjan-uma-shankar
Repo: TryGhost/Ghost PR: 24557
File: apps/admin-x-settings/src/components/settings/general/TimeZone.tsx:7-7
Timestamp: 2025-08-01T12:44:07.467Z
Learning: In Ghost development, PRs may depend on unpublished changes from SDK packages. When this occurs, TypeScript compilation errors for missing exports are expected and documented in the PR description until the dependency packages are published and updated. This is normal workflow for cross-repository feature development.

Applied to files:

  • e2e/package.json
📚 Learning: 2025-08-26T16:47:28.150Z
Learnt from: troyciesco
Repo: TryGhost/Ghost PR: 24749
File: ghost/core/core/server/services/members/SingleUseTokenProvider.js:3-5
Timestamp: 2025-08-26T16:47:28.150Z
Learning: When checking for dependencies in Ghost project, ensure to look directly in the specific package.json files rather than relying only on automated searches, as otplib dependency exists at line 204 in ghost/core/package.json version "12.0.1"

Applied to files:

  • e2e/package.json
📚 Learning: 2025-08-12T18:33:15.524Z
Learnt from: cmraible
Repo: TryGhost/Ghost PR: 24658
File: ghost/admin/package.json:3-3
Timestamp: 2025-08-12T18:33:15.524Z
Learning: In Ghost's admin package.json, third-party packages like ember-cli-postcss, ember-exam, and ember-power-select have their own independent versioning schemes that are unrelated to Ghost's version numbers. Version number coincidences between Ghost versions and these packages should not trigger update suggestions.

Applied to files:

  • e2e/package.json
📚 Learning: 2025-10-09T17:25:12.439Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to ghost/core/config.development.json : Add Tinybird configuration to ghost/core/config.development.json for local development

Applied to files:

  • e2e/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (4)
e2e/package.json (2)

33-33: LGTM - eslint-plugin-playwright added as expected.

The addition of eslint-plugin-playwright aligns with the PR objectives to enable Playwright linting for the e2e test suite.


27-29: Dependencies are actively used throughout the e2e infrastructure.

Verification confirms all three dependencies are imported and utilized across multiple e2e helper files:

  • @tryghost/debug is used in 10 files for debug logging (baseDebug pattern)
  • @tryghost/logging is used in 7 e2e files for logging operations
  • @types/dockerode is needed for TypeScript types (Container, ContainerCreateOptions) imported in DockerCompose.ts, GhostManager.ts, and MySQLManager.ts

These additions are necessary for the e2e test infrastructure and are correctly included in the dependencies.

e2e/.eslintrc.js (1)

17-22: LGTM - overrides configuration is well-structured.

The overrides block correctly applies plugin:playwright/recommended to the appropriate test-related paths (tests, helpers/playwright, helpers/pages), which aligns with the PR objectives.

e2e/tests/.eslintrc.js (1)

8-29: LGTM - Mocha rules appropriately disabled for Playwright.

The comprehensive disabling of Mocha-specific rules makes sense since the e2e package uses Playwright instead of Mocha. The explanatory comment clearly documents the rationale, which will help future maintainers understand this configuration choice.

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