Methods

buildSelector

addon/-private/helpers.js:131-133

Parameters

  • node Ceibo Node of the tree
  • targetSelector string CSS selector
  • options Object Additional options
    • options.resetScope boolean Do not use inherited scope
    • options.contains string Filter by using :contains(‘foo’) pseudo-class
    • options.at number Filter by index using :eq(x) pseudo-class
    • options.last boolean Filter by using :last pseudo-class
    • options.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