2022-12-13 09:50:44 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PageObjects
|
|
|
|
module Pages
|
|
|
|
class Search < PageObjects::Pages::Base
|
|
|
|
def type_in_search(input)
|
|
|
|
find("input.full-page-search").send_keys(input)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2023-01-27 13:05:27 -05:00
|
|
|
def clear_search_input
|
|
|
|
find("input.full-page-search").set("")
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2022-12-13 09:50:44 -05:00
|
|
|
def heading_text
|
|
|
|
find("h1.search-page-heading").text
|
|
|
|
end
|
|
|
|
|
|
|
|
def click_search_button
|
|
|
|
find(".search-cta").click
|
|
|
|
end
|
|
|
|
|
|
|
|
def click_home_logo
|
|
|
|
find(".d-header .logo-mobile").click
|
|
|
|
end
|
|
|
|
|
|
|
|
def click_search_icon
|
|
|
|
find(".d-header #search-button").click
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_search_result?
|
2023-01-30 15:47:44 -05:00
|
|
|
page.has_selector?(".search-results .fps-result")
|
2022-12-13 09:50:44 -05:00
|
|
|
end
|
|
|
|
|
2023-01-27 13:05:27 -05:00
|
|
|
def has_warning_message?
|
2023-01-30 15:47:44 -05:00
|
|
|
page.has_selector?(".search-results .warning")
|
2023-01-27 13:05:27 -05:00
|
|
|
end
|
|
|
|
|
2022-12-13 09:50:44 -05:00
|
|
|
def is_search_page
|
|
|
|
has_css?("body.search-page")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|