import CoUxTreeListItem from '../../../../components/10x/ux/ux-tree-list-item.js';
import EuiBasePage from '../eui-base.po.js';

export default class TreeListItemPage extends EuiBasePage {

  constructor() {
      super();
  }

  /**
   * Returns the index-nth CoUxTreeListItem from the page
   * @param index - index of the component
   * @returns CoUxTreeListItem
   */
  treeListItemByIndex(index) {
    let treeListItem1 =  new CoUxTreeListItem(this.mainContent);
    return treeListItem1.byIndex(index);
  }

  /**
   * Returns the CoUxTreeListItem from the page that contains the text
   * @param text - text to be contained
   * @returns CoUxTreeListItem
   */
  treeListItemByTextContains(text) {
    let treeListItem1 = new CoUxTreeListItem(this.mainContent);
    return treeListItem1.byTextContains(text);
  }

  /**
   * Returns the CoUxTreeListItem from the page that contains the text
   * @param text - text to be contained
   * @returns CoUxTreeListItem
   */
  treeListItemByTextEqualsAndIndex(text, index, normalize=true) {
    let treeListItem1 = new CoUxTreeListItem(this.mainContent);
    return treeListItem1.byTextEqualsAndIndex(text, index, normalize);
  }

   /**
   * Returns the CoUxTreeListItem from the page that contains the section
   * @param id - id to be contained
   * @returns CoUxTreeListItem
   */
    treeListItemFromSectionById(id) {
      return new CoUxTreeListItem(this.sectionById(id));
    }
    /**
     * Returns the CoUxTreeListItem from the page that contains the section and index
     * @param id - id to be contained
     * @param index - index of the component
     * @returns CoUxTreeListItem
     */
    treeListItemFromSectionWithIdByIndex(id, index) {
      const treeListItem1 = new CoUxTreeListItem(this.sectionById(id));
      return treeListItem1.byIndex(index);
    }

}


