Is
Methods
is
addon/-private/properties/is.js:45-62
Parameters
testSelectorstring CSS selector to testtargetSelectorstring 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 valuesoptions.testContainerstring Context where to search elements in the DOM
userOptions(optional, default{})
Examples
// <input type="checkbox" checked="checked">
// <input type="checkbox" checked>
const page = PageObject.create({
areInputsChecked: is(':checked', 'input', { multiple: true })
});
assert.equal(page.areInputsChecked, true, 'Inputs are checked');
// <button class="toggle-button active" disabled>Toggle something</button>
const page = PageObject.create({
isToggleButtonActive: is('.active:disabled', '.toggle-button')
});
assert.equal(page.isToggleButtonActive, true, 'Button is active');
Returns Descriptor