import Component  from '../component.js'
import CoUxLayoutPageColumn from './ux-layout-page-column.js'
import CoUxErrorGroupOutputErrorGroup from './ux-error-group-output-errorGroup.js'

export default class CoUxErrorGroupOutput extends Component {

  constructor(parent) {
    let selector = 'ux-error-group-output';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/ux-error-group-output/ux-error-group-output.component.html
  }
  get layoutPageColumnCO() {
    return new CoUxLayoutPageColumn(this.currentPath);
  }
  async isLayoutPageColumn() {
    return await (await $(this.layoutPageColumnCO.currentPath)).isExisting();
  }
  async wrapper()  {
    let path = '//div[contains(@class, "ux-error-group-wrapper")]';
    if (await this.isLayoutPageColumn()) {
      return this.layoutPageColumnCO.currentPath + path;
    } else {
     return this.currentPath + path;
    }
  }

  async errorGroupOutputErrorGroupCO() {
    return await new CoUxErrorGroupOutputErrorGroup(await this.wrapper());
  }
}


