Skip to content

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

Open
@benatshippabo

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:

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',
];

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions