Is hidden
Methods
Table of Contents
isHidden
Validates if an element or set of elements is hidden or does not exist in the DOM.
Parameters
selector
string CSS selector of the element to checkuserOptions
(optional, default{}
)-
options
Object Additional options
Examples
// Lorem <span style="display:none">ipsum</span>
import { create, isHidden } from 'ember-cli-page-object';
const page = create({
spanIsHidden: isHidden('span')
});
assert.ok(page.spanIsHidden);
// Lorem <strong>ipsum</strong>
import { create, isHidden } from 'ember-cli-page-object';
const page = create({
spanIsHidden: isHidden('span')
});
// returns true when element doesn't exist in DOM
assert.ok(page.spanIsHidden);
// <div><span>lorem</span></div>
// <div class="scope"><span style="display:none">ipsum</span></div>
// <div><span>dolor</span></div>
import { create, isHidden } from 'ember-cli-page-object';
const page = create({
scopedSpanIsHidden: isHidden('span', { scope: '.scope' })
});
assert.ok(page.scopedSpanIsHidden);
// <div><span>lorem</span></div>
// <div class="scope"><span style="display:none">ipsum</span></div>
// <div><span>dolor</span></div>
import { create, isHidden } from 'ember-cli-page-object';
const page = create({
scope: '.scope',
scopedSpanIsHidden: isHidden('span')
});
assert.ok(page.scopedSpanIsHidden);
- Throws any Will throw an error if multiple elements are matched by selector
Returns Descriptor