mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 16:26:28 +08:00
d2efc84cba
Fixes an issue on mobile where navigating away from search and returning results in confusing UI where there are no results but headings says "N results found".
41 lines
782 B
Ruby
41 lines
782 B
Ruby
# 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
|
|
|
|
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?
|
|
within(".search-results") do
|
|
page.has_selector?(".fps-result", visible: true)
|
|
end
|
|
end
|
|
|
|
def is_search_page
|
|
has_css?("body.search-page")
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|