agent_ticket_update_with_attachment_refresh_test.rb 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. require 'browser_test_helper'
  2. # https://github.com/zammad/zammad/issues/1123
  3. # Make sure attachment is shown after reloading an in-progress ticket update
  4. class AgentTicketUpdateWithAttachmentRefreshTest < TestCase
  5. def test_attachment_after_refresh
  6. @browser = browser_instance
  7. login(
  8. username: 'agent1@example.com',
  9. password: 'test',
  10. url: browser_url,
  11. )
  12. #
  13. # attachment checks - existing ticket
  14. #
  15. # create new ticket with no attachment, attachment check should pop up
  16. ticket_create(
  17. data: {
  18. customer: 'nico',
  19. group: 'Users',
  20. title: 'test 6 - ticket 1',
  21. body: 'test 6 - ticket 1 body',
  22. },
  23. )
  24. sleep 1
  25. # fill body
  26. ticket_update(
  27. data: {
  28. body: 'keep me',
  29. },
  30. do_not_submit: true,
  31. )
  32. # since selenium webdriver with firefox is not able to upload files, skipp here
  33. # https://github.com/w3c/webdriver/issues/1230
  34. return if browser == 'firefox'
  35. # add attachment, attachment check should quiet
  36. file_upload(
  37. css: '.content.active .attachmentPlaceholder-inputHolder input',
  38. files: ['test/data/upload/upload1.txt'],
  39. )
  40. sleep 2
  41. # check if attachment is shown
  42. match(
  43. css: '.content.active .ticketZoom .attachments .attachment:nth-child(1) .attachment-name',
  44. value: 'upload1.txt'
  45. )
  46. @browser.navigate.refresh
  47. sleep 1
  48. # check if attachment is shown
  49. match(
  50. css: '.content.active .ticketZoom .attachments .attachment:nth-child(1) .attachment-name',
  51. value: 'upload1.txt'
  52. )
  53. end
  54. end