Helpers
Methods
buildSelector
addon/-private/helpers.js:131-133
Parameters
nodeCeibo Node of the treetargetSelectorstring CSS selectoroptionsObject Additional optionsoptions.resetScopeboolean Do not use inherited scopeoptions.containsstring Filter by using :contains(‘foo’) pseudo-classoptions.atnumber Filter by index using :eq(x) pseudo-classoptions.lastboolean Filter by using :last pseudo-classoptions.visibleboolean 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
nodeCeibo Node of the tree
Returns ** The test’s this context, or null