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

Please support SPAs and JavaScript heavy applications by allowing PageElements and MultiPageElements to be marked as dynamic #7

Open
danizen opened this issue Oct 24, 2017 · 4 comments

Comments

@danizen
Copy link

danizen commented Oct 24, 2017

I have an abstraction I've used a lot with Java, where my page objects wait for the visibility of elements that I know to be dynamic. I've even made that the default. Eventually, I need to support similar capabilities in Python. Can a PageElement be asynchronous?

@danizen danizen changed the title Question - what about SPAs and webdriver wait? Please support SPAs and JavaScript heavy applications by allowing PageElements and MultiPageElements to be marked as dynamic Oct 24, 2017
@danizen
Copy link
Author

danizen commented Oct 24, 2017

Having looked at the code, I can see that one way to do this would be to add an element to my PageObject that is specially marked as the indicator that the page is ready. Then calling, "page.wait()" would wait for that element. For now, I'll go with that idiom, and build a subclass of PageObject, AsyncPageObject, with a default implementation of wait which looks for a an element called "pageready", and waits for it if it is present, taking an optional timeout.

@frankvu191
Copy link

hi,
Any update for pageready?
Kind regards,
Frank Vu

@danizen
Copy link
Author

danizen commented Mar 2, 2018

I'm not a committer on page-objects, but I'll hit you within Gist of a way to do this today.

@danizen
Copy link
Author

danizen commented Dec 2, 2019

Here is a Gist indicating how to do this - sorry it took so long - https://gist.github.com/danizen/d6f557456d458a13afb6c879583fe0b2

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

No branches or pull requests

2 participants