Methods

Table of Contents

clickable

Clicks elements matched by a selector.

Parameters

  • selector string CSS selector of the element to click
  • userOptions (optional, default {})
  • options Object Additional options
    • options.scope string Nests provided scope within parent’s scope
    • options.at number Reduce the set of matched elements to the one at the specified index
    • options.visible boolean Make the action to raise an error if the element is not visible
    • options.resetScope boolean Ignore parent scope
    • options.testContainer string Context where to search elements in the DOM

Examples

// <button class="continue">Continue<button>
// <button>Cancel</button>

import { create, clickable } from 'ember-cli-page-object';

const page = create({
  continue: clickable('button.continue')
});

// clicks on element with selector 'button.continue'
await page.continue();
// <div class="scope">
//   <button>Continue<button>
// </div>
// <button>Cancel</button>

import { create, clickable } from 'ember-cli-page-object';

const page = create({
  continue: clickable('button.continue', { scope: '.scope' })
});

// clicks on element with selector '.scope button.continue'
await page.continue();
// <div class="scope">
//   <button>Continue<button>
// </div>
// <button>Cancel</button>

import { create, clickable } from 'ember-cli-page-object';

const page = create({
  scope: '.scope',
  continue: clickable('button.continue')
});

// clicks on element with selector '.scope button.continue'
await page.continue();

Returns Descriptor