Property
Methods
property
addon/-private/properties/property.js:56-76
Parameters
propertyNamestring Name of the property to getselectorstring CSS selector of the element to checkoptionsObject Additional optionsoptions.scopestring Nests provided scope within parent’s scopeoptions.resetScopeboolean Override parent’s scopeoptions.atnumber Reduce the set of matched elements to the one at the specified indexoptions.multipleboolean If set, the function will return an array of values
userOptions(optional, default{})
Examples
// <input type="checkbox" checked="checked">
const page = PageObject.create({
isChecked: PageObject.property('checked', 'input')
});
assert.ok(page.isChecked);
// <input type="checkbox" checked="checked">
// <input type="checkbox" checked="">
const page = PageObject.create({
inputsChecked: PageObject.property('checked', 'input', { multiple: true })
});
assert.deepEqual(page.inputsChecked, [true, false]);
// <div><input></div>
// <div class="scope"><input type="checkbox" checked="checked"></div>
// <div><input></div>
const page = PageObject.create({
isChecked: PageObject.property('checked', 'input', { scope: '.scope' })
});
assert.ok(page.isChecked);
Returns Descriptor