Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add eslint-plugin-playwright rules for e2e tests and fix errors #2680

Merged
merged 4 commits into from
Feb 12, 2025

Conversation

hashicc
Copy link
Collaborator

@hashicc hashicc commented Feb 3, 2025

Description

This prs adds the eslint-plugin-playwright eslint rule with the recommended rules applied.

There are 110 new warnings reported, most of which are either:

  • Avoid having conditionals in tests (playwright/no-conditional-in-test)
  • Test has no assertions (playwright/expect-expect)

We could:

  1. leave these warnings
  2. ignore them individually
  3. ignore them globally within our eslint config

I think these are good warnings to have though so I'd recommend either option 1. or 2.

How to Test

  1. Add an async to a describe block callback
  2. Error should be reported by yarn lint and/or within the editor

Checklist

- [ ] I have added before and after screenshots for UI changes
- [ ] I have added JSON response output for API changes
- [ ] I have added steps to reproduce and test for bug fixes in the description
- [ ] I have commented on my code, particularly in hard-to-understand areas

  • My changes generate no new warnings
    - [ ] I have added tests that prove my fix is effective or that my feature works

Copy link

vercel bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boundary-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 4:09pm
boundary-ui-desktop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 4:09pm

@hashicc hashicc changed the title 🛑 DO NOT MERGE chore: add eslint-plugin-playwright rule for e2e tests and fix errors 🛑 DO NOT MERGE chore: add eslint-plugin-playwright rules for e2e tests and fix errors Feb 4, 2025
@hashicc hashicc changed the title 🛑 DO NOT MERGE chore: add eslint-plugin-playwright rules for e2e tests and fix errors chore: add eslint-plugin-playwright rules for e2e tests and fix errors Feb 11, 2025
@hashicc hashicc marked this pull request as ready for review February 11, 2025 19:05
@hashicc hashicc requested a review from a team as a code owner February 11, 2025 19:05
Copy link
Collaborator

@ZedLi ZedLi left a comment

Choose a reason for hiding this comment

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

Great find, love to see more automated linting

Copy link
Collaborator

@DhariniJeeva DhariniJeeva left a comment

Choose a reason for hiding this comment

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

thanks for adding this!

@calcaide
Copy link
Collaborator

None blocking comment:

When running yarn lint within boundary-ui/e2e-tests/ I am getting errors within e2e-tests/playwright-report. Do we need to exclude the directory playwrght-report/ from the linting?

Copy link
Collaborator

@calcaide calcaide left a comment

Choose a reason for hiding this comment

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

Thanks for this addition!! 🙌

@hashicc hashicc merged commit 4ca519c into main Feb 12, 2025
19 checks passed
@hashicc hashicc deleted the hashicc/eslint-playwright branch February 12, 2025 17:39
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.

5 participants