Skip to content

Rule suggestion - prefer toBeHidden #53

Closed
@igorTT

Description

@igorTT

Hi. What do you think about an optional rule 'prefer-to-be-hidden'?
https://playwright.dev/docs/1.21/test-assertions#locator-assertions-to-be-hidden

❌ Example of incorrect code for this rule:

const locator = page.locator('.my-element');
await expect(locator).not.toBeVisible();

✅ Example of correct code for this rule:

const locator = page.locator('.my-element');
await expect(locator).toBeHidden();

Metadata

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