<commit_before># encoding: utf-8
require 'browser_test_helper'

class ManageTest < TestCase
  def test_user
    random = 'manage-test-' + rand(999999).to_s
    user_email = random + '@<EMAIL>'

    # user
    tests = [
      {
        :name     => 'user',
        :action   => [
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/users"]',
          },
          {
            :execute    => 'create_user',
            :login      => 'some login' + random,
            :firstname  => 'Manage Firstname' + random,
            :lastname   => 'Manage Lastname' + random,
            :email      => user_email,
            :password   => '<PASSWORD>',
          },
          {
            :execute  => 'watch_for',
            :area     => 'body',
            :value    => random,
          },
          {
            :execute => 'click',
            :css     => '.table-overview tr:last-child td',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name="lastname"]',
            :value   => '2Manage Lastname' + random,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute => 'watch_for',
            :area    => 'body',
            :value   => '2Manage Lastname' + random,
          },
          {
            :execute => 'wait',
            :value   => 1,
          },
        ],
      },
      {
        :name     => 'sla',
        :action   => [
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/slas"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'click',
            :css     => 'a[data-type="new"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name=name]',
            :value   => 'some sla' + random,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name="first_response_time"]',
            :value   => 61,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute => 'watch_for',
            :area    => 'body',
            :value   => random,
          },
          {
            :execute => 'wait',
            :value   => 3,
          },
          {
            :execute => 'click',
            :css     => '.table-overview tr:last-child td',
          },
          {
            :execute => 'wait',
            :value   => 1,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name=name]',
            :value   => 'some sla update ' + random,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name="first_response_time"]',
            :value   => 121,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute  => 'watch_for',
            :area     => 'body table',
            :value    => 'some sla update ' + random,
          },
          {
            :execute => 'wait',
            :value   => 4,
          },
          {
            :execute => 'click',
            :css     => 'a[data-type="destroy"]:last-child',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute => 'wait',
            :value   => 3,
          },
          {
            :execute      => 'match',
            :css          => 'body',
            :value        => 'some sla update ' + random,
            :match_result => false,
          },
          {
            :execute => 'click',
            :css     => 'a[href="#/"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/slas"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute      => 'match',
            :css          => 'body',
            :value        => 'some sla update ' + random,
            :match_result => false,
          },
          {
            :execute => 'reload',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'click',
            :css     => 'a[href="#/"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/slas"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute      => 'match',
            :css          => 'body',
            :value        => 'some sla update ' + random,
            :match_result => false,
          },

        ],

      },
    ]
    browser_signle_test_with_login(tests, { :username => '<EMAIL>' })
  end
end
<commit_msg>Some temp fixes.<commit_after># encoding: utf-8
require 'browser_test_helper'

class ManageTest < TestCase
  def test_user
    random = 'manage-test-' + rand(999999).to_s
    user_email = random + '@example.com'

    # user
    tests = [
      {
        :name     => 'user',
        :action   => [
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/users"]',
          },
          {
            :execute    => 'create_user',
            :login      => 'some login' + random,
            :firstname  => 'Manage Firstname' + random,
            :lastname   => 'Manage Lastname' + random,
            :email      => user_email,
            :password   => '<PASSWORD>',
          },
          {
            :execute => 'set',
            :css     => '.content .js-search',
            :value   => user_email,
          },
          {
            :execute  => 'watch_for',
            :area     => 'body',
            :value    => random,
          },
          {
            :execute => 'click',
            :css     => '.table-overview tr:last-child td',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name="lastname"]',
            :value   => '2Manage Lastname' + random,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute => 'watch_for',
            :area    => 'body',
            :value   => '2Manage Lastname' + random,
          },
          {
            :execute => 'wait',
            :value   => 1,
          },
        ],
      },
      {
        :name     => 'sla',
        :action   => [
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/slas"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'click',
            :css     => 'a[data-type="new"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name=name]',
            :value   => 'some sla' + random,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name="first_response_time"]',
            :value   => 61,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute => 'watch_for',
            :area    => 'body',
            :value   => random,
          },
          {
            :execute => 'wait',
            :value   => 3,
          },
          {
            :execute => 'click',
            :css     => '.table-overview tr:last-child td',
          },
          {
            :execute => 'wait',
            :value   => 1,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name=name]',
            :value   => 'some sla update ' + random,
          },
          {
            :execute => 'set',
            :css     => '.modal input[name="first_response_time"]',
            :value   => 121,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute  => 'watch_for',
            :area     => 'body table',
            :value    => 'some sla update ' + random,
          },
          {
            :execute => 'wait',
            :value   => 4,
          },
          {
            :execute => 'click',
            :css     => 'a[data-type="destroy"]:last-child',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'click',
            :css     => '.modal button.js-submit',
          },
          {
            :execute => 'wait',
            :value   => 3,
          },
          {
            :execute      => 'match',
            :css          => 'body',
            :value        => 'some sla update ' + random,
            :match_result => false,
          },
          {
            :execute => 'click',
            :css     => 'a[href="#/"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/slas"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute      => 'match',
            :css          => 'body',
            :value        => 'some sla update ' + random,
            :match_result => false,
          },
          {
            :execute => 'reload',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute => 'click',
            :css     => 'a[href="#/"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage"]',
          },
          {
            :execute => 'click',
            :css     => 'a[href="#manage/slas"]',
          },
          {
            :execute => 'wait',
            :value   => 2,
          },
          {
            :execute      => 'match',
            :css          => 'body',
            :value        => 'some sla update ' + random,
            :match_result => false,
          },

        ],

      },
    ]
    browser_signle_test_with_login(tests, { :username => '<EMAIL>' })
  end
end

{'fraction_non_alphanumeric': 0.16404494382022472, 'fraction_numerical': 0.0044943820224719105, 'mean_word_length': 0.8699095022624435, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 233, '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': '896618', 'n_tokens_mistral': 3221, 'n_tokens_neox': 3161, 'n_words': 573}