1

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.

  • 1
    Nope, none that I came across. astrolabe is as far as it goes to help with Protractor page objects. – Sam Aug 4 '15 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.