Given 'I am on the Google Home Page' do @search_page = visit <%= name.split('_').map(&:capitalize).join %>::Home @search_data = @search_page.data_for(:search) end When 'I submit a search' do @search_page.search(@search_data['search_input']) end Then 'I should see the results displayed' do results_page = on <%= name.split('_').map(&:capitalize).join %>::Results expect(results_page.first_result).to include @search_data['first_result'] end