Clickable
Methods
Table of Contents
clickable
Clicks elements matched by a selector.
Parameters
selectorstring CSS selector of the element to clickuserOptions(optional, default{})optionsObject Additional optionsoptions.scopestring Nests provided scope within parent’s scopeoptions.atnumber Reduce the set of matched elements to the one at the specified indexoptions.visibleboolean Make the action to raise an error if the element is not visibleoptions.resetScopeboolean Ignore parent scopeoptions.testContainerstring Context where to search elements in the DOM
Examples
// <button class="continue">Continue<button>
// <button>Cancel</button>
import { create, clickable } from 'ember-cli-page-object';
const page = create({
continue: clickable('button.continue')
});
// clicks on element with selector 'button.continue'
await page.continue();
// <div class="scope">
// <button>Continue<button>
// </div>
// <button>Cancel</button>
import { create, clickable } from 'ember-cli-page-object';
const page = create({
continue: clickable('button.continue', { scope: '.scope' })
});
// clicks on element with selector '.scope button.continue'
await page.continue();
// <div class="scope">
// <button>Continue<button>
// </div>
// <button>Cancel</button>
import { create, clickable } from 'ember-cli-page-object';
const page = create({
scope: '.scope',
continue: clickable('button.continue')
});
// clicks on element with selector '.scope button.continue'
await page.continue();
Returns Descriptor