Focusable
Methods
Table of Contents
focusable
Focuses element matched by selector.
Parameters
selector
string CSS selector of the element which will be focuseduserOptions
(optional, default{}
)options
Object Additional options
Examples
// <input class="name">
// <input class="email">
const page = PageObject.create({
focus: focusable('.name')
});
// focuses on element with selector '.name'
page.focus();
// <div class="scope">
// <input class="name">
// </div>
// <input class="email">
const page = PageObject.create({
focus: focusable('.name', { scope: '.scope' })
});
// focuses on element with selector '.scope .name'
page.focus();
// <div class="scope">
// <input class="name">
// </div>
// <input class="email">
const page = PageObject.create({
scope: '.scope',
focus: focusable('.name')
});
// focuses on element with selector '.scope .name'
page.focus();
Returns Descriptor