Adds QUnit asserts for ember-cli-page-object to make test errors more user-friendly and make code shorter.
User-friendly messages and simpler syntax:
const page = create({
link: {
scope: 'a',
href: attribute('href'),
isHighlighted: hasClass('highlighted'),
},
});
assert.po(page.element).text.is("test"); //message 'page.element: text is "text"'
assert.po(page.link).href.is('google.com'); //message 'page.link: href is "google.com"'
assert.po(page.link).href.includes('google.com'); //message 'page.link: href includes "google.com"'
assert.po(page.link).isHighlighted(); //message 'page.link: is highlighted'
assert.po(page.input).isPresent(); //message 'page.input: is present'
- Ember.js v2.18 or above
- Ember CLI v2.13 or above
- Node.js v8 or above
ember install ember-page-object-asserts
Import new assert in your tests/test-helper.js
file:
import { addPoAssert } from 'ember-page-object-asserts';
addPoAssert();
setApplication(Application.create(config.APP));
assert.po(page.element).text.is("test");
assert.po(page.element).text.isNot("test");
assert.po(page.input).value.is('test');
assert.po(page.element).text.includes("test");
assert.po(page.element).text.doesNotInclude("test");
isPresent/isHidden
assert.po(page.input).isPresent();
assert.po(page.input).isHidden();
const page = create({
list: collection('li')
});
assert.po(page.list).length.is(3);
const page = create({
link: {
isHighlighted: hasClass('highlighted'),
},
});
assert.po(page.list).isHighlighted();
assert.po(page.list).isHighlighted(false);
See the Contributing guide for details.
This project is licensed under the MIT License.