/*
 * Copyright (C) 2018 Robert Bosch GmbH Copyright (C) 2018 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

export class DemoPage {
  navigateTo() {
    return cy.visit('/');
  }

  getTitle() {
    return cy.get('.sidenav-header h1');
  }

  getBoschLogo() {
    return cy.get('.header-logo img');
  }

  getSidebar() {
    return cy.get('bci-sidebar mat-sidenav-container');
  }

  getSidebarItemByText(menuItemText: string) {
    return cy.get('p.mat-line').contains(menuItemText);
  }

  getLogoutOverlay() {
    return cy.get('bci-logout');
  }

  getLogoutSurroundingArea() {
    return cy.get('.cdk-overlay-backdrop');
  }

  getLogoutOverlayCloseButton() {
    return this.getLogoutOverlay().get('button.close-button');
  }

  getLogoutOverlayLogoutButton() {
    return this.getLogoutOverlay().get('button').contains('Logout');
  }

  getBurgerElement() {
    return cy.get('bci-burger');
  }
}
