diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-16 12:09:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-16 12:09:12 +0000 |
commit | cbfe03ae04a52d9825ff7cbeccdfe5d313adf6a2 (patch) | |
tree | e4879b35d019d3bbba1689f3ac4c48b81bf7b451 /qa | |
parent | 3fd97b4bba24ca412112aad025a38a32c7a6cf8c (diff) | |
download | gitlab-ce-cbfe03ae04a52d9825ff7cbeccdfe5d313adf6a2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/page/merge_request/show.rb | 5 | ||||
-rw-r--r-- | qa/qa/page/project/web_ide/edit.rb | 15 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb | 42 |
3 files changed, 62 insertions, 0 deletions
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index b69990bae9c..0da40b35938 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -14,6 +14,7 @@ module QA element :dropdown_toggle element :download_email_patches element :download_plain_diff + element :open_in_web_ide_button end view 'app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue' do @@ -219,6 +220,10 @@ module QA def wait_for_loading finished_loading? && has_no_element?(:skeleton_note) end + + def click_open_in_web_ide + click_element :open_in_web_ide_button + end end end end diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb index 73b0856b445..a9b82ac6046 100644 --- a/qa/qa/page/project/web_ide/edit.rb +++ b/qa/qa/page/project/web_ide/edit.rb @@ -48,6 +48,10 @@ module QA element :start_new_mr_checkbox end + view 'app/assets/javascripts/ide/components/repo_editor.vue' do + element :editor_container + end + def has_file?(file_name) within_element(:file_list) do page.has_content? file_name @@ -113,6 +117,17 @@ module QA raise "The changes do not appear to have been committed successfully." unless commit_success_msg_shown end + + def add_to_modified_content(content) + finished_loading? + modified_text_area.set content + end + + def modified_text_area + within_element(:editor_container) do + find('.modified textarea.inputarea') + end + end end end end diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb new file mode 100644 index 00000000000..c37ad6d4318 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module QA + context 'Create', quarantine: { type: :new } do + describe 'Review a merge request in Web IDE' do + let(:new_file) { 'awesome_new_file.txt' } + let(:review_text) { 'Reviewed ' } + + let(:merge_request) do + Resource::MergeRequest.fabricate_via_api! do |mr| + mr.file_name = new_file + mr.file_content = 'Text' + end + end + + before do + Flow::Login.sign_in + + merge_request.visit! + end + + it 'opens and edits a merge request in Web IDE' do + Page::MergeRequest::Show.perform do |show| + show.click_open_in_web_ide + end + + Page::Project::WebIDE::Edit.perform do |ide| + ide.has_file?(new_file) + ide.add_to_modified_content(review_text) + ide.commit_changes + end + + merge_request.visit! + + Page::MergeRequest::Show.perform do |show| + show.click_diffs_tab + expect(show).to have_content(review_text) + end + end + end + end +end |