Commit 77137a29 authored by Sanad Liaquat's avatar Sanad Liaquat

Modify Page::Component::Select2 to work with search and remove Select2Search

parent 61a5199f
......@@ -276,7 +276,6 @@ module QA
autoload :GroupsFilter, 'qa/page/component/groups_filter'
autoload :Select2, 'qa/page/component/select2'
autoload :DropdownFilter, 'qa/page/component/dropdown_filter'
autoload :Select2Search, 'qa/page/component/select2_search'
autoload :UsersSelect, 'qa/page/component/users_select'
module Issuable
......
......@@ -6,7 +6,7 @@ module QA
module Group
module Settings
class LDAPSync < ::QA::Page::Base
include QA::Page::Component::Select2Search
include QA::Page::Component::Select2
view 'ee/app/views/ldap_group_links/_form.html.haml' do
element :ldap_group_cn_select
......
......@@ -3,7 +3,12 @@ module QA
module Component
module Select2
def select_item(item_text)
find('ul.select2-result-sub > li', text: item_text).click
find('.select2-result-label', text: item_text).click
end
def search_and_select(item_text)
find('.select2-input').set(item_text)
select_item(item_text)
end
end
end
......
# frozen_string_literal: true
module QA
module Page
module Component
module Select2Search
def search_and_select(item)
wait(reload: false) do
page.has_css?('.select2-input')
end
find('.select2-input').set(item)
find('.select2-result-label', text: item).click
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment