diff options
author | Sven Kroell <sven.kroell@googlemail.com> | 2018-12-07 23:25:55 +0300 |
---|---|---|
committer | Sven Kroell <sven.kroell@googlemail.com> | 2018-12-11 16:06:49 +0300 |
commit | 1ecb30f24db62b96b4e08823017e839be28b03e8 (patch) | |
tree | ddb93f5da8f787d2590d3b78ca7e582d46ec035a | |
parent | f0ca0ad73c518be08d39eb613fbe85569d9e6184 (diff) |
add test
-rw-r--r-- | qa/qa/specs/features/browser_ui/1_manage/project/issue_gets_closed_after_push_spec.rb | 40 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/2_plan/issue/issue_gets_closed_after_push_spec.rb | 45 |
2 files changed, 45 insertions, 40 deletions
diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/issue_gets_closed_after_push_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/issue_gets_closed_after_push_spec.rb deleted file mode 100644 index 8ecee39ffbc..00000000000 --- a/qa/qa/specs/features/browser_ui/1_manage/project/issue_gets_closed_after_push_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -module QA - context 'Manage' do - let(:issue_title) {'issue for to close'} - - describe 'e' do - - - def push_file(issue_id) - Resource::Repository::ProjectPush.fabricate! do |push| - push.file_name = 'README.md' - push.file_content = '# This is a test project' - push.commit_message = "Closes ##{issue_id}" - end - end - - def create_issue - Runtime::Browser.visit(:gitlab, Page::Main::Login) - Page::Main::Login.act {sign_in_using_credentials} - - Resource::Issue.fabricate! do |issue| - issue.title = issue_title - end - end - - def issue_id - Page::Project::Issue::Show.act { - issue_id - } - end - - it 'does something' do - create_issue - - puts issue_id - end - - - end - end -end diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/issue_gets_closed_after_push_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/issue_gets_closed_after_push_spec.rb new file mode 100644 index 00000000000..8c2d4d7095b --- /dev/null +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/issue_gets_closed_after_push_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +require 'ffaker' + +module QA + context 'Plan' do + let(:issue_title) {'issue to close'} + + describe 'Issues' do + it 'closes the issue after pushing a commit' do + Runtime::Browser.visit(:gitlab, Page::Main::Login) + Page::Main::Login.act {sign_in_using_credentials} + Resource::Issue.fabricate! do |issue| + issue.title = issue_title + end + issue_id = Page::Project::Issue::Show.perform(&:issue_id) + # It is necessary to initiate an initial commit - as the first push into a repository doesn't trigger the closing + # https://gitlab.com/gitlab-org/gitlab-ce/issues/54722 + push_file("initial commit", "firstfile") + + push_file("Closes ##{issue_id}", "secondfile") + commit_sha = Page::File::Show.perform(&:commit_sha) + Page::Project::Menu.act {click_issues} + Page::Project::Issue::Index.perform do |page| + page.show_closed_issues + page.go_to_issue(issue_title) + end + + Page::Project::Issue::Show.perform do |page| + expect(page.first_note_header).to have_content("@#{Runtime::User.username} closed via commit #{commit_sha}") + end + end + + def push_file(commit_message, filename) + Page::Project::Menu.act {click_project} + Page::Project::Show.act {create_new_file!} + Page::File::Form.perform do |page| + page.add_name(filename) + page.add_content(FFaker::Lorem.phrase) + page.add_commit_message(commit_message) + page.commit_changes + end + end + end + end +end |