You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Web applications today are typically single url ones. So page objects are better representation of "tiles" on the same level of the webUI, instead of being actual pages: menu bar, status bar, editor area, ...
Let's say there is a tile with sub-tiles; just like here (https://github.com/serenity-bdd/serenity-core/issues) the tickets themselves. The "roots" of these tickets have unique xpaths, but under the located webelement(facade) they have similar structure: icon, title, opened-by, number of comments. Which cries for being represented with pageobjects.
Even if I think the answer is 'no', I still feel the urge to raise the question: Is there a way to initialize such sub-pageobjects from the parent pageobject? The happiest path would be providing parameters (like the xpath locator) to the constructor, and the rest would be done "on-demand" (upon invocation) through some serenity dependency injection magic.
More detailed, the imaginary usage: parent-tile.sub-tile("xpath_to_root_of_tile").numberOfComments.getText();
In the sub-tile all the @findby methods would look like
@FindBys({@FindBy(xpath="xpath_to_root_of_tile"), @FindBy(xyz = comment_element_locator)})
public WebElementFacade numberOfComments;
Thank you in advance!
The text was updated successfully, but these errors were encountered:
Hi
Web applications today are typically single url ones. So page objects are better representation of "tiles" on the same level of the webUI, instead of being actual pages: menu bar, status bar, editor area, ...
Let's say there is a tile with sub-tiles; just like here (https://github.com/serenity-bdd/serenity-core/issues) the tickets themselves. The "roots" of these tickets have unique xpaths, but under the located webelement(facade) they have similar structure: icon, title, opened-by, number of comments. Which cries for being represented with pageobjects.
Even if I think the answer is 'no', I still feel the urge to raise the question:
Is there a way to initialize such sub-pageobjects from the parent pageobject? The happiest path would be providing parameters (like the xpath locator) to the constructor, and the rest would be done "on-demand" (upon invocation) through some serenity dependency injection magic.
More detailed, the imaginary usage:
parent-tile.sub-tile("xpath_to_root_of_tile").numberOfComments.getText();
In the sub-tile all the @findby methods would look like
Thank you in advance!
The text was updated successfully, but these errors were encountered: