Skip to content

CONSOLE-5245: Install and configure eslint-plugin-playwright for e2e directory#16433

Open
fsgreco wants to merge 1 commit into
openshift:mainfrom
fsgreco:CONSOLE-5245--main-branch--install-eslint-playwright
Open

CONSOLE-5245: Install and configure eslint-plugin-playwright for e2e directory#16433
fsgreco wants to merge 1 commit into
openshift:mainfrom
fsgreco:CONSOLE-5245--main-branch--install-eslint-playwright

Conversation

@fsgreco
Copy link
Copy Markdown
Contributor

@fsgreco fsgreco commented May 12, 2026

Analysis:
CONSOLE-5245 — The e2e directory had no Playwright-specific ESLint rules. Playwright best practices (no force
clicks, no hardcoded waits, expect assertions) were not enforced.

Solution description:

  • Install eslint-plugin-playwright in eslint-plugin-console and register a new playwright config
  • Create a dedicated e2e/.eslintrc.js extending plugin:console/playwright, replacing the override block previously in the root .eslintrc.js
  • Add targeted overrides for e2e/setup/** files where three rules produce false positives: expect-expect, no-skipped-test, and no-conditional-in-test — setup
    files handle auth/cluster config, not test assertions
  • Add inline disable comments in base-page.ts for two intentional rule violations (no-force-option, no-wait-for-timeout)

Test setup:

cd frontend && yarn install

Test cases:

  • yarn eslint e2e/ runs with no errors
  • Playwright rules are scoped to e2e/ only — no impact on the rest of the frontend
  • Existing e2e tests pass lint

Additional info:
Follows the same pattern as the Cypress integration tests (packages/integration-tests/.eslintrc), which have their own ESLint config scoped to their test
environment, setup file add few overrides only for setup/**/*.ts files only:

  • playwright/expect-expect — setup files perform auth/config, not assertions
  • playwright/no-skipped-test — conditional skips based on environment are intentional in setup
  • playwright/no-conditional-in-test — setup/teardown logic legitimately branches on cluster state

Summary by CodeRabbit

  • Chores
    • Restructured ESLint configuration by creating dedicated settings for e2e tests.
    • Added Playwright ESLint plugin with recommended linting rules for e2e testing.
    • Updated project dependencies to include Playwright linting support.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 12, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 12, 2026

@fsgreco: This pull request references CONSOLE-5245 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Analysis / Root cause:
CONSOLE-5245 — The e2e directory had no Playwright-specific ESLint rules. Playwright best practices (no force
clicks, no hardcoded waits, expect assertions) were not enforced.

Solution description:

  • Install eslint-plugin-playwright in eslint-plugin-console and register a new playwright config
  • Create a dedicated e2e/.eslintrc.js extending plugin:console/playwright, replacing the override block previously in the root .eslintrc.js
  • Add targeted overrides for e2e/setup/** files where three rules produce false positives: expect-expect, no-skipped-test, and no-conditional-in-test — setup
    files handle auth/cluster config, not test assertions
  • Add inline disable comments in base-page.ts for two intentional rule violations (no-force-option, no-wait-for-timeout)

Test setup:

cd frontend && yarn install

Test cases:

  • yarn eslint e2e/ runs with no errors
  • Playwright rules are scoped to e2e/ only — no impact on the rest of the frontend
  • Existing e2e tests pass lint

Additional info:
Follows the same pattern as the Cypress integration tests (packages/integration-tests/.eslintrc), which have their own ESLint config scoped to their test
environment, setup file add few overrides only for setup/**/*.ts files only:

  • playwright/expect-expect — setup files perform auth/config, not assertions
  • playwright/no-skipped-test — conditional skips based on environment are intentional in setup
  • playwright/no-conditional-in-test — setup/teardown logic legitimately branches on cluster state

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from cajieh and stefanonardo May 12, 2026 13:26
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

This change refactors ESLint configuration for end-to-end tests by migrating from inline rule overrides to a dedicated Playwright-aware configuration setup. The frontend/.eslintrc.js removes the overrides block for e2e files. A new frontend/e2e/.eslintrc.js is created with Playwright-specific rules and configurations. The custom ESLint plugin is extended to export a playwright configuration preset that enables the eslint-plugin-playwright package. Inline ESLint disable comments are added to specific test methods that intentionally use Playwright patterns like forced clicks and timeouts. The eslint-plugin-playwright package is added as a dependency.

Suggested reviewers

  • rhamilto
  • stefanonardo
  • spadgett
🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: installing and configuring eslint-plugin-playwright for the e2e directory, directly matching the pull request's core objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Check not applicable. PR contains only frontend ESLint/Playwright configs and TypeScript—no Go/Ginkgo tests. Custom check targets Go test naming, not JavaScript frontend files.
Test Structure And Quality ✅ Passed Custom check for Ginkgo test structure is not applicable. This PR modifies only frontend ESLint configuration and Playwright setup files—no Go Ginkgo tests are present.
Microshift Test Compatibility ✅ Passed MicroShift test compatibility check is not applicable. This PR adds ESLint Playwright configuration only; it does not introduce any new Ginkgo e2e tests (It(), Describe(), Context(), When() calls).
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests added. PR modifies frontend ESLint config and Playwright infrastructure only. SNO compatibility check applies to Ginkgo tests, not Playwright browser tests.
Topology-Aware Scheduling Compatibility ✅ Passed Custom check is inapplicable. PR modifies frontend ESLint tooling only—no deployment manifests, operator code, controllers, or scheduling constraints present.
Ote Binary Stdout Contract ✅ Passed OTE Binary Stdout Contract is not applicable. PR modifies only frontend ESLint configs and TypeScript/JavaScript files, not Go binaries or test infrastructure.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Custom check not applicable. PR contains only frontend ESLint configuration and Playwright test changes (TypeScript/JavaScript), with no Ginkgo e2e tests (Go) that require IPv6 validation.
Description check ✅ Passed PR description comprehensively addresses the template with clear analysis, solution details, test setup, test cases, and additional context about the architectural pattern.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Comment thread frontend/e2e/.eslintrc.js
@stefanonardo
Copy link
Copy Markdown
Contributor

/verified by @stefanonardo

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 14, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@stefanonardo: This PR has been marked as verified by @stefanonardo.

Details

In response to this:

/verified by @stefanonardo

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Comment thread frontend/e2e/.eslintrc.js Outdated
Comment thread frontend/e2e/.eslintrc.js Outdated
Copy link
Copy Markdown
Contributor

@Cragsmann Cragsmann left a comment

Choose a reason for hiding this comment

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

Can you add please "testing-library/prefer-screen-queries": "off" it throws falls errors

@fsgreco fsgreco force-pushed the CONSOLE-5245--main-branch--install-eslint-playwright branch from 2e66bb2 to 86afff2 Compare May 14, 2026 14:08
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label May 14, 2026
@cajieh
Copy link
Copy Markdown
Contributor

cajieh commented May 14, 2026

Can you add please "testing-library/prefer-screen-queries": "off" it throws falls errors

Or exclude e2e from the testing-library override in testing-library-tests.js:
files: something like: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], ignorePatterns: ['e2e/**']

@fsgreco
Copy link
Copy Markdown
Contributor Author

fsgreco commented May 14, 2026

Can you add please "testing-library/prefer-screen-queries": "off" it throws falls errors

no problem to add it, although just for curiosity are you running lint from a clean state? (yarn install + yarn eslint e2e/). It's curious it's happening since I set root: true in e2e/.eslintrc.js, that should prevent parent configs from leaking in (or in other words eslint should stops searching upward to other config files).

@fsgreco
Copy link
Copy Markdown
Contributor Author

fsgreco commented May 14, 2026

Can you add please "testing-library/prefer-screen-queries": "off" it throws falls errors

Or exclude e2e from the testing-library override in testing-library-tests.js: files: something like: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], ignorePatterns: ['e2e/**']

oh I get it why it happens now, yes I would go with this one indeed, so we have a better separation of concerns, right?

…te dependencies

Add eslint-plugin-playwright to eslint-plugin-console and create a dedicated .eslintrc.js for e2e/ to scope Playwright rules away from the rest of the frontend codebase. Setup files (auth, cluster, teardown) obtain overrides for rules that don't apply to non-assertion setup logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fsgreco fsgreco force-pushed the CONSOLE-5245--main-branch--install-eslint-playwright branch from 86afff2 to d86412c Compare May 14, 2026 16:02
@fsgreco
Copy link
Copy Markdown
Contributor Author

fsgreco commented May 14, 2026

@Cragsmann I've applied the solution suggested by @cajieh, the falls errors should be gone, can you confirm?

@stefanonardo
Copy link
Copy Markdown
Contributor

/lgtm
/verified by @stefanonardo

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@stefanonardo: This PR has been marked as verified by @stefanonardo.

Details

In response to this:

/lgtm
/verified by @stefanonardo

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2026
Copy link
Copy Markdown
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 15, 2026
@logonoff
Copy link
Copy Markdown
Member

/label px-approved
/label docs-approved

@openshift-ci openshift-ci Bot added the px-approved Signifies that Product Support has signed off on this PR label May 15, 2026
@openshift-ci openshift-ci Bot added the docs-approved Signifies that Docs has signed off on this PR label May 15, 2026
@Cragsmann
Copy link
Copy Markdown
Contributor

@Cragsmann I've applied the solution suggested by @cajieh, the falls errors should be gone, can you confirm?
Works fine

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cragsmann, fsgreco, logonoff, stefanonardo, vikram-raj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD ee38b13 and 2 for PR HEAD d86412c in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

@fsgreco: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/frontend d86412c link true /test frontend
ci/prow/e2e-gcp-console d86412c link unknown /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@logonoff
Copy link
Copy Markdown
Member

/hold

frontend job failure is legitimate

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants