summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-08-19 23:07:09 -0700
committerStan Hu <stanhu@gmail.com>2018-08-20 11:56:23 -0700
commit00aa4d4c8c57a2f305070c2f9cb86fde6bc14285 (patch)
treee063f61a3b15298ead5703220b526014dc1f85c4 /qa
parent00baed8cb0725f7e05e6dab4e498acf2b425a5b2 (diff)
downloadgitlab-ce-00aa4d4c8c57a2f305070c2f9cb86fde6bc14285.tar.gz
Add basic QA test for testing attachment uploads
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb1
-rw-r--r--qa/qa/scenario/test/integration/object_storage.rb13
-rw-r--r--qa/qa/specs/features/project/create_issue_spec.rb29
3 files changed, 42 insertions, 1 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 0b48cf58766..80cfd142a40 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -91,6 +91,7 @@ module QA
autoload :LDAP, 'qa/scenario/test/integration/ldap'
autoload :Kubernetes, 'qa/scenario/test/integration/kubernetes'
autoload :Mattermost, 'qa/scenario/test/integration/mattermost'
+ autoload :ObjectStorage, 'qa/scenario/test/integration/object_storage'
end
module Sanity
diff --git a/qa/qa/scenario/test/integration/object_storage.rb b/qa/qa/scenario/test/integration/object_storage.rb
new file mode 100644
index 00000000000..874789db20d
--- /dev/null
+++ b/qa/qa/scenario/test/integration/object_storage.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module QA
+ module Scenario
+ module Test
+ module Integration
+ class ObjectStorage < Test::Instance
+ tags :object_storage
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/specs/features/project/create_issue_spec.rb b/qa/qa/specs/features/project/create_issue_spec.rb
index ac2ed2ca2a1..6c62a1026b2 100644
--- a/qa/qa/specs/features/project/create_issue_spec.rb
+++ b/qa/qa/specs/features/project/create_issue_spec.rb
@@ -2,17 +2,44 @@ module QA
describe 'creates issue', :core do
let(:issue_title) { 'issue title' }
- it 'user creates issue' do
+ def create_issue
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
Factory::Resource::Issue.fabricate! do |issue|
issue.title = issue_title
end
+ end
+
+ it 'user creates issue' do
+ create_issue
Page::Menu::Side.act { click_issues }
expect(page).to have_content(issue_title)
end
+
+ describe 'with attachments', :object_storage do
+ let(:file_to_attach) { File.absolute_path(File.join('spec', 'fixtures', 'banana_sample.gif')) }
+
+ it 'user comments on an issue with an attachment' do
+ create_issue
+
+ Page::Project::Issue::Show.perform do |show|
+ show.comment('See attached banana for scale', attachment: file_to_attach)
+ end
+
+ image_url = find('a[href$="banana_sample.gif"]')[:href]
+
+ Page::Project::Issue::Show.perform do |show|
+ # Wait for attachment to upload
+ found = show.wait(reload: false) do
+ show.asset_exists?(image_url)
+ end
+
+ expect(found).to be_truthy
+ end
+ end
+ end
end
end