import SelectComponent from '../components/select.js'
import InputComponent from '../components/input.js'
import LabelComponent from '../components/label.js'
import * as click from '../commands/overwrite/click.js'


export default class BasePage {
  async applyOverwrittenCommands(){
    await click.overwriteClick();
  }
  /**
  * @type WebdriverIO.Element
  */
  get root() {
    return '//body';
  }
  /**
  * @param parent WebdriverIO.Element
  * @type SelectComponent
  */
  genericSelect(parent) {
    return new SelectComponent(parent);
  }
  /**
  * @param parent WebdriverIO.Element
  * @type InputComponent
  */
  genericInput(parent) {
    return new InputComponent(parent);
  }
  /**
  * @param parent WebdriverIO.Element
  * @type LabelComponent
  */
  genericLabel(parent) {
    return new LabelComponent(parent);
  }
  /**
  * @param path string
  */
  async open(path) {
      if (!path) {
        await browser.url('/')
      } else {
        await browser.url(path)
      }
    }
}
