Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule suggestion - warn when custom error message is missing in expect function #51

Closed
MindaugasMateika opened this issue May 2, 2022 · 2 comments · Fixed by #82
Closed
Assignees
Labels
enhancement New feature or request

Comments

@MindaugasMateika
Copy link

MindaugasMateika commented May 2, 2022

What do you think about the rule which should warn about missing custom error messages? I'm not very familiar with rule creation and what rules are ok/not ok so just putting it as a suggestion now.

Docs: https://playwright.dev/docs/test-assertions#custom-expect-message

+ Good
await expect(page.locator('text=Name'), 'should be logged in').toBeVisible()
- Bad
await expect(page.locator('text=Name')).toBeVisible()
+ Good
await expect.soft(page.locator('text=Name'), 'should be logged in').toBeVisible()
- Bad
await expect.soft(page.locator('text=Name')).toBeVisible()
@mskelton
Copy link
Member

mskelton commented May 2, 2022

I'm totally fine with this as a rule, so long as it is not enabled by default.

@mxschmitt
Copy link
Collaborator

+1 like @mskelton said.

@mxschmitt mxschmitt added the enhancement New feature or request label May 17, 2022
@mskelton mskelton self-assigned this Aug 21, 2022
@mskelton mskelton mentioned this issue Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants