Commit f67dbc4c authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho Committed by Ramya Authappan

Simplify test that attaches a file on an issue

parent bcdc423d
...@@ -108,6 +108,10 @@ module QA ...@@ -108,6 +108,10 @@ module QA
find_element(:more_assignees_link) find_element(:more_assignees_link)
end end
def noteable_note_item
find_element(:noteable_note_item)
end
def select_all_activities_filter def select_all_activities_filter
select_filter_with_text('Show all activity') select_filter_with_text('Show all activity')
end end
......
...@@ -21,8 +21,9 @@ module QA ...@@ -21,8 +21,9 @@ module QA
end end
context 'when using attachments in comments', :object_storage do context 'when using attachments in comments', :object_storage do
let(:gif_file_name) { 'banana_sample.gif' }
let(:file_to_attach) do let(:file_to_attach) do
File.absolute_path(File.join('spec', 'fixtures', 'banana_sample.gif')) File.absolute_path(File.join('spec', 'fixtures', gif_file_name))
end end
before do before do
...@@ -37,15 +38,7 @@ module QA ...@@ -37,15 +38,7 @@ module QA
Page::Project::Issue::Show.perform do |show| Page::Project::Issue::Show.perform do |show|
show.comment('See attached banana for scale', attachment: file_to_attach) show.comment('See attached banana for scale', attachment: file_to_attach)
show.refresh expect(show.noteable_note_item.find("img[src$='#{gif_file_name}']")).to be_visible
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment