This thread is trying to answer question "Is there a way to check the visibility of a widget on a chromium browser when running automated tests?"
Hi, what do you mean with 'is getting blocked'? Do you see any error, which one exactly? Or what other symptom indicates to you that it's getting blocked?
And does it work as expected on a regular (non-Playwright) Chromium or Chrome browser?
If it's unclear to you what exactly is happening, have you tried recording a trace? https://playwright.dev/docs/trace-viewer-intro
Hi @refactoreric , I'm trying to locate this element which shows up as a small widget on the bottom right when browsing normally. This doesn't show up while running automated tests and I'm using .isVisisble() method to assert but it's failing since it can't find the element. However if I click on inspect element, the source is there. How can I verify this?
If you can identify the network call that loads this element, you can then wait for that request to return a success response. That way when you check for visibility, if the element has actually loaded your check will pass. If the network call doesn’t return a success response then throw an error before checking for visibility.
Also you can consider to use the auto-retrying assertions. They are intended for these kind of things. Pages that aren't immediately ready after loading. Nowadays many things load progressively even after the load event of the main page was emitted. https://playwright.dev/docs/test-assertions#auto-retrying-assertions
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].