<commit_before>helpers = require '../helpers/helpers.js'
assert  = require 'assert'

module.exports =


  becomePaidUser: (browser) ->

    freePlanSelector = '.single-plan.free.current'

    helpers.beginTest(browser)
    browser
      .url                     helpers.getUrl() + '/Pricing'
      .waitForElementVisible   '.content-page.pricing', 20000
      .element 'css selector', freePlanSelector, (result) ->
        if result.status is 0
          helpers.selectPlan(browser, 'developer')
          helpers.fillPaymentForm(browser)
          browser.end()
        else
          browser.end()


    selectedPlanSelector = '.single-plan.' + planType + '.current'

    helpers.beginTest(browser)
    browser
      .url                     helpers.getUrl() + '/Pricing'
      .waitForElementVisible   '.content-page.pricing', 20000
      .element 'css selector', selectedPlanSelector, (result) ->
        if result.status is 0
          browser.end()
        else
          helpers.selectPlan(browser, planType)
          helpers.fillPaymentForm(browser)
          browser.end()<commit_msg>Tests: Pricing: Payment: Added upgradeAccount test.<commit_after>helpers = require '../helpers/helpers.js'
assert  = require 'assert'

module.exports =


  becomePaidUser: (browser) ->

    freePlanSelector = '.single-plan.free.current'

    helpers.beginTest(browser)
    browser
      .url                     helpers.getUrl() + '/Pricing'
      .waitForElementVisible   '.content-page.pricing', 20000
      .element 'css selector', freePlanSelector, (result) ->
        if result.status is 0
          helpers.selectPlan(browser, 'developer')
          helpers.fillPaymentForm(browser)
          browser.end()
        else
          browser.end()


  upgradeAccount: (browser) ->

    planType = 'professional'
    selectedPlanSelector = '.single-plan.' + planType + '.current'

    helpers.beginTest(browser)
    browser
      .url                     helpers.getUrl() + '/Pricing'
      .waitForElementVisible   '.content-page.pricing', 20000
      .element 'css selector', selectedPlanSelector, (result) ->
        if result.status is 0
          browser.end()
        else
          helpers.selectPlan(browser, planType)

          browser
            .waitForElementVisible   '.payment-modal', 20000
            .click                   '.payment-modal button'
            .waitForElementVisible   '.payment-modal', 20000
            .click                   '.payment-modal button'
            .waitForElementVisible   '[testpath=main-sidebar]', 10000
            .end()



{'fraction_non_alphanumeric': 0.11063664596273291, 'fraction_numerical': 0.015139751552795032, 'mean_word_length': 2.0497041420118345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '7369778', 'n_tokens_mistral': 749, 'n_tokens_neox': 695, 'n_words': 145}