Is there a JavaScript framework for Protractor in NodeJS that provides a clean way to define Page Object Elements similar to site_prism? I've explored astrolabe but it doesn't quite meet the requirements.
This is an example of how Page Objects are declaratively 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
Has anyone developed or knows of a solution similar to this for Protractor? Perhaps using a custom internal framework that could be open sourced?
In comparison to astrolabe, I am looking for a more declarative syntax and collections support. For example, instead of:
username: { get: function() { return this.findElement(this.by.input('username')); },
I would prefer something like:
username: By.input('username'),
Although further details about the shortcomings of astrolabe can be discussed, my main question is whether there is a better equivalent to site_prism available for JavaScript.
Note: This question has been migrated from Software Quality Assurance & Testing due to lack of attention.