Rayrun
← Back to Discord Forum

How to wait for the popup closed event

rushabh.wadkarposted in #help-playwright
Open in Discord
rushabh.wadkar
rushabh.wadkar

We do have a button which basically opens a popup. Inside popup, user does some operations and submits data. Once the user clicks in submit button inside the popup, the popup is closed and the flow returns back to the parent window (url route happens)

I wanted to know how do I make sure that the pop up closed or not. Is there any event which I can tag onto or any alternative solution for this ? I need to just write a test case which waits and asserts that the popup closed and proceed to the next test case.

This thread is trying to answer question "How to wait for the popup closed event?"

5 replies

@rushabh.wadkar you can wait popup modal to be unhidden

rushabh.wadkar
rushabh.wadkar

And how do we do that?

rushabh.wadkar
rushabh.wadkar

Do you have a doc or a guide somewhere which I can refer ?

@rushabh.wadkar expect(selector).toBeHidden()

rushabh.wadkar
rushabh.wadkar

But this is browser opened popup and not modal

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].