<commit_before>import { browser, ExpectedConditions as until, $, by, element } from 'protractor';
import * as support from '../support';
import { BaseElement } from '../ui';

import { BasePage } from './base.page';
import { LandingPage } from './landing.page';
import { Header } from './app/header';

export abstract class AppPage extends BasePage {
  appTag = $('f8-app');
  header = new Header(this.appTag.$('header > alm-app-header > nav'));
  successAlert = element(by.xpath('//*[contains(@class,\'alert-success\')]'));

  /**
   * Extend this class, to describe Application Page(after logging in)
   *
   * @param {url} elementFinder ElementFinder that you want to extend
   */
  constructor() {
    super();
  }

  /**
   * Returns an instance of the BaseElement that can be found using
   * the {css} and contains the {text}.
   *
   * @param {UI} The Base Element Class e.g. Button, TextInput
   * @param {css}  Css within the appTag that identifies the element
   * @param {text} text in the element
   *
   */
  innerElement(UI: typeof BaseElement, css: string, text: string): BaseElement {
    const element = this.appTag.element(by.cssContainingText(css, text));
    return new UI(element, text);
  }

  async ready() {
    await support.writeScreenshot('target/screenshots/app_page_ready_1.png');
    await browser.sleep(support.DEFAULT_WAIT);
    support.debug('app.page.ready() starting...');
    await browser.wait(until.presenceOf(this.appTag), support.DEFAULT_WAIT);
    await browser.wait(until.presenceOf(this.header), support.DEFAULT_WAIT);
    // wait for "Recent Spaces" card
    await browser.wait(until.presenceOf(element(by.className('home-space-list-result'))), support.DEFAULT_WAIT);
    support.debug('app.page.ready() complete...');
    await support.writeScreenshot('target/screenshots/app_page_ready_2.png');
  }

  async gotoUserProfile(): Promise<UserProfilePage> {
    await this.ready();
    support.debug('... Select "Profile" menu item');
    await this.header.profileDropdown.select('Profile');
    support.debug('... Select "Profile" menu item - OK');

    let page = new UserProfilePage();
    await page.open();
    return page;
  }

  async gotoUserSettins(): Promise<UserSettingsPage> {<commit_msg>fix(test): remove sleep statement on page load<commit_after>import { browser, ExpectedConditions as until, $, by, element } from 'protractor';
import * as support from '../support';
import { BaseElement } from '../ui';

import { BasePage } from './base.page';
import { LandingPage } from './landing.page';
import { Header } from './app/header';

export abstract class AppPage extends BasePage {
  appTag = $('f8-app');
  header = new Header(this.appTag.$('header > alm-app-header > nav'));
  successAlert = element(by.xpath('//*[contains(@class,\'alert-success\')]'));

  /**
   * Extend this class, to describe Application Page(after logging in)
   *
   * @param {url} elementFinder ElementFinder that you want to extend
   */
  constructor() {
    super();
  }

  /**
   * Returns an instance of the BaseElement that can be found using
   * the {css} and contains the {text}.
   *
   * @param {UI} The Base Element Class e.g. Button, TextInput
   * @param {css}  Css within the appTag that identifies the element
   * @param {text} text in the element
   *
   */
  innerElement(UI: typeof BaseElement, css: string, text: string): BaseElement {
    const element = this.appTag.element(by.cssContainingText(css, text));
    return new UI(element, text);
  }

  async ready() {
    await support.writeScreenshot('target/screenshots/app_page_ready_1.png');
    support.debug('app.page.ready() starting...');
    await browser.wait(until.presenceOf(this.appTag), support.DEFAULT_WAIT);
    await browser.wait(until.presenceOf(this.header), support.DEFAULT_WAIT);
    // wait for "Recent Spaces" card
    await browser.wait(until.presenceOf(element(by.className('home-space-list-result'))), support.DEFAULT_WAIT);
    support.debug('app.page.ready() complete...');
    await support.writeScreenshot('target/screenshots/app_page_ready_2.png');
  }

  async gotoUserProfile(): Promise<UserProfilePage> {
    await this.ready();
    support.debug('... Select "Profile" menu item');
    await this.header.profileDropdown.select('Profile');
    support.debug('... Select "Profile" menu item - OK');

    let page = new UserProfilePage();
    await page.open();
    return page;
  }

  async gotoUserSettins(): Promise<UserSettingsPage> {
{'fraction_non_alphanumeric': 0.14541387024608501, 'fraction_numerical': 0.0013422818791946308, 'mean_word_length': 3.865070729053319, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2476160', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1349, 'n_words': 360}