Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Page.WaitStable" helper #387

Open
ysmood opened this issue Apr 10, 2021 · 4 comments
Open

Add "Page.WaitStable" helper #387

ysmood opened this issue Apr 10, 2021 · 4 comments
Labels
discuss Need review and discussion

Comments

@ysmood
Copy link
Member

ysmood commented Apr 10, 2021

How it works is simple, polling the changes of the DOM tree, wait until the most of DOM tree doesn't change for some time, such as 95% and 300ms.

A similar function is Element.WaitStable.

@ysmood ysmood added the enhance New feature or request label Apr 10, 2021
@ysmood
Copy link
Member Author

ysmood commented Apr 10, 2021

@shuiRong What do you think about this? I feel I will be more useful than Page.WaitElementsMoreThan.

@ysmood
Copy link
Member Author

ysmood commented Apr 10, 2021

But it has a major issue. If a page has constant animation like a clock, this function will be useless. So we may have to add an option to use CSS selectors to ignore some areas.

Also, a page can use js to append elements after 10 seconds, which is impossible to detect automatically.

@ysmood ysmood added discuss Need review and discussion and removed enhance New feature or request labels Apr 10, 2021
@ysmood
Copy link
Member Author

ysmood commented Mar 10, 2022

For #556 we can use opencv to diff the image, such as when 95% is the same then we think the page is stable:

https://github.com/hybridgroup/gocv

https://stackoverflow.com/questions/27035672/cv-extract-differences-between-two-images

@moredure
Copy link
Contributor

moredure commented Aug 11, 2022

Would be cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Need review and discussion
Projects
None yet
Development

No branches or pull requests

2 participants