Test stabilization: Upload is sometimes faster than the button can be checked.
This commit is contained in:
parent
364f74f558
commit
5e4958e7ac
1 changed files with 14 additions and 4 deletions
|
@ -329,14 +329,15 @@ class AgentTicketAttachmentTest < TestCase
|
||||||
# First test the attachment uploading for new tickets
|
# First test the attachment uploading for new tickets
|
||||||
file_upload(
|
file_upload(
|
||||||
css: '.content.active .attachmentPlaceholder-inputHolder input',
|
css: '.content.active .attachmentPlaceholder-inputHolder input',
|
||||||
files: [Rails.root.join('test', 'data', 'upload', 'upload2.jpg')],
|
files: [large_file],
|
||||||
no_sleep: true,
|
no_sleep: true,
|
||||||
)
|
)
|
||||||
exists(
|
exists(
|
||||||
css: '.content.active .js-submit:disabled',
|
css: '.content.active .js-submit:disabled',
|
||||||
)
|
)
|
||||||
watch_for_disappear(
|
watch_for_disappear(
|
||||||
css: '.content.active .js-submit:disabled',
|
css: '.content.active .js-submit:disabled',
|
||||||
|
timeout: 4.minutes,
|
||||||
)
|
)
|
||||||
exists(
|
exists(
|
||||||
css: '.content.active .js-submit',
|
css: '.content.active .js-submit',
|
||||||
|
@ -355,14 +356,23 @@ class AgentTicketAttachmentTest < TestCase
|
||||||
)
|
)
|
||||||
file_upload(
|
file_upload(
|
||||||
css: '.content.active .attachmentPlaceholder-inputHolder input',
|
css: '.content.active .attachmentPlaceholder-inputHolder input',
|
||||||
files: [Rails.root.join('test', 'data', 'upload', 'upload2.jpg')],
|
files: [large_file],
|
||||||
no_sleep: true,
|
no_sleep: true,
|
||||||
)
|
)
|
||||||
exists(
|
exists(
|
||||||
css: '.content.active .js-submit:disabled',
|
css: '.content.active .js-submit:disabled',
|
||||||
)
|
)
|
||||||
watch_for_disappear(
|
watch_for_disappear(
|
||||||
css: '.content.active .js-submit:disabled',
|
css: '.content.active .js-submit:disabled',
|
||||||
|
timeout: 4.minutes,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def large_file
|
||||||
|
file = Tempfile.new
|
||||||
|
file.binmode
|
||||||
|
file.write(SecureRandom.random_bytes(6.megabyte))
|
||||||
|
file.close
|
||||||
|
file.path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue