diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/support/helpers/cycle_analytics_helpers.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/support/helpers/cycle_analytics_helpers.rb')
-rw-r--r-- | spec/support/helpers/cycle_analytics_helpers.rb | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index e48c8125d84..3ec52f8c832 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -23,12 +23,39 @@ module CycleAnalyticsHelpers end end + def select_event_label(sel) + page.within(sel) do + find('.dropdown-toggle').click + page.find(".dropdown-menu").all(".dropdown-item")[1].click + end + end + + def fill_in_custom_label_stage_fields + index = page.all('[data-testid="value-stream-stage-fields"]').length + last_stage = page.all('[data-testid="value-stream-stage-fields"]').last + + within last_stage do + find('[name*="custom-stage-name-"]').fill_in with: "Cool custom label stage - name #{index}" + select_dropdown_option_by_value "custom-stage-start-event-", :issue_label_added + select_dropdown_option_by_value "custom-stage-end-event-", :issue_label_removed + + select_event_label("[data-testid*='custom-stage-start-event-label-']") + select_event_label("[data-testid*='custom-stage-end-event-label-']") + end + end + def add_custom_stage_to_form page.find_button(s_('CreateValueStreamForm|Add another stage')).click fill_in_custom_stage_fields end + def add_custom_label_stage_to_form + page.find_button(s_('CreateValueStreamForm|Add another stage')).click + + fill_in_custom_label_stage_fields + end + def save_value_stream(custom_value_stream_name) fill_in 'create-value-stream-name', with: custom_value_stream_name @@ -44,12 +71,12 @@ module CycleAnalyticsHelpers save_value_stream(custom_value_stream_name) end - def wait_for_stages_to_load(selector = '.js-path-navigation') + def wait_for_stages_to_load(selector = '[data-testid="vsa-path-navigation"]') expect(page).to have_selector selector wait_for_requests end - def select_group(target_group, ready_selector = '.js-path-navigation') + def select_group(target_group, ready_selector = '[data-testid="vsa-path-navigation"]') visit group_analytics_cycle_analytics_path(target_group) wait_for_stages_to_load(ready_selector) |