<commit_before>helpers  = require '../helpers/helpers.js'
utils    = require '../utils/utils.js'
teamsHelpers = require '../helpers/teamshelpers.js'


module.exports =


  createTeam: (browser) ->

    modalSelector       = '.TeamsModal.TeamsModal--create'
    emailSelector       = "#{modalSelector} input[name=email]"
    companyNameSelector = "#{modalSelector} input[name=companyName]"
    signUpButton        = "#{modalSelector} button[type=submit]"
    user                = utils.getUser(yes)
    adminUser           =
      username          : 'devrim'
      password          : '<PASSWORD>'

    helpers.beginTest(browser, adminUser)
    teamsHelpers.createInvitation browser, user, (invitationLink) ->
      browser.click '.close-icon.closeModal'

      helpers.doLogout(browser)

      browser
        .url                   invitationLink
        .waitForElementVisible modalSelector, 20000
        .waitForElementVisible emailSelector, 20000
        .waitForElementVisible companyNameSelector, 20000
        .assert.valueContains  emailSelector, user.email
        .setValue              companyNameSelector, user.teamSlug
        .click                 signUpButton
        .pause                 2500

      teamsHelpers.enterTeamURL(browser)
      teamsHelpers.fillUsernamePasswordForm(browser, user)
      browser.end()


  loginTeam: (browser) ->

    teamsHelpers.loginTeam(browser)
    browser.end()


  openTeamSettings: (browser) ->

    teamsHelpers.loginTeam(browser)
    teamsHelpers.clickTeamSettings(browser)
<commit_msg>Tests: Teams: Close welcome modal.<commit_after>helpers  = require '../helpers/helpers.js'
utils    = require '../utils/utils.js'
teamsHelpers = require '../helpers/teamshelpers.js'


module.exports =


  createTeam: (browser) ->

    modalSelector             = '.TeamsModal.TeamsModal--create'
    emailSelector             = "#{modalSelector} input[name=email]"
    companyNameSelector       = "#{modalSelector} input[name=companyName]"
    signUpButton              = "#{modalSelector} button[type=submit]"
    user                      = utils.getUser(yes)
    welcomeModal              = '.welcome-modal'
    welcomeModalCloseSelector = "#{welcomeModal} .closeModal"
    adminUser                 =
      username                : 'devrim'
      password                : '<PASSWORD>'

    helpers.beginTest(browser, adminUser)
    browser.pause 5000 # wait for welcome modal

    browser.element 'css selector', welcomeModal, (result) =>
      if result.status is 0
        browser
          .waitForElementVisible  welcomeModalCloseSelector, 20000
          .click                  welcomeModalCloseSelector

    teamsHelpers.createInvitation browser, user, (invitationLink) ->
      browser.click '.close-icon.closeModal'

      helpers.doLogout(browser)

      browser
        .url                   invitationLink
        .waitForElementVisible modalSelector, 20000
        .waitForElementVisible emailSelector, 20000
        .waitForElementVisible companyNameSelector, 20000
        .assert.valueContains  emailSelector, user.email
        .setValue              companyNameSelector, user.teamSlug
        .click                 signUpButton
        .pause                 2500

      teamsHelpers.enterTeamURL(browser)
      teamsHelpers.fillUsernamePasswordForm(browser, user)
      browser.end()


  loginTeam: (browser) ->

    teamsHelpers.loginTeam(browser)
    browser.end()


  openTeamSettings: (browser) ->

    teamsHelpers.loginTeam(browser)
    teamsHelpers.clickTeamSettings(browser)

{'fraction_non_alphanumeric': 0.09221253865617093, 'fraction_numerical': 0.013494517852122575, 'mean_word_length': 2.309767441860465, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '2117415', 'n_tokens_mistral': 982, 'n_tokens_neox': 942, 'n_words': 176}