Files
discourse/spec/system/page_objects/modals/admin_search.rb
Martin Brennan 8325d42e56 FEATURE: Experimental admin search refinements round 1 (#31441)
Followup e26a1175d7c33746bddbc858ad89e68cc14beefe

Adds extra functionality and tests for the admin search modal.

* Show third level plugin config pages in search, e.g.  AI Usage
* Remember last used search filters
* Allow navigating search results with keyboard, using tab or up/down
and enter to go to result
* Add a placeholder beneath search input to tell the admin what to do
* Add a full page search at `/admin/search` which can be reached from
pressing Enter on the search input
* Add specs for modal and full page search
* Change admin sidebar filter "no results found" to point to full page
search
* Add keyboard shortcut help to modal for admin search
2025-03-03 13:56:07 +10:00

22 lines
496 B
Ruby

# 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
end
end
end