import CoEuiBadge from '../../../../components/10x/eui/eui-badge.js'
import EuiBasePage from '../eui-base.po.js'

export default class EuiBadgePage extends EuiBasePage {

  constructor() {
      super();
  }

  /**
   * Returns the index-nth CoEuiBadge from the page
   * @param index - index of the component
   * @returns CoEuiBadge
   */
  badgeByIndex(index) {
    let badge =  new CoEuiBadge(this.mainContent);
    return badge.byIndex(index);
  }
  /**
   * Returns the CoEuiBadge from the page that contains the text
   * @param text - text to be contained
   * @returns CoEuiBadge
   */
  badgeByTextContains(text) {
    let badge = new CoEuiBadge(this.mainContent);
    return badge.byTextContains(text);
  }

  /**
  * Returns the CoEuiBadge from the page that contains the text
  * @param text - text to be contained
  * @returns CoEuiBadge
  */
  badgeByTextEqualsAndIndex(text, index, normalize=true) {
    let badge = new CoEuiBadge(this.mainContent);
    return badge.byTextEqualsAndIndex(text, index, normalize);
  }
  /**
   * Returns the CoEuiBadge from the page that contains the section
   * @param id - id to be contained
   * @returns CoEuiBadge
   */
  badgeFromSectionById(id) {
    return new CoEuiBadge(this.sectionById(id));
  }

  /**
   * Returns the CoEuiBadge from the page that contains the section and index
   * @param id - id to be contained
   * @param index - index of the component
   * @returns CoEuiBadge
   */
  badgeFromSectionWithIdByIndex(id, index) {
    let badge = new CoEuiBadge(this.sectionById(id));
    return badge.byIndex(index);
  }

}


