summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorWalmyr Lima <walmyr@gitlab.com>2019-07-19 16:06:21 +0200
committerWalmyr Lima <walmyr@gitlab.com>2019-07-19 16:19:38 +0200
commit0d45894bc6dd18dec4cb69ac4fff3a940bab19e6 (patch)
tree6bf81707d1564155604b99bb0f0400522e4063e9 /qa
parent4c30b0a1cf5ead26d20845b82ae528fcbdf98728 (diff)
downloadgitlab-ce-0d45894bc6dd18dec4cb69ac4fff3a940bab19e6.tar.gz
Refactor create issue end-to-end testqa/refactor-create-issue-e2e-test
This refactor: - Moves the tests pre-conditions to a before blocks - Creates an issue via the api for the second test to improve the test suite performance
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb28
1 files changed, 16 insertions, 12 deletions
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 342f65593f6..04ae4963d3a 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
@@ -5,8 +5,15 @@ module QA
describe 'Issue creation' do
let(:issue_title) { 'issue title' }
+ before do
+ Runtime::Browser.visit(:gitlab, Page::Main::Login)
+ Page::Main::Login.perform(&:sign_in_using_credentials)
+ end
+
it 'user creates an issue' do
- create_issue
+ Resource::Issue.fabricate_via_browser_ui! do |issue|
+ issue.title = issue_title
+ end
Page::Project::Menu.perform(&:click_issues)
@@ -18,9 +25,15 @@ module QA
File.absolute_path(File.join('spec', 'fixtures', 'banana_sample.gif'))
end
- it 'user comments on an issue with an attachment' do
- create_issue
+ before do
+ issue = Resource::Issue.fabricate_via_api! do |issue|
+ issue.title = issue_title
+ end
+
+ issue.visit!
+ end
+ it 'user comments on an issue with an attachment' do
Page::Project::Issue::Show.perform do |show|
show.comment('See attached banana for scale', attachment: file_to_attach)
@@ -36,15 +49,6 @@ module QA
end
end
end
-
- def create_issue
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.perform(&:sign_in_using_credentials)
-
- Resource::Issue.fabricate_via_browser_ui! do |issue|
- issue.title = issue_title
- end
- end
end
end
end