<commit_before>When /^I record this document number$/ do
  doc_nbr = kaikifs.find_element(:xpath, "//th[contains(text(), 'Doc Nbr')]/following-sibling::td").text.strip
  kaikifs.record[:document_number] = doc_nbr
  puts doc_nbr
end

When /^I record this "([^"]*)"$/ do |field|
  value = kaikifs.find_element(:xpath, "//th[contains(text(), '#{field}')]/following-sibling::*").text.strip
  kaikifs.record[field] = value.strip
  puts "#{field} = #{value}"
end

When /^I record this "([^"]*)" \(the number\)$/ do |field|
  value = kaikifs.find_element(:xpath, "//th[contains(text(), '#{field}')]/following-sibling::*").text.strip
  value = value.to_i.to_s
  kaikifs.record[field] = value
  puts "#{field} = #{value}"
end

When /^I set the "([^"]*)" to that one$/ do |field|
  value = kaikifs.record[field]
  kaikifs.set_approximate_field(
    [
      "//th/label[contains(text(), '#{field}:')]/../following-sibling::*/input[1] | //th/label[contains(text(), '#{field}:')]/../following-sibling::*/select[1]",
      "//th[contains(text(), '#{field}')]",
      "//th[contains(text()[1], '#{field}')]",
      "//th[contains(text()[2], '#{field}')]/../following-sibling::*//*[contains(@title, '#{field}')]", # Group > create new > Chart Code
      "//th[contains(text()[3], '#{field}')]"
    ],
    value)
end

When /^I save a screenshot as "([^"]*)"$/ do |name|
  kaikifs.screenshot(name.file_safe + '_' + Time.now.strftime("%Y%m%d%H%M%S"))
end

# Highlights a button based on its name
When /^I highlight the "([^"]*)" submit button$/ do |action|
    kaikifs.highlight :name, "methodToCall.#{action.gsub(/ /, '').camelize(:lower)}"
end

When /^I scroll to the image with alt text "([^"]*)"$/ do |text|
  kaikifs.find_element(:xpath, "//*[@alt='#{text}']").location_once_scrolled_into_view
end

When /^I enlargen "([^"]*)"$/ do |text|
  kaikifs.enlargen :xpath, "//*[contains(text(), '#{text}')]"
end

When /^I requeue all of the documents$/ do
  kaikifs.record[:document_numbers].each do |document|
    kaikifs.record[:document_number] = document
    steps %{
    And I set the "Document ID" to the given document number
    And I click "get document"
    And I highlight the "Queue Document Requeuer" submit button
    And I sleep for "2" seconds
    And I click the "Queue Document Requeuer" submit button
    And I scroll to the image with alt text "Workflow"
    Then I should see "Document Requeuer was successfully scheduled"
    And I enlargen "Document Requeuer was successfully scheduled"
    And I sleep for "5" seconds
    }
  end
end<commit_msg>Removed a sleep<commit_after>When /^I record this document number$/ do
  doc_nbr = kaikifs.find_element(:xpath, "//th[contains(text(), 'Doc Nbr')]/following-sibling::td").text.strip
  kaikifs.record[:document_number] = doc_nbr
  puts doc_nbr
end

When /^I record this "([^"]*)"$/ do |field|
  value = kaikifs.find_element(:xpath, "//th[contains(text(), '#{field}')]/following-sibling::*").text.strip
  kaikifs.record[field] = value.strip
  puts "#{field} = #{value}"
end

When /^I record this "([^"]*)" \(the number\)$/ do |field|
  value = kaikifs.find_element(:xpath, "//th[contains(text(), '#{field}')]/following-sibling::*").text.strip
  value = value.to_i.to_s
  kaikifs.record[field] = value
  puts "#{field} = #{value}"
end

When /^I set the "([^"]*)" to that one$/ do |field|
  value = kaikifs.record[field]
  kaikifs.set_approximate_field(
    [
      "//th/label[contains(text(), '#{field}:')]/../following-sibling::*/input[1] | //th/label[contains(text(), '#{field}:')]/../following-sibling::*/select[1]",
      "//th[contains(text(), '#{field}')]",
      "//th[contains(text()[1], '#{field}')]",
      "//th[contains(text()[2], '#{field}')]/../following-sibling::*//*[contains(@title, '#{field}')]", # Group > create new > Chart Code
      "//th[contains(text()[3], '#{field}')]"
    ],
    value)
end

When /^I save a screenshot as "([^"]*)"$/ do |name|
  kaikifs.screenshot(name.file_safe + '_' + Time.now.strftime("%Y%m%d%H%M%S"))
end

# Highlights a button based on its name
When /^I highlight the "([^"]*)" submit button$/ do |action|
    kaikifs.highlight :name, "methodToCall.#{action.gsub(/ /, '').camelize(:lower)}"
end

When /^I scroll to the image with alt text "([^"]*)"$/ do |text|
  kaikifs.find_element(:xpath, "//*[@alt='#{text}']").location_once_scrolled_into_view
end

When /^I enlargen "([^"]*)"$/ do |text|
  kaikifs.enlargen :xpath, "//*[contains(text(), '#{text}')]"
end

When /^I requeue all of the documents$/ do
  kaikifs.record[:document_numbers].each do |document|
    kaikifs.record[:document_number] = document
    steps %{
    And I set the "Document ID" to the given document number
    And I click "get document"
    And I highlight the "Queue Document Requeuer" submit button
    And I sleep for "2" seconds
    And I click the "Queue Document Requeuer" submit button
    And I scroll to the image with alt text "Workflow"
    Then I should see "Document Requeuer was successfully scheduled"
    And I enlargen "Document Requeuer was successfully scheduled"
    }
  end
end
{'fraction_non_alphanumeric': 0.204500592183182, 'fraction_numerical': 0.0025661271219897357, 'mean_word_length': 4.133738601823708, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1075637', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1797, 'n_words': 453}