Is
Methods
Table of Contents
is
Parameters
- testSelectorstring CSS selector to test
- targetSelectorstring CSS selector of the element to check
- userOptions(optional, default- {})
- optionsObject Additional options- options.scopestring Nests provided scope within parent’s scope
- options.resetScopeboolean Override parent’s scope
- options.atnumber Reduce the set of matched elements to the one at the specified index
- options.multipleboolean If set, the function will return an array of values
- options.testContainerstring Context where to search elements in the DOM
 
Examples
// <input type="checkbox" checked="checked">
// <input type="checkbox" checked>
import { create, is } from 'ember-cli-page-object';
const page = create({
  areInputsChecked: is(':checked', 'input', { multiple: true })
});
assert.equal(page.areInputsChecked, true, 'Inputs are checked');
// <button class="toggle-button active" disabled>Toggle something</button>
import { create, is } from 'ember-cli-page-object';
const page = create({
  isToggleButtonActive: is('.active:disabled', '.toggle-button')
});
assert.equal(page.isToggleButtonActive, true, 'Button is active');
- Throws any Will throw an error if no element matches selector
- Throws any Will throw an error if multiple elements are matched by selector and multiple option is not set
Returns Descriptor