import CoUxTree from '../../../../components/10x/ux/ux-tree.js'
import CoUxTreeNode from '../../../../components/10x/ux/ux-tree-node.js'
import EuiBasePage from '../eui-base.po.js';

export default class TreePage extends EuiBasePage {

  constructor() {
      super();
  }
  /**
   * Returns the index-nth CoUxTree from the page
   * @param index - index of the component
   * @returns CoUxTree
   */
  treeByIndex(index) {
    const tree1 =  new CoUxTree(this.mainContent);
    return tree1.byIndex(index);
  }
 /**
   * Returns the CoUxTree from the page that contains the text
   * @param text - text to be contained
   * @returns CoUxTree
   */
  treeByTextContains(text) {
    let tree1 = new CoUxTree(this.mainContent);
    return tree1.byTextContains(text);
  }
  /**
   * Returns the CoUxTree from the page that contains the text
   * @param text - text to be contained
   * @returns CoUxTree
   */
  treeByTextContainsAndIndex(text, index, normalize=true) {
    let tree1 = new CoUxTree(this.mainContent);
    return tree1.byTextContainsAndIndex(text, index, normalize);
  }
  /**
   * Returns the CoUxTree from the page that contains the section
   * @param id - id to be contained
   * @returns CoUxTree
   */
  treeFromSectionById(id) {
    return new CoUxTree(this.sectionById(id));
  }
  /**
   * Returns the CoUxTree from the page that contains the section and index
   * @param id - id to be contained
   * @param index - index of the component
   * @returns CoUxTree
   */
  treeFromSectionWithIdByIndex(id, index) {
    const tree1 = new CoUxTree(this.sectionById(id));
    return tree1.byIndex(index);
  }
   /**
   * Returns the index-nth CoUxTreeNode from the page
   * @param index - index of the component
   * @returns CoUxTreeNode
   */
  treeNodeByIndex(index) {
    const treeNode1 =  new CoUxTreeNode(new CoUxTree);
    return treeNode1.byIndex(index);
  }
  /**
   * Returns the CoUxTreeNode from the page that contains the text
   * @param text - text to be contained
   * @returns CoUxTreeNode
   */
  treeNodeByTextContains(text) {
    let treeNode1 = new CoUxTreeNode(new CoUxTree);
    return treeNode1.byTextContains(text);
  }

  /**
  * Returns the CoUxTreeNode from the page that contains the text
  * @param text - text to be contained
  * @returns CoUxTreeNode
  */
  treeNodeByTextContainsAndIndex(text, index, normalize=true) {
    let treeNode1 = new CoUxTreeNode(new CoUxTree);
    return treeNode1.byTextContainsAndIndex(text, index, normalize);
  }
   /**
   * Returns the CoUxTreeNode from the page that contains the section
   * @param id - id to be contained
   * @returns CoUxTreeNode
   */
  treeNodeFromSectionById(id) {
    return new CoUxTreeNode(this.sectionById(id));
  }
  /**
   * Returns the CoUxTreeNode from the page that contains the section and index
   * @param id - id to be contained
   * @param index - index of the component
   * @returns CoUxTreeNode
   */
  treeNodeFromSectionWithIdByIndex(id, index) {
    const tree1 = new CoUxTreeNode(this.sectionById(id));
    return tree1.byIndex(index);
  }
     /**
   * Returns the string from the page that contains the section
   * @param value - value to be contained
   * @returns string
   */
  inputByValue(value) {
        return this.mainContent +  '//input[@value="'+ value +'"]';
    }
}


