eslint-plugin-playwright icon indicating copy to clipboard operation
eslint-plugin-playwright copied to clipboard

Feature request: check page and locator actions for `missing-playwright-await` rule

Open benatshippabo opened this issue 2 years ago • 1 comments
trafficstars

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 or locator actions:

https://github.com/playwright-community/eslint-plugin-playwright/blob/f3cfc99f4eaaf73b9936a80f17be95668ac2efc1/src/rules/missing-playwright-await.ts#L11-L58

benatshippabo avatar Jul 21 '23 18:07 benatshippabo

just to add 2p, for example, currently, this missing page await is not flagged up:

test('has title', async ({ page }) => {
  page.goto('https://playwright.dev/'); // await is missing!
// ^^^

  // Expect a title "to contain" a substring.
  await expect(page).toHaveTitle(/Playwright/);
});

revelt avatar Oct 12 '23 10:10 revelt