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
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 15:08:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 15:08:49 +0300
commit1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (patch)
tree614a93d9bf8df34ecfc25c02648329987fb21dde /qa
parentf0707f413ce49b5712fca236b950acbec029be1e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/specs/features/api/2_plan/closes_issue_via_pushing_a_commit_spec.rb (renamed from qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb)26
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb4
2 files changed, 17 insertions, 13 deletions
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb b/qa/qa/specs/features/api/2_plan/closes_issue_via_pushing_a_commit_spec.rb
index 864e4d0edd0..f14fcc5afce 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb
+++ b/qa/qa/specs/features/api/2_plan/closes_issue_via_pushing_a_commit_spec.rb
@@ -2,35 +2,34 @@
module QA
context 'Plan' do
- describe 'Close issue' do
+ include Support::Api
+
+ describe 'Issue' do
let(:issue) do
Resource::Issue.fabricate_via_api!
end
let(:issue_id) { issue.api_response[:iid] }
- before do
- Flow::Login.sign_in
+ let(:api_client) { Runtime::API::Client.new(:gitlab) }
+ before do
# Initial commit should be pushed because
# the very first commit to the project doesn't close the issue
# https://gitlab.com/gitlab-org/gitlab-foss/issues/38965
push_commit('Initial commit')
end
- it 'closes an issue by pushing a commit' do
+ it 'closes via pushing a commit' do
push_commit("Closes ##{issue_id}", false)
- issue.visit!
-
- Page::Project::Issue::Show.perform do |show|
- reopen_issue_button_visible = show.wait_until(reload: true) do
- show.has_element?(:reopen_issue_button, wait: 1.0)
- end
- expect(reopen_issue_button_visible).to be_truthy
+ Support::Retrier.retry_until(max_duration: 10, sleep_interval: 1) do
+ issue_closed?
end
end
+ private
+
def push_commit(commit_message, new_branch = true)
Resource::Repository::ProjectPush.fabricate! do |push|
push.commit_message = commit_message
@@ -39,6 +38,11 @@ module QA
push.project = issue.project
end
end
+
+ def issue_closed?
+ response = get Runtime::API::Request.new(api_client, "/projects/#{issue.project.id}/issues/#{issue_id}").url
+ parse_body(response)[:state] == 'closed'
+ end
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb
index 1c741a2e8bf..7b4418191a3 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb
@@ -1,13 +1,13 @@
# frozen_string_literal: true
module QA
- context 'Plan', :smoke, :reliable do
+ context 'Plan', :smoke do
describe 'Issue creation' do
before do
Flow::Login.sign_in
end
- it 'creates an issue' do
+ it 'creates an issue', :reliable do
issue = Resource::Issue.fabricate_via_browser_ui!
Page::Project::Menu.perform(&:click_issues)