mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 05:03:04 +08:00
In this PR we hide search input. https://github.com/discourse/discourse/pull/32485 However, search input is much more intuitive. Therefore, input was brought back and opens modal on click. In addition, search link was removed.
25 lines
595 B
Ruby
Vendored
25 lines
595 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class AdminSearch < PageObjects::Modals::Base
|
|
MODAL_SELECTOR = ".admin-search-modal"
|
|
|
|
def search(query)
|
|
find(".admin-search__input-field").fill_in(with: query)
|
|
end
|
|
|
|
def find_result(type, position)
|
|
all(".admin-search__result[data-result-type='#{type}']")[position]
|
|
end
|
|
|
|
def input_enter
|
|
find(".admin-search__input-field").send_keys(:enter)
|
|
end
|
|
|
|
def click_switch_to_full_page
|
|
find(".admin-search__full-page-link").click
|
|
end
|
|
end
|
|
end
|
|
end
|