<commit_before>Given(/^I search for a property using the Title Number$/) do
  page.visit("#{$DIGITAL_REGISTER_URL}/title-search")
  fill_in 'search_term', with: @title[:title_number]
  click_button('Search')
end

Then(/^only the information for the selected Title Number will be displayed$/) do
  expect(content).to include(@title[:title_number])
end

Given(/^I have an address with a single Title Number$/) do
  insert_title_with_owners
end

Given(/^I search for a property using (?:the|their) postcode$/) do
  fill_in 'search_term', with: @title[:postcode]
  click_button('Search')
end

Given(/^I search for a property entering a postcode with no spaces$/) do
  fill_in 'search_term', with: 'PL98TB'
  click_button('Search')
end

Given(/^I search for a property using no search term$/) do
  click_button('Search')
end

Then(/^the address and related title number is displayed$/) do
  expect(content).to include(@title[:postcode])
  expect(content).to include(@title[:title_number])
end

Then(/^I can then view the title register$/) do
  click_link(@title[:address_string])
end<commit_msg>Refactor step definition for view register<commit_after>Given(/^I search for a property using the Title Number$/) do
  page.visit("#{$DIGITAL_REGISTER_URL}/title-search")
  fill_in 'search_term', with: @title[:title_number]
  click_button('Search')
end

Then(/^only the information for the selected Title Number will be displayed$/) do
  expect(content).to include(@title[:title_number])
end

Given(/^I have an address with a single Title Number$/) do
  insert_title_with_owners
end

Given(/^I search for a property using (?:the|their) postcode$/) do
  fill_in 'search_term', with: @title[:postcode]
  click_button('Search')
end

Given(/^I search for a property entering a postcode with no spaces$/) do
  fill_in 'search_term', with: 'PL98TB'
  click_button('Search')
end

Given(/^I search for a property using no search term$/) do
  click_button('Search')
end

Then(/^the address and related title number is displayed$/) do
  expect(content).to include(@title[:postcode])
  expect(content).to include(@title[:title_number])
end

Then(/^I can then view the title register$/) do
  click_link(@title[:address_string])
  expect(content).to include(@title[:title_number])
  expect(content).to include(@title[:proprietors][0][:name])
end
{'fraction_non_alphanumeric': 0.12876830318690785, 'fraction_numerical': 0.002153316106804479, 'mean_word_length': 5.637142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '136452', 'n_tokens_mistral': 732, 'n_tokens_neox': 712, 'n_words': 234}