diff options
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa.rb | 1 | ||||
-rw-r--r-- | qa/qa/page/view.rb | 4 | ||||
-rw-r--r-- | qa/qa/scenario/test/integration/object_storage.rb | 13 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb | 30 |
4 files changed, 46 insertions, 2 deletions
@@ -94,6 +94,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/page/view.rb b/qa/qa/page/view.rb index b2a2da4dbf3..c59fad2e223 100644 --- a/qa/qa/page/view.rb +++ b/qa/qa/page/view.rb @@ -1,3 +1,5 @@ +require 'pathname' + module QA module Page class View @@ -9,7 +11,7 @@ module QA end def pathname - @pathname ||= Pathname.new(::File.join(__dir__, '../../../', @path)) + @pathname ||= ::Pathname.new(::File.join(__dir__, '../../../', @path)) .cleanpath.expand_path end 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/browser_ui/2_plan/issue/create_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb index dd1be935220..542f532a629 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,18 +5,46 @@ module QA describe 'Issue creation' do let(:issue_title) { 'issue title' } - it 'user creates an 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 an issue' do + create_issue Page::Menu::Side.act { click_issues } expect(page).to have_content(issue_title) end + + context 'when using attachments in comments', :object_storage do + let(:file_to_attach) do + File.absolute_path(File.join('spec', 'fixtures', 'banana_sample.gif')) + end + + 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) + + show.refresh + + image_url = find('a[href$="banana_sample.gif"]')[:href] + + found = show.wait(reload: false) do + show.asset_exists?(image_url) + end + + expect(found).to be_truthy + end + end + end end end end |