page-objects icon indicating copy to clipboard operation
page-objects copied to clipboard

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

Open danizen opened this issue 8 years ago • 4 comments

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 avatar Oct 24 '17 17:10 danizen

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.

danizen avatar Oct 24 '17 17:10 danizen

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

frankvu191 avatar Mar 02 '18 03:03 frankvu191

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

danizen avatar Mar 02 '18 17:03 danizen

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

danizen avatar Dec 02 '19 20:12 danizen