You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since `screen` has been replaced by `page` from Vitest, we need to adjust them.
78
76
79
-
Now that I know that `page.getBy*` functions return _locators_, they will always be truthy and so the `.toBeTruthhy()` assertion makes little sense here. It wasn't written from the user's perspective, to begin with, and it would be best to use a more fitting matcher like `.toBeVisible()`:
On its own, this is enough. But there's one more thing that can make these assertions stellar. I can use `expect.element()` instead of `expect()` to have a built-in retry for resolving the given locators:
85
+
There's one more thing we can do to make these assertions rock-solid. If we use `await expect.element()` instead of plain `expect()`, we can rely on Vitest's built-in retry mechanism when resolving the given locators;
0 commit comments