Clickable
Methods
clickable
addon/-private/properties/clickable.js:59-79
Clicks elements matched by a selector.
Parameters
selector
string CSS selector of the element to clickoptions
Object Additional optionsoptions.scope
string Nests provided scope within parent’s scopeoptions.at
number Reduce the set of matched elements to the one at the specified indexoptions.visible
boolean Make the action to raise an error if the element is not visibleoptions.resetScope
boolean Ignore parent scopeoptions.testContainer
string Context where to search elements in the DOM
userOptions
(optional, default{}
)
Examples
// <button class="continue">Continue<button>
// <button>Cancel</button>
const page = PageObject.create({
continue: clickable('button.continue')
});
// clicks on element with selector 'button.continue'
page.continue();
// <div class="scope">
// <button>Continue<button>
// </div>
// <button>Cancel</button>
const page = PageObject.create({
continue: clickable('button.continue', { scope: '.scope' })
});
// clicks on element with selector '.scope button.continue'
page.continue();
// <div class="scope">
// <button>Continue<button>
// </div>
// <button>Cancel</button>
const page = PageObject.create({
scope: '.scope',
continue: clickable('button.continue')
});
// clicks on element with selector '.scope button.continue'
page.continue();
Returns Descriptor