Methods

Table of Contents

notHasClass

Parameters

  • cssClass string CSS class to be validated
  • selector string CSS selector of the element to check
  • 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.resetScope boolean Override parent’s scope
    • options.testContainer string Context where to search elements in the DOM

Examples

// <em class="lorem"></em><span class="success">Message!</span>

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

const page = create({
  messageIsSuccess: notHasClass('error', 'span')
});

assert.ok(page.messageIsSuccess);
// <div>
//   <span class="lorem"></span>
// </div>
// <div class="scope">
//   <span class="ipsum"></span>
// </div>

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

const page = create({
  spanNotHasClass: notHasClass('lorem', 'span', { scope: '.scope' })
});

assert.ok(page.spanNotHasClass);
// <div>
//   <span class="lorem"></span>
// </div>
// <div class="scope">
//   <span class="ipsum"></span>
// </div>

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

const page = create({
  scope: '.scope',
  spanNotHasClass: notHasClass('lorem', 'span')
});

assert.ok(page.spanNotHasClass);
  • Throws any Will throw an error if no element matches selector
  • Throws any Will throw an error if multiple elements are matched by selector

Returns Descriptor