-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e56d122
commit 8cc2b12
Showing
4 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module CustomAutoCompleteSelect | ||
def custom_autocomplete_select(value, from:) | ||
within("div[data-autocomplete-for='#{from}']") do | ||
find(".autocomplete-input").click | ||
find(".autocomplete-input").native.send_keys(value[0..4]) | ||
|
||
dynamic_list_id = find("[id^=autoComplete_list]")[:id] | ||
|
||
expect(page).to have_css("##{dynamic_list_id}") # select should be open now | ||
|
||
expect(page).to have_css("#autoComplete_result_0", text: value) | ||
find("#autoComplete_result_0", text: value).hover | ||
expect(page).to have_css("#autoComplete_result_0", text: value) | ||
find("#autoComplete_result_0", text: value).click | ||
expect(page).to have_css(".autocomplete__selected-item", text: value) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters