Helpers
Methods
buildSelector
addon/-private/helpers.js:131-133
Parameters
node
Ceibo Node of the treetargetSelector
string CSS selectoroptions
Object Additional optionsoptions.resetScope
boolean Do not use inherited scopeoptions.contains
string Filter by using :contains(‘foo’) pseudo-classoptions.at
number Filter by index using :eq(x) pseudo-classoptions.last
boolean Filter by using :last pseudo-classoptions.visible
boolean Filter by using :visible pseudo-class
Examples
const component = PageObject.create({ scope: '.component'});
buildSelector(component, '.my-element');
// returns '.component .my-element'
const page = PageObject.create({});
buildSelector(page, '.my-element', { at: 0 });
// returns '.my-element:eq(0)'
const page = PageObject.create({});
buildSelector(page, '.my-element', { contains: "Example" });
// returns ".my-element :contains('Example')"
const page = PageObject.create({});
buildSelector(page, '.my-element', { last: true });
// returns '.my-element:last'
Returns string Fully qualified selector
getContext
addon/-private/helpers.js:193-202
Parameters
node
Ceibo Node of the tree
Returns ** The test’s this
context, or null