Home Manual Reference Source

src/page_objects/web/general/home.page.js

import BasePage from "../../base.page.js";

/** 
 * HomePage
 * @extends BasePage 
 */
class HomePage extends BasePage {
  /**
   * @param {args} args Args from controller
   */
  constructor(args) {
    super(args);
  }

  // PAGE ELEMENTS
  /* eslint-disable require-jsdoc */
  welcomeMessage() {
    return this.element("#welcomeMessage");
  }

  callButton() {
    return this.element("div.icon.icon-video");
  }

  scheduleButton() {
    return this.element("div.icon.icon-schedule");
  }
  /* eslint-enable require-jsdoc */

  // PAGE FUNCTIONS

  /**
   * Clicks the call button
   */
  async startCall() {
    await this.callButton().click();
  }

  /**
   * Get the text of welcome message
   * @returns {String} Text of the welcome message
   */
  async welcomeMessageText() {
    return await this.welcomeMessage().getText();
  }

  /**
   * Determinse if welcome message is visible
   * @returns {Boolean} True if it is visible
   */
  async isWelcomeMessageVisible() {
    return await this.welcomeMessage().isVisible();
  }
}

export default HomePage;