summaryrefslogtreecommitdiff
path: root/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/merge_request/user_sees_suggest_pipeline_spec.rb')
-rw-r--r--spec/features/merge_request/user_sees_suggest_pipeline_spec.rb38
1 files changed, 36 insertions, 2 deletions
diff --git a/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb b/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
index 93807512d9c..4bb6c3265a4 100644
--- a/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
+++ b/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
@@ -9,8 +9,6 @@ RSpec.describe 'Merge request > User sees suggest pipeline', :js do
before do
stub_application_setting(auto_devops_enabled: false)
- stub_experiment(suggest_pipeline: true)
- stub_experiment_for_user(suggest_pipeline: true)
project.add_maintainer(user)
sign_in(user)
visit project_merge_request_path(project, merge_request)
@@ -32,4 +30,40 @@ RSpec.describe 'Merge request > User sees suggest pipeline', :js do
expect(page).not_to have_content('Are you adding technical debt or code vulnerabilities?')
end
+
+ it 'runs tour from start to finish ensuring all nudges are executed' do
+ # nudge 1
+ expect(page).to have_content('Are you adding technical debt or code vulnerabilities?')
+
+ page.within '.mr-pipeline-suggest' do
+ find('[data-testid="ok"]').click
+ end
+
+ wait_for_requests
+
+ # nudge 2
+ expect(page).to have_content('Choose Code Quality to add a pipeline that tests the quality of your code.')
+
+ find('.js-gitlab-ci-yml-selector').click
+
+ wait_for_requests
+
+ within '.gitlab-ci-yml-selector' do
+ find('.dropdown-input-field').set('Jekyll')
+ find('.dropdown-content li', text: 'Jekyll').click
+ end
+
+ wait_for_requests
+
+ expect(page).not_to have_content('Choose Code Quality to add a pipeline that tests the quality of your code.')
+ # nudge 3
+ expect(page).to have_content('The template is ready!')
+
+ find('#commit-changes').click
+
+ wait_for_requests
+
+ # nudge 4
+ expect(page).to have_content("That's it, well done!")
+ end
end