agent_ticket_create_attachment_missing_after_reload_test.rb 1.5 KB

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