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

class OtrsImportBrowserTest < TestCase
  def test_import

    if !ENV['IMPORT_BT_OTRS_ENDPOINT']
      fail "ERROR: Need IMPORT_BT_OTRS_ENDPOINT - hint IMPORT_BT_OTRS_ENDPOINT='http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator'"
    end
    if !ENV['IMPORT_BT_OTRS_ENDPOINT_KEY']
      fail "ERROR: Need IMPORT_BT_OTRS_ENDPOINT_KEY - hint IMPORT_BT_OTRS_ENDPOINT_KEY='01234567899876543210'"
    end

    import_url = "#{ENV['IMPORT_BT_OTRS_ENDPOINT']};Key=#{ENV['IMPORT_BT_OTRS_ENDPOINT_KEY']}"

    @browser = browser_instance
    location(url: browser_url)

    click(css: 'a[href="#import"]')

    click(css: 'a[href="#import/otrs"]')

    set(
      css:   '#otrs-link',
      value: import_url
    )

    watch_for(
      css: 'body',
      value: 'xxxx',
      timeout: 10,
    )

    # click import<commit_msg>Current state of browser test.<commit_after># encoding: utf-8
require 'browser_test_helper'

class OtrsImportBrowserTest < TestCase
  def test_import

    if !ENV['IMPORT_BT_OTRS_ENDPOINT']
      fail "ERROR: Need IMPORT_BT_OTRS_ENDPOINT - hint IMPORT_BT_OTRS_ENDPOINT='http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator'"
    end
    if !ENV['IMPORT_BT_OTRS_ENDPOINT_KEY']
      fail "ERROR: Need IMPORT_BT_OTRS_ENDPOINT_KEY - hint IMPORT_BT_OTRS_ENDPOINT_KEY='01234567899876543210'"
    end

    import_url = "#{ENV['IMPORT_BT_OTRS_ENDPOINT']};Key=#{ENV['IMPORT_BT_OTRS_ENDPOINT_KEY']}"

    @browser = browser_instance
    location(url: browser_url)

    click(css: 'a[href="#import"]')

    click(css: 'a[href="#import/otrs"]')

    click(css: 'a.js-download')

    click(css: 'a.js-otrs-link')

    set(
      css:   '#otrs-link',
      value: import_url
    )

    exists(
      css: 'svg.icon-checkmark'
    )

    click(css: 'a.js-migration-start')

    watch_for(
      css: 'body',
      value: 'xxxx',
      timeout: 10,
    )

    # click import
{'fraction_non_alphanumeric': 0.13065582104728013, 'fraction_numerical': 0.026436197254702594, 'mean_word_length': 3.6635071090047395, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1681249', 'n_tokens_mistral': 801, 'n_tokens_neox': 738, 'n_words': 116}