Rayrun
← Back to Discord Forum

toBeVisible question.

Apologies if this is a basic question guys but the toBeVisible() assertion gives me this error on my playwright project. Any idea why this could be happening?

image.png

This thread is trying to answer question "Why is the toBeVisible() assertion causing an error in the Playwright project?"

11 replies

Did you import "expect" from playwright?

@xkapsel

@.nando93 have you defined any custom assertions?

@stackfish no but I have a jest config file

image.png

this is for some unit tests i have in my util functions

to make sure the big non element interaction functions are tested

nvm I figured out the issue i was importing the locator and page apis from the playwright library

image.png

it fixed my issue when Imported everything from playwright test

@.nando93: Great solve mate! Thanks for sharing

Great solve mate! Thanks for sharing

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].