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/cycle_analytics_helpers.rb')
-rw-r--r--spec/support/helpers/cycle_analytics_helpers.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb
index 6d3ac699a7c..a90cbbf3bd3 100644
--- a/spec/support/helpers/cycle_analytics_helpers.rb
+++ b/spec/support/helpers/cycle_analytics_helpers.rb
@@ -3,6 +3,32 @@
module CycleAnalyticsHelpers
include GitHelpers
+ def wait_for_stages_to_load
+ expect(page).to have_selector '.js-stage-table'
+ wait_for_requests
+ end
+
+ def select_group(target_group)
+ visit group_analytics_cycle_analytics_path(target_group)
+
+ wait_for_stages_to_load
+ end
+
+ def toggle_dropdown(field)
+ page.within("[data-testid='#{field}']") do
+ find('.dropdown-toggle').click
+
+ wait_for_requests
+
+ expect(find('.dropdown-menu')).to have_selector('.dropdown-item')
+ end
+ end
+
+ def select_dropdown_option_by_value(name, value, elem = '.dropdown-item')
+ toggle_dropdown name
+ page.find("[data-testid='#{name}'] .dropdown-menu").find("#{elem}[value='#{value}']").click
+ end
+
def create_commit_referencing_issue(issue, branch_name: generate(:branch))
project.repository.add_branch(user, branch_name, 'master')
create_commit("Commit for ##{issue.iid}", issue.project, user, branch_name)