async expectHasSomethings(somethingName, somethingLocatorAndOptions, options) {
    if (!utils.isNonBlankString(somethingName)) {
      throw new TypeError(
        `'${this.displayName}#expectHasSomethings()': 'somethingName' ` +
        `argument must be a non-blank string but it is ` +
        `${typeOf(somethingName)} (${somethingName})`
      );
    }

    const len = somethingLocatorAndOptions.length;

    for (let i = 0; i < len; i++) {
      const somethingLocatorAndOptionsItem = somethingLocatorAndOptions[i];

      if (!_.isArray(somethingLocatorAndOptionsItem)) {
        throw new TypeError(
          `'${this.displayName}#expectHasSomethings()': each element of ` +
          `'somethingLocatorAndOptions' argument must be an array but it is ` +
          `${typeOf(somethingLocatorAndOptionsItem)} ` +
          `(${somethingLocatorAndOptionsItem})`
        );
      }
    }

    const {
      equalityCheck,
      expectHasSomething,
      expectSomethingsCountIs,
      getSomething,
      only,
      sameOrder
    } = new Options(options, {
      validator: ({ expectHasSomething, expectSomethingsCountIs }) => {
        if (!(_.isNil(expectSomethingsCountIs) ||
            _.isFunction(expectSomethingsCountIs) ||
            utils.isNonBlankString(expectSomethingsCountIs))) {
          return (
            `'expectSomethingsCountIs' option must be a function or a ` +
            `non-blank string but it is ` +
            `${typeOf(expectSomethingsCountIs)} (${expectSomethingsCountIs})`
          );
        }
        else if (!(_.isNil(expectHasSomething) ||
            _.isFunction(expectHasSomething) ||
            utils.isNonBlankString(expectHasSomething))) {
          return (
            `'expectHasSomething' option must be a function or a non-blank ` +
            `string but it is ${typeOf(expectHasSomething)} ` +
            `(${expectHasSomething})`
          );
        }
        else {
          return null;
        }
      },
      defaults: {
        only: false,
        sameOrder: false
      }
    });

    if (only === true) {

      // When `options.expectSomethingsCountIs` is a string, fragment must have
      // correspondingly named method.
      if (_.isString(expectSomethingsCountIs) &&
        !_.isFunction(this[expectSomethingsCountIs])) {
        throw new TypeError(
          `'${this.displayName}' fragment must have ` +
          `'${expectSomethingsCountIs}' method, specified in ` +
          `'expectSomethingsCountIs' option, but it doesn't`
        );
      }

      const expectSomethingsCountIsMethodName =
        `expect${ucFirst(somethingName)}sCountIs`;

      // When `options.expectSomethingsCountIs` not provided, fragment must
      // have method named using something's name, e.g.
      // 'Dialog#expectActionsCountIs`.
      if (_.isNil(expectSomethingsCountIs) &&
        !_.isFunction(this[expectSomethingsCountIsMethodName])) {
        throw new TypeError(
          `'${this.displayName}' fragment must have ` +
          `'${expectSomethingsCountIsMethodName}' method or ` +
          `'expectSomethingsCountIs' option set but it doesn't`
        );
      }

      if (_.isFunction(expectSomethingsCountIs)) {
        await expectSomethingsCountIs(len);
      }
      else {
        const expectFn = (
          expectSomethingsCountIs ||
          expectSomethingsCountIsMethodName
        );
        await this[expectFn](len);
      }
    }

    // When `options.expectHasSomething` is a string, fragment must have
    // correspondingly named method.
    if (_.isString(expectHasSomething) &&
      !_.isFunction(this[expectHasSomething])) {
      throw new TypeError(
        `'${this.displayName}' fragment must have '${expectHasSomething}' ` +
        `method, specified in 'expectHasSomething' option, but it doesn't`
      );
    }

    const expectHasSomethingMethodName = `expectHas${ucFirst(somethingName)}`;

    // When `options.expectHasSomething` not provided, fragment must have
    // method named using something's name, e.g. 'Dialog#expectHasAction`.
    if (_.isNil(expectHasSomething) &&
      !_.isFunction(this[expectHasSomethingMethodName])) {
      throw new TypeError(
        `'${this.displayName}' fragment must have ` +
        `'${expectHasSomethingMethodName}' method or 'expectHasSomething' ` +
        `option set but it doesn't`
      );
    }

    const somethings = [];

    for (let i = 0; i < len; i++) {
      const somethingLocatorAndOptionsItem = somethingLocatorAndOptions[i];
      const expectHasSomethingOptions = {
        equalityCheck,
        getSomething,
        idx: (only === true && sameOrder === true) ? i : void(0)
      };

      let something;

      if (_.isFunction(expectHasSomething)) {
        something = await expectHasSomething(
          somethingLocatorAndOptionsItem[0],
          somethingLocatorAndOptionsItem[1],
          expectHasSomethingOptions
        );
      }
      else if (this[expectHasSomething]) {
        something = await this[expectHasSomething](
          somethingLocatorAndOptionsItem[0],
          somethingLocatorAndOptionsItem[1],
          expectHasSomethingOptions
        );
      }
      else {
        something = await this[expectHasSomethingMethodName](
          somethingLocatorAndOptionsItem[0],
          somethingLocatorAndOptionsItem[1],
          expectHasSomethingOptions
        );
      }

      somethings.push(something);
    }

    return somethings;
  }
/**
   * Asserts that fragment has list of something fragments, named
   * `somethingName`. Optionally, asserts that this fragment has only
   * specified something fragments, and, also optionally, asserts that
   * something fragments found in this fragment in same order as in
   * `somethingLocatorAndOptions`.
   *
   * @param {String} somethingName Name of something. For example, in Dialog it can be an Action
   * @param {Array} somethingLocatorAndOptions An array where each element is an array of two elements - something's spec and something's opts. See `spec` and `opts` arguments of something's constructor
   * @param {Options|Object} [options] Options
   * @param {Boolean} [options.equalityCheck] Same as in `#expectHasSomething`. Usable only when assertion on placement order requested (see `options.sameOrder`)
   * @param {Function|String} [options.expectHasSomething] Allows to handle expectation of has something in custom way. It can be a function (no `this` binding provided) or a name (string) of fragment's method. By default it's a `#expectHasSomething()` that would receive `somethingName`
   * @param {Function|String} [options.expectSomethingsCountIs] When it's a function then it would be called with number of something fragments to assert that count is valid, note that no `this` binding provided. When it's a string then it must be a method name of this fragment that would be called with number of something fragments to assert that count is valid. When nil then this fragment's method named `#expectSomethingsCountIs`, where 'Something' part equal to upercased version of `somethingName` argument, would be used
   * @param {Function|String} [options.getSomething] Same as in `#expectHasSomething`
   * @param {Boolean} [options.only=false] When `true` fragment must have only specified something fragments to pass assertion
   * @param {Boolean} [options.sameOrder=false] When `true` something fragments must be found in fragment in same order as in `somethingSpecificationsAndOptions` to pass assertion. Usable only when `options.only` is truthy
   * @returns {Promise<Array>} Found somethings.
   * @throws {AssertionError} When any of expectations failed.
   * @throws {TypeError} When any of arguments aren't valid.
   */
Asserts that fragment has list of something fragments, named
`somethingName`. Optionally, asserts that this fragment has only
specified something fragments, and, also optionally, asserts that
something fragments found in this fragment in same order as in
`somethingLocatorAndOptions`.

@param {String} somethingName Name of something. For example, in Dialog it can be an Action
@param {Array} somethingLocatorAndOptions An array where each element is an array of two elements - something's spec and something's opts.
Asserts that fragment has list of something fragments named ` somethingName ` . Optionally asserts that this fragment has only specified something fragments and also optionally asserts that something fragments found in this fragment in same order as in ` somethingLocatorAndOptions ` . @param { String } somethingName Name of something . For example in Dialog it can be an Action @param { Array } somethingLocatorAndOptions An array where each element is an array of two elements - something ' s spec and something ' s opts .
async expectHasSomethings(somethingName, somethingLocatorAndOptions, options) {
    if (!utils.isNonBlankString(somethingName)) {
      throw new TypeError(
        `'${this.displayName}#expectHasSomethings()': 'somethingName' ` +
        `argument must be a non-blank string but it is ` +
        `${typeOf(somethingName)} (${somethingName})`
      );
    }
    const len = somethingLocatorAndOptions.length;
    for (let i = 0; i < len; i++) {
      const somethingLocatorAndOptionsItem = somethingLocatorAndOptions[i];
      if (!_.isArray(somethingLocatorAndOptionsItem)) {
        throw new TypeError(
          `'${this.displayName}#expectHasSomethings()': each element of ` +
          `'somethingLocatorAndOptions' argument must be an array but it is ` +
          `${typeOf(somethingLocatorAndOptionsItem)} ` +
          `(${somethingLocatorAndOptionsItem})`
        );
      }
    }
    const {
      equalityCheck,
      expectHasSomething,
      expectSomethingsCountIs,
      getSomething,
      only,
      sameOrder
    } = new Options(options, {
      validator: ({ expectHasSomething, expectSomethingsCountIs }) => {
        if (!(_.isNil(expectSomethingsCountIs) ||
            _.isFunction(expectSomethingsCountIs) ||
            utils.isNonBlankString(expectSomethingsCountIs))) {
          return (
            `'expectSomethingsCountIs' option must be a function or a ` +
            `non-blank string but it is ` +
            `${typeOf(expectSomethingsCountIs)} (${expectSomethingsCountIs})`
          );
        }
        else if (!(_.isNil(expectHasSomething) ||
            _.isFunction(expectHasSomething) ||
            utils.isNonBlankString(expectHasSomething))) {
          return (
            `'expectHasSomething' option must be a function or a non-blank ` +
            `string but it is ${typeOf(expectHasSomething)} ` +
            `(${expectHasSomething})`
          );
        }
        else {
          return null;
        }
      },
      defaults: {
        only: false,
        sameOrder: false
      }
    });
    if (only === true) {
      if (_.isString(expectSomethingsCountIs) &&
        !_.isFunction(this[expectSomethingsCountIs])) {
        throw new TypeError(
          `'${this.displayName}' fragment must have ` +
          `'${expectSomethingsCountIs}' method, specified in ` +
          `'expectSomethingsCountIs' option, but it doesn't`
        );
      }
      const expectSomethingsCountIsMethodName =
        `expect${ucFirst(somethingName)}sCountIs`;
      if (_.isNil(expectSomethingsCountIs) &&
        !_.isFunction(this[expectSomethingsCountIsMethodName])) {
        throw new TypeError(
          `'${this.displayName}' fragment must have ` +
          `'${expectSomethingsCountIsMethodName}' method or ` +
          `'expectSomethingsCountIs' option set but it doesn't`
        );
      }
      if (_.isFunction(expectSomethingsCountIs)) {
        await expectSomethingsCountIs(len);
      }
      else {
        const expectFn = (
          expectSomethingsCountIs ||
          expectSomethingsCountIsMethodName
        );
        await this[expectFn](len);
      }
    }
    if (_.isString(expectHasSomething) &&
      !_.isFunction(this[expectHasSomething])) {
      throw new TypeError(
        `'${this.displayName}' fragment must have '${expectHasSomething}' ` +
        `method, specified in 'expectHasSomething' option, but it doesn't`
      );
    }
    const expectHasSomethingMethodName = `expectHas${ucFirst(somethingName)}`;
    if (_.isNil(expectHasSomething) &&
      !_.isFunction(this[expectHasSomethingMethodName])) {
      throw new TypeError(
        `'${this.displayName}' fragment must have ` +
        `'${expectHasSomethingMethodName}' method or 'expectHasSomething' ` +
        `option set but it doesn't`
      );
    }
    const somethings = [];
    for (let i = 0; i < len; i++) {
      const somethingLocatorAndOptionsItem = somethingLocatorAndOptions[i];
      const expectHasSomethingOptions = {
        equalityCheck,
        getSomething,
        idx: (only === true && sameOrder === true) ? i : void(0)
      };
      let something;
      if (_.isFunction(expectHasSomething)) {
        something = await expectHasSomething(
          somethingLocatorAndOptionsItem[0],
          somethingLocatorAndOptionsItem[1],
          expectHasSomethingOptions
        );
      }
      else if (this[expectHasSomething]) {
        something = await this[expectHasSomething](
          somethingLocatorAndOptionsItem[0],
          somethingLocatorAndOptionsItem[1],
          expectHasSomethingOptions
        );
      }
      else {
        something = await this[expectHasSomethingMethodName](
          somethingLocatorAndOptionsItem[0],
          somethingLocatorAndOptionsItem[1],
          expectHasSomethingOptions
        );
      }
      somethings.push(something);
    }
    return somethings;
  }
async expectHasSomethings ( somethingName , somethingLocatorAndOptions , options ) { if ( ! utils . isNonBlankString ( somethingName ) ) { throw new TypeError ( ` ${ this . displayName } ` + ` ` + ` ${ typeOf ( somethingName ) } ${ somethingName } ` ) ; } const len = somethingLocatorAndOptions . length ; for ( let i = 0 ; i < len ; i ++ ) { const somethingLocatorAndOptionsItem = somethingLocatorAndOptions [ i ] ; if ( ! _ . isArray ( somethingLocatorAndOptionsItem ) ) { throw new TypeError ( ` ${ this . displayName } ` + ` ` + ` ${ typeOf ( somethingLocatorAndOptionsItem ) } ` + ` ${ somethingLocatorAndOptionsItem } ` ) ; } } const { equalityCheck , expectHasSomething , expectSomethingsCountIs , getSomething , only , sameOrder } = new Options ( options , { validator : ( { expectHasSomething , expectSomethingsCountIs } ) => { if ( ! ( _ . isNil ( expectSomethingsCountIs ) || _ . isFunction ( expectSomethingsCountIs ) || utils . isNonBlankString ( expectSomethingsCountIs ) ) ) { return ( ` ` + ` ` + ` ${ typeOf ( expectSomethingsCountIs ) } ${ expectSomethingsCountIs } ` ) ; } else if ( ! ( _ . isNil ( expectHasSomething ) || _ . isFunction ( expectHasSomething ) || utils . isNonBlankString ( expectHasSomething ) ) ) { return ( ` ` + ` ${ typeOf ( expectHasSomething ) } ` + ` ${ expectHasSomething } ` ) ; } else { return null ; } } , defaults : { only : false , sameOrder : false } } ) ; if ( only === true ) { if ( _ . isString ( expectSomethingsCountIs ) && ! _ . isFunction ( this [ expectSomethingsCountIs ] ) ) { throw new TypeError ( ` ${ this . displayName } ` + ` ${ expectSomethingsCountIs } ` + ` ` ) ; } const expectSomethingsCountIsMethodName = ` ${ ucFirst ( somethingName ) } ` ; if ( _ . isNil ( expectSomethingsCountIs ) && ! _ . isFunction ( this [ expectSomethingsCountIsMethodName ] ) ) { throw new TypeError ( ` ${ this . displayName } ` + ` ${ expectSomethingsCountIsMethodName } ` + ` ` ) ; } if ( _ . isFunction ( expectSomethingsCountIs ) ) { await expectSomethingsCountIs ( len ) ; } else { const expectFn = ( expectSomethingsCountIs || expectSomethingsCountIsMethodName ) ; await this [ expectFn ] ( len ) ; } } if ( _ . isString ( expectHasSomething ) && ! _ . isFunction ( this [ expectHasSomething ] ) ) { throw new TypeError ( ` ${ this . displayName } ${ expectHasSomething } ` + ` ` ) ; } const expectHasSomethingMethodName = ` ${ ucFirst ( somethingName ) } ` ; if ( _ . isNil ( expectHasSomething ) && ! _ . isFunction ( this [ expectHasSomethingMethodName ] ) ) { throw new TypeError ( ` ${ this . displayName } ` + ` ${ expectHasSomethingMethodName } ` + ` ` ) ; } const somethings = [ ] ; for ( let i = 0 ; i < len ; i ++ ) { const somethingLocatorAndOptionsItem = somethingLocatorAndOptions [ i ] ; const expectHasSomethingOptions = { equalityCheck , getSomething , idx : ( only === true && sameOrder === true ) ? i : void ( 0 ) } ; let something ; if ( _ . isFunction ( expectHasSomething ) ) { something = await expectHasSomething ( somethingLocatorAndOptionsItem [ 0 ] , somethingLocatorAndOptionsItem [ 1 ] , expectHasSomethingOptions ) ; } else if ( this [ expectHasSomething ] ) { something = await this [ expectHasSomething ] ( somethingLocatorAndOptionsItem [ 0 ] , somethingLocatorAndOptionsItem [ 1 ] , expectHasSomethingOptions ) ; } else { something = await this [ expectHasSomethingMethodName ] ( somethingLocatorAndOptionsItem [ 0 ] , somethingLocatorAndOptionsItem [ 1 ] , expectHasSomethingOptions ) ; } somethings . push ( something ) ; } return somethings ; }
Asserts that fragment has list of something fragments, named
 `somethingName`.
Asserts that fragment has list of something fragments named ` somethingName ` .
// When `options.expectSomethingsCountIs` is a string, fragment must have // correspondingly named method. // When `options.expectSomethingsCountIs` not provided, fragment must // have method named using something's name, e.g. // 'Dialog#expectActionsCountIs`. // When `options.expectHasSomething` is a string, fragment must have // correspondingly named method. // When `options.expectHasSomething` not provided, fragment must have // method named using something's name, e.g. 'Dialog#expectHasAction`.