Protractor Page Objects are a recommended for testing your AngularJS applications. Page Objects abstract the interaction between the browser and your functional tests, resulting in much cleaner tests.
How does element(by.id('button1')) work as it gets called before the browser gets to the page with the button on it. Will protractor just lazily find the element when click() is called?
In my tests I'm finding that the locator is resolved on page object instantiation causing a few test failures. I've used Object.defineProperty to provide some lazy evaluated locators
is the IndexPage.js file under e2e/index folder, correct?