Skip to content

Update missing-playwright-await rule to warn about unnecessary awaits #70

Closed
@AlexDaniel

Description

@AlexDaniel

Bad:

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.

Good:

await expect(page.locator('.hello-world')).toBeVisible()

or

await page.locator('.hello-world').waitFor()

or anything else, as long as you actually use the locator for something.

Metadata

Metadata

Assignees

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