Is there a PageElement class, rather than PageObject? #2469
john-caleb-phillips posted onGitHub
I am currently working with Serenity using PageObject
and ScenarioSteps
files, not the Screenplay pattern.
In my project I have several reusable elements are appear on various pages. There are the obvious header, footer, and sidebar objects that lots of sites have, but also a few others that are specific to my project. I am unsure what class these reusable page elements should inherit from. I don't want to have them inherit from ScenarioSteps
, since they contain no steps. I also do not want them to inherit from PageObject
, since it contains many methods that do not apply to these elements. Methods such as open()
and callWhenPageOpensMethods()
come to mind.
Is there a class that these reusable elements can inherit from that is lighter than the PageObject class, but semantically different from the ScenarioSteps class?