[Feature] add `locator.waitForTransition()`
See original GitHub issueI’d like to test computedStyles
and visibility after some CSS transition (triggered by user input) finishes. From https://github.com/microsoft/playwright/issues/4055, it seems this is a common but unsupported use case.
const dropdown = await page.locator('.dropdown').
closeDropdown()
await dropdown.waitForTransition() // waitForElementState('stable') doesn't work if the element stays in place
expect(dropdown).toBeHidden()
Issue Analytics
- State:
- Created a year ago
- Reactions:18
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Create a feature locator—ArcGIS Pro | Documentation
You can use this tool to build a locator to search names and unique attributes of your features, such as water meters; short...
Read more >Wait for transition to end in puppeteer - Stack Overflow
I think I need to wait on the transitionend event, but I'm unsure of how to do that in Puppeteer. Any help would...
Read more >Options - Splide
Determines whether to add the is-active class to clones. focus. Determines which slide should be active if there are multiple slides in a...
Read more >Swiper API
If true , then active slide will be centered without adding gaps at the ... If disabled, then you need to init it...
Read more >webdriverio/webdriverio - Gitter
@benzaremean I'm trying to achieve a wait for transition command with waitForTransition :) I don't love the idea of just using browser.pause() when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can probably use getAnimations and check if all/some of the animations have finished. Something like this:
Will that work for you?
Wonderful, that does exactly what I need!
I use it in several places so wrapped it in a
waitForAnimationEnd
helper function:Would it make sense to have a
waitForAnimationEnd
method in@playwright/test
?