-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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:
eslint-plugin-playwright/src/rules/missing-playwright-await.ts
Lines 11 to 58 in f3cfc99
const validTypes = new Set([ | |
'AwaitExpression', | |
'ReturnStatement', | |
'ArrowFunctionExpression', | |
]); | |
const expectPlaywrightMatchers = [ | |
'toBeChecked', | |
'toBeDisabled', | |
'toBeEnabled', | |
'toEqualText', // deprecated | |
'toEqualUrl', | |
'toEqualValue', | |
'toHaveFocus', | |
'toHaveSelector', | |
'toHaveSelectorCount', | |
'toHaveText', // deprecated | |
'toMatchAttribute', | |
'toMatchComputedStyle', | |
'toMatchText', | |
'toMatchTitle', | |
'toMatchURL', | |
'toMatchValue', | |
]; | |
const playwrightTestMatchers = [ | |
'toBeChecked', | |
'toBeDisabled', | |
'toBeEditable', | |
'toBeEmpty', | |
'toBeEnabled', | |
'toBeFocused', | |
'toBeHidden', | |
'toBeVisible', | |
'toContainText', | |
'toHaveAttribute', | |
'toHaveClass', | |
'toHaveCount', | |
'toHaveCSS', | |
'toHaveId', | |
'toHaveJSProperty', | |
'toBeOK', | |
'toHaveScreenshot', | |
'toHaveText', | |
'toHaveTitle', | |
'toHaveURL', | |
'toHaveValue', | |
]; |
TroyBallinger, 2Fake, revelt, qakos, daenamkim and 3 more
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
revelt commentedon Oct 12, 2023
just to add 2p, for example, currently, this missing
page
await
is not flagged up:missing-playwright-await
) #310