I'd like to know if there is a framework in Javascript (NodeJS) for Protractor which supports a clean way to define the Page Object Elements on a Page Object as site_prism does. I've already checked astrolabe but doesn't quite fit the purpose.
This is how Page Objects are declarative defined with site_prism
class Home < SitePrism::Page
set_url "/index.htm"
set_url_matcher /google.com\/?/
element :search_field, "input[name='q']"
element :search_button, "button[name='btnK']"
elements :footer_links, "#footer a"
section :menu, MenuSection, "#gbx3"
end
class MenuSection < SitePrism::Section
element :search, "a.search"
element :images, "a.image-search"
element :maps, "a.map-search"
end
Does anyone know or has developed a solution like above but for Protractor. Maybe someone is using a custom framework internally, are you willing to open source it?
Regarding astrolabe it lacks collections support and I'm looking for a more declarative syntax; instead of
username: { get: function() { return this.findElement(this.by.input('username')); },
I was expecting something more declarative like:
username: By.input('username'),
Could dig further on missing astrolabe features here but my question is not about astrolabe per se but as whether there is a better site_prism equivalent for JS.
Note: migrating the question from Software Quality Assurance & Testing since hasn't received enough attention there.