<commit_before>import Async from 'asyncawait/async'
import Await from 'asyncawait/await'
import webdriver from 'selenium-webdriver'
import driverUtils from './driver-utils'
import { getAppBaseUrl } from './driver-mgr'

var By = webdriver.By

function randomString (length) {
  const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  var result = ''
  for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]
  return result
}

var setUserEmail = (Async((driver, email) => {
  const emailInputId = 'login-email-input-id'
  const confirmEmailBtnId = 'confirm-email-btn-id'
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(emailInputId)))
  Await(driverUtils(driver).setValue(By.id(emailInputId), email))
  Await(driverUtils(driver).click(By.id(confirmEmailBtnId)))
}))

var setUserPassword = (Async((driver, password) => {
  const passwordConfirmationContainerId = 'password-form-container-test-id'
  const passwordInputId = 'login-password-input-id'
  const confirmPasswordBtnId = 'confirm-password-btn-id'
  Await(driverUtils(driver).waitForElementVisible(passwordConfirmationContainerId))
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(passwordInputId)))
  Await(driverUtils(driver).setValue(By.id(passwordInputId), password))
  Await(driverUtils(driver).click(By.id(confirmPasswordBtnId)))
}))

var createUser = (Async((driver, email, password) => {
  const dashboardId = 'app-dashboard-id'
  Await(setUserEmail(driver, email))
  Await(setUserPassword(driver, password))
  Await(driverUtils(driver).waitForElementVisible(dashboardId))
}))

var signOutUser = (Async((driver) => {
  const settingsViewId = 'app-settings-id'
  const signOutBtnId = 'app-signout-btn'
  const emailInputId = 'login-email-input-id'
  const settingsUrl = getAppBaseUrl() + 'tab/settings/'

  Await(driverUtils(driver).navigateTo(settingsUrl))
  Await(driverUtils(driver).waitForElementVisible(settingsViewId))
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(signOutBtnId)))
  Await(driverUtils(driver).click(By.id(signOutBtnId)))
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(emailInputId)))
}))

export {
  randomString,
  setUserEmail,
  setUserPassword,
  createUser,
  signOutUser
}
<commit_msg>Fix settings URL in test.<commit_after>import Async from 'asyncawait/async'
import Await from 'asyncawait/await'
import webdriver from 'selenium-webdriver'
import driverUtils from './driver-utils'
import { getAppBaseUrl } from './driver-mgr'

var By = webdriver.By

function randomString (length) {
  const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  var result = ''
  for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]
  return result
}

var setUserEmail = (Async((driver, email) => {
  const emailInputId = 'login-email-input-id'
  const confirmEmailBtnId = 'confirm-email-btn-id'
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(emailInputId)))
  Await(driverUtils(driver).setValue(By.id(emailInputId), email))
  Await(driverUtils(driver).click(By.id(confirmEmailBtnId)))
}))

var setUserPassword = (Async((driver, password) => {
  const passwordConfirmationContainerId = 'password-form-container-test-id'
  const passwordInputId = 'login-password-input-id'
  const confirmPasswordBtnId = 'confirm-password-btn-id'
  Await(driverUtils(driver).waitForElementVisible(passwordConfirmationContainerId))
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(passwordInputId)))
  Await(driverUtils(driver).setValue(By.id(passwordInputId), password))
  Await(driverUtils(driver).click(By.id(confirmPasswordBtnId)))
}))

var createUser = (Async((driver, email, password) => {
  const dashboardId = 'app-dashboard-id'
  Await(setUserEmail(driver, email))
  Await(setUserPassword(driver, password))
  Await(driverUtils(driver).waitForElementVisible(dashboardId))
}))

var signOutUser = (Async((driver) => {
  const settingsViewId = 'app-settings-id'
  const signOutBtnId = 'app-signout-btn'
  const emailInputId = 'login-email-input-id'

  const settingsUrl = getAppBaseUrl() + '/tab/settings/'

  Await(driverUtils(driver).navigateTo(settingsUrl))
  Await(driverUtils(driver).waitForElementVisible(settingsViewId))
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(signOutBtnId)))
  Await(driverUtils(driver).click(By.id(signOutBtnId)))
  Await(driverUtils(driver).waitForElementVisibleByCustomSelector(By.id(emailInputId)))
}))

export {
  randomString,
  setUserEmail,
  setUserPassword,
  createUser,
  signOutUser
}

{'fraction_non_alphanumeric': 0.1285775309696711, 'fraction_numerical': 0.004698846646732166, 'mean_word_length': 6.805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4312645', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1506, 'n_words': 234}