eslint-plugin-playwright
eslint-plugin-playwright copied to clipboard
ESLint plugin for Playwright
We're establishing coding practices for our e2e suite before opening it up to the public. Generally, we're looking to *enforce* these code practices wherever possible _and would likely need most...
It would be great to have a rule to enforce expect.soft assertions. I've found that they've been a great way to isolate failure in tests but find it difficult to...
Bad: ```js await page.locator('.hello-world') ``` The code above is wrong because it doesn't do anything. We just await a locator and then throw it away, but that doesn't test anything....
See here: https://github.com/microsoft/playwright/issues/9474
Having the following block produce a missing-playwright-await error  ``` await Promise.all([ expect(previewLessonPage.relatedContent.title).toBeHidden(), expect(previewLessonPage.relatedContent.items).toHaveCount(0), ]); ``` Those cases should not produce errors considering that we're handling them into a Promise...
I would love to have a new optional rule where I could enforce tests having the new tag configuration, maybe even having including a `tagMustMatch` option (same as in `playwright/valid-title`).
Example [from the docs](https://playwright.dev/docs/auth#basic-shared-account-in-all-tests): ```ts import { test as setup, expect } from '@playwright/test'; setup('authenticate', async ({ page }) => { // ... }); ``` Expected: no warning Actual: "This...
In order to make tests less flaky, any call to page.waitForResponse should be wrapped in a promise.all of the action which invoked the network response. More here: https://github.com/microsoft/playwright/issues/5470#issuecomment-1285640689
## Suggestion We should add additional functions to check if they are being awaited on. Currently we only check expect and test matchers, but none of the [page actions](https://playwright.dev/docs/api/class-page) or...