mibutec / popperfw

Declarative PageObjects for Java
Apache License 2.0
3 stars 3 forks source link

[FEATURE] Post Action Waits #8

Open mibutec opened 7 years ago

mibutec commented 7 years ago

In some cases a test has to wait for some asycnronous things to happen after an action has been initiated (i.e. some Ajax request returns, or some asyncronous Swing event has been processed).

For now Popper supports this wait only before accessing some PO (i.e. creating a wait annotation used in cooperation with @Locator). A much more effective way would be to allow such waits after an asyncronous action was triggered.

A first solution would be to be able to annotate methods to be "Action methods". Whenever such a method returns, a user defined method is called, handling the potential asyncronous wait. This handling must be implemented for Element-methods and PO methods (default methods and normal methods).

Doing asyncronous waits whenever an action-annotated method is called might be overkill, since an Element might be reused, but the decision if an action-method results in asyncrounous calls is context-sensitive. I.e. the click-method of a button would be an action method. But some buttons trigger actions leading to asyncronous calls, some not.

So as an improvement you need an annotation on PO-definition layer if an element triggers asyncronous actions or not.