agent_ticket_create_attachment_missing_after_reload_test.rb 1.6 KB

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