What is ember-cli-page-object?
mainThe ember-cli-page-object addon is a tool for creating page objects for acceptance and integration tests in Ember applications. It allows you to model complex pages and components using a declarative syntax, reducing the need for repetitive CSS selectors in your tests and providing a clean, high-level interface for DOM interactions.
import {
create,
visitable,
fillable,
clickable,
text
} from 'ember-cli-page-object';
const page = create({
visit: visitable('/'),
username: fillable('#username'),
password: fillable('#password'),
submit: clickable('button'),
error: text('.errors')
});
test('my awesome test', async function(assert) {
await page
.visit()
.username('admin')
.password('invalid')
.submit();
assert.equal(page.error, 'Invalid credentials');
});