I'd like to know if there is a framework in Javascript (NodeJS) for [Protractor](https://github.com/angular/protractor) which supports a clean way to define the Page Object Elements on a Page Object as [site\_prism](https://github.com/natritmeyer/site_prism) does. I've already checked [astrolabe](https://github.com/stuplum/astrolabe) but doesn't quite fit the purpose.

This is how Page Objects are declarative defined with [site\_prism](https://github.com/natritmeyer/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](https://github.com/angular/protractor). Maybe someone is using a custom framework internally, are you willing to open source it?

Regarding [astrolabe](https://github.com/stuplum/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](https://github.com/stuplum/astrolabe) features here but my question is not about [astrolabe](https://github.com/stuplum/astrolabe) per se but as whether there is a better [site\_prism](https://github.com/natritmeyer/site_prism) equivalent for JS.

Note: migrating the question from [Software Quality Assurance & Testing](https://sqa.stackexchange.com/questions/11623/page-object-design-is-there-a-javascript-equivalent-to-ruby-gem-site-prism) since hasn't received enough attention there.