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/features/sorting_helpers.rb')
-rw-r--r--spec/support/helpers/features/sorting_helpers.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/support/helpers/features/sorting_helpers.rb b/spec/support/helpers/features/sorting_helpers.rb
index 8dda16af625..0ea7c5432fb 100644
--- a/spec/support/helpers/features/sorting_helpers.rb
+++ b/spec/support/helpers/features/sorting_helpers.rb
@@ -22,9 +22,11 @@ module Features
# pajamas_sort_by is used to sort new pajamas dropdowns. When
# all of the dropdowns are converted, pajamas_sort_by can be renamed to sort_by
# https://gitlab.com/groups/gitlab-org/-/epics/7551
- def pajamas_sort_by(value)
- find('.filter-dropdown-container .gl-new-dropdown').click
- find('.gl-new-dropdown-item', text: value).click
+ def pajamas_sort_by(value, from: nil)
+ raise ArgumentError, 'The :from option must be given' if from.nil?
+
+ click_button from
+ find('[role="option"]', text: value).click
end
end
end