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

class AgentTicketActionLevel4Test < TestCase
  def test_agent_ticket_create_with_reload

    @browser = browser_instance
    login(
      username: '<EMAIL>',
      password: '<PASSWORD>',
      url: browser_url,
    )
    tasks_close_all()

    # create ticket
    ticket_create(
      data: {
        customer: 'nicole',
        group: 'Users',
        title: 'some subject 4 - 123äöü',
        body: 'some body 4 - 123äöü',
      },
      do_not_submit: true,
    )
    sleep 8

    # check if customer is shown in sidebar
    match(
      css: '.active .sidebar[data-tab="customer"]',
      value: 'nicole',
    )

    # check task title
    verify_task(
      data: {
        title: 'some subject 4 - 123äöü',
      }
    )

    # check page title
    verify_title(
      value: 'some subject 4 - 123äöü',
    )

    # reload instances, verify autosave
    reload()

    # check if customer is still shown in sidebar
    watch_for(
      css: '.active .sidebar[data-tab="customer"]',
      value: 'nicole',
    )

    # finally create ticket
    click(css: '.content.active .js-submit')
    sleep 5

    location_check(
      url: '#ticket/zoom/',
    )

    # check ticket
    match(
      css: '.active div.ticket-article',
      value: 'some body 4 - 123äöü',
    )

    ticket_id = nil
    if @browser.current_url =~ %r{ticket/zoom/(.+?)$}i
      ticket_id = $1
    end

    # check task title
    verify_task(
      data: {
        title: 'some subject 4 - 123äöü',<commit_msg>Improved timing.<commit_after># encoding: utf-8
require 'browser_test_helper'

class AgentTicketActionLevel4Test < TestCase
  def test_agent_ticket_create_with_reload

    @browser = browser_instance
    login(
      username: '<EMAIL>',
      password: '<PASSWORD>',
      url: browser_url,
    )
    tasks_close_all()

    # create ticket
    ticket_create(
      data: {
        customer: 'nicole',
        group: 'Users',
        title: 'some subject 4 - 123äöü',
        body: 'some body 4 - 123äöü',
      },
      do_not_submit: true,
    )
    sleep 8

    # check if customer is shown in sidebar
    match(
      css: '.active .sidebar[data-tab="customer"]',
      value: 'nicole',
    )

    # check task title
    verify_task(
      data: {
        title: 'some subject 4 - 123äöü',
      }
    )

    # check page title
    verify_title(
      value: 'some subject 4 - 123äöü',
    )

    # reload instances, verify autosave
    reload()

    # check if customer is still shown in sidebar
    watch_for(
      css: '.active .sidebar[data-tab="customer"]',
      value: 'nicole',
    )
    sleep 2

    # finally create ticket
    click(css: '.content.active .js-submit')
    sleep 5

    location_check(
      url: '#ticket/zoom/',
    )

    # check ticket
    match(
      css: '.active div.ticket-article',
      value: 'some body 4 - 123äöü',
    )

    ticket_id = nil
    if @browser.current_url =~ %r{ticket/zoom/(.+?)$}i
      ticket_id = $1
    end

    # check task title
    verify_task(
      data: {
        title: 'some subject 4 - 123äöü',
{'fraction_non_alphanumeric': 0.11453320500481232, 'fraction_numerical': 0.01892845684953481, 'mean_word_length': 2.0779861796643635, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '5993774', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1000, 'n_words': 268}