<commit_before>utils    = require '../utils/utils.js'
helpers  = require '../helpers/helpers.js'
HUBSPOT  = no


module.exports =

  loginWithUsername: (browser) ->

    helpers.beginTest(browser)

    browser.end()


  loginWithEmail: (browser) ->

    ourUser = utils.getUser()

    user = {
      username: ourUser.email
      password: <PASSWORD>
      email   : ourUser.email
    }

    helpers.beginTest(browser, user)
    browser.end()


  loginWithInvalidUsername: (browser) ->

    user = {
      username: 'r2d2'
      password: '<PASSWORD>'
    }

    helpers.assertNotLoggedIn(browser, user)
    browser.end()


  loginWithInvalidPassword: (browser) ->

    ourUser = utils.getUser()
    user    = {
      username: ourUser.username
      password: '<PASSWORD>'
    }

    helpers.assertNotLoggedIn(browser, user)
    browser.end()


  loginFromSignupModal: (browser) ->

    user = utils.getUser()
    url  = helpers.getUrl()
    url  = "#{url}/RegisterForTests"

    browser
      .url(url)
      .maximizeWindow()

    browser
      .waitForElementVisible  '[testpath=login-container]', 50000
      .setValue               '.main-part [testpath=register-form-email]', user.email
      .setValue               '.main-part input[name=password]', user.password
      .click                  '.main-part [testpath=signup-button]'
      .waitForElementVisible  '[testpath=main-sidebar]', 10000 # Assertion
      .end()
<commit_msg>test: removed unused variables from login<commit_after>utils    = require '../utils/utils.js'
helpers  = require '../helpers/helpers.js'


module.exports =

  loginWithUsername: (browser) ->

    helpers.beginTest(browser)

    browser.end()


  loginWithEmail: (browser) ->

    ourUser = utils.getUser()

    user = {
      username: ourUser.email
      password: <PASSWORD>
      email   : ourUser.email
    }

    helpers.beginTest(browser, user)
    browser.end()


  loginWithInvalidUsername: (browser) ->

    user = {
      username: 'r2d2'
      password: '<PASSWORD>'
    }

    helpers.assertNotLoggedIn(browser, user)
    browser.end()


  loginWithInvalidPassword: (browser) ->

    ourUser = utils.getUser()
    user    = {
      username: ourUser.username
      password: '<PASSWORD>'
    }

    helpers.assertNotLoggedIn(browser, user)
    browser.end()


  loginFromSignupModal: (browser) ->

    user = utils.getUser()
    url  = helpers.getUrl()
    url  = "#{url}/RegisterForTests"

    browser
      .url(url)
      .maximizeWindow()

    browser
      .waitForElementVisible  '[testpath=login-container]', 50000
      .setValue               '.main-part [testpath=register-form-email]', user.email
      .setValue               '.main-part input[name=password]', user.password
      .click                  '.main-part [testpath=signup-button]'
      .waitForElementVisible  '[testpath=main-sidebar]', 10000 # Assertion
      .end()

{'fraction_non_alphanumeric': 0.1277624309392265, 'fraction_numerical': 0.008287292817679558, 'mean_word_length': 2.408235294117647, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, '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': '1345639', 'n_tokens_mistral': 943, 'n_tokens_neox': 896, 'n_words': 163}