Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/listbox_input_helper.rb')
-rw-r--r--spec/support/helpers/listbox_input_helper.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/support/helpers/listbox_input_helper.rb b/spec/support/helpers/listbox_input_helper.rb
new file mode 100644
index 00000000000..ca7fbac5daa
--- /dev/null
+++ b/spec/support/helpers/listbox_input_helper.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+module ListboxInputHelper
+ include WaitForRequests
+
+ def listbox_input(value, from:)
+ open_listbox_input(from) do
+ find('[role="option"]', text: value).click
+ end
+ end
+
+ def open_listbox_input(selector)
+ page.within(selector) do
+ page.find('button[aria-haspopup="listbox"]').click
+ yield
+ end
+ end
+end