Represent the screens of your web app as a series of objects. This ember-cli addon eases the construction of these objects for your acceptance and integration tests.
An excerpt from the Selenium Wiki
Within your web app's UI there are areas that your tests interact with. A Page Object simply models these as objects within the test code. This reduces the amount of duplicated code and means that if the UI changes, the fix need only be applied in one place.
The pattern was first introduced by the Selenium
You can find more information about this design pattern here:
Let's work together to improve this addon!
$ ember install ember-cli-page-object
Or you can install the NPM package directly.
$ npm install --save-dev email@example.com
Check the site for full documentation.
The addon includes the following blueprints
page-objectCreates a new page object
page-object-componentCreates a new component to be used in a page object
page-object-helperCreates a new helper to be used in a page object
component-testCreates a new optimized component test with a matching page object component when used with the
You can create a new page object called
users using the
$ ember generate page-object usersinstallingcreate tests/pages/users.js
To create a new component with an integration test based on a page object component just add the
$ ember g component my-component --page-objectinstalling componentcreate app/components/my-componentjscreate app/templates/components/my-componenthbsinstalling component-testcreate tests/integration/components/my-component-testjsinstalling page-object-componentcreate tests/pages/components/my-componentjs
It creates the component itself, a page object component with the same name to run your assertions against, and a special component integration test that contains all the necessary setup code to run your tests.
$ git clone https://github.com/san650/ember-cli-page-object.git$ cd $_$ npm install$ bower install
ember try:testallto test your addon against multiple Ember versions)
ember test --server
ember-cli-page-object is licensed under the MIT license.
See LICENSE for the full license text.