Value
Methods
Table of Contents
value
Parameters
selector
string CSS selector of the element to checkuserOptions
(optional, default{}
)-
options
Object Additional options
Examples
// <input value="Lorem ipsum">
import { create, value } from 'ember-cli-page-object';
const page = create({
value: value('input')
});
assert.equal(page.value, 'Lorem ipsum');
// <div contenteditable="true"><b>Lorem ipsum</b></div>
import { create, value } from 'ember-cli-page-object';
const page = create({
value: value('[contenteditable]')
});
assert.equal(page.value, '<b>Lorem ipsum</b>');
// <div><input value="lorem"></div>
// <div class="scope"><input value="ipsum"></div>
import { create, value } from 'ember-cli-page-object';
const page = create({
value: value('input', { scope: '.scope' })
});
assert.equal(page.value, 'ipsum');
// <div><input value="lorem"></div>
// <div class="scope"><input value="ipsum"></div>
import { create, value } from 'ember-cli-page-object';
const page = create({
scope: '.scope',
value: value('input')
});
assert.equal(page.value, 'ipsum');
- Throws any Will throw an error if no element matches selector
- Throws any Will throw an error if multiple elements are matched by selector
Returns Descriptor