<commit_before>When(/^I change the state for "(.*?)" to "(.*?)"$/) do |pkg, state|
  # Give a package name and state {"Unmanaged","Installed", "Removed"}
  within(:xpath, "//td[contains(text(), '#{pkg}')]/ancestor::tr") do   #[td[contains(text(), '#{architecture}')]])"  
  end
end

When(/^I list packages with "(.*?)"$/) do |str|
  find('input#package-search').set(str)
  find('button#search').click
end

When(/^I change the state of "([^"]*)" to "([^"]*)" and "([^"]*)"$/) do |pkg, state, instd_state|
  # state is Installed + {Any, Latest}, Removed or Unmanaged  instd_state is not required
  # but must an emptry string must be given.
  within('#milkyway-dummy-row') do
    #select(state, :from => "#{pkg}-pkg-state")
    find(:xpath, ".//option[contains(text(), #{state})]").click
    if ! instd_state.to_s.empty?
      #select(instd_state, :from => "#{pkg}-version-constraint")
    end
    within('button#changes') do
    end
  end
end

When(/^I click undo for "(.*?)"$/) do |pkg|
  find("button#{pkg}-undo").click
end

When(/^I click the$/) do
end<commit_msg>simplify the step definition<commit_after>When(/^I change the state for "(.*?)" to "(.*?)"$/) do |pkg, state|
  # Give a package name and state {"Unmanaged","Installed", "Removed"}
  within(:xpath, "//td[contains(text(), '#{pkg}')]/ancestor::tr") do   #[td[contains(text(), '#{architecture}')]])"  
  end
end

When(/^I list packages with "(.*?)"$/) do |str|
  find('input#package-search').set(str)
  find('button#search').click
end

When(/^I change the state of "([^"]*)" to "([^"]*)" and "([^"]*)"$/) do |pkg, state, instd_state|
  find("##{pkg}-pkg-state").select(state)
end

When(/^I click undo for "(.*?)"$/) do |pkg|
  find("button##{pkg}-undo").click
end

When(/^I click the$/) do
end
{'fraction_non_alphanumeric': 0.24715261958997722, 'fraction_numerical': 0.0, 'mean_word_length': 4.456521739130435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '669210', 'n_tokens_mistral': 647, 'n_tokens_neox': 640, 'n_words': 159}