agent_ticket_email_reply_keep_body_test.rb 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # encoding: utf-8
  2. require 'browser_test_helper'
  3. class AgentTicketEmailReplyKeepBodyTest < TestCase
  4. def test_reply_message_keep_body
  5. # merge ticket with closed tab
  6. @browser = browser_instance
  7. login(
  8. username: 'agent1@example.com',
  9. password: 'test',
  10. url: browser_url,
  11. )
  12. tasks_close_all()
  13. # create new ticket
  14. ticket1 = ticket_create(
  15. data: {
  16. customer: 'nico',
  17. group: 'Users',
  18. title: 'some subject 123äöü - reply test',
  19. body: 'some body 123äöü - reply test',
  20. },
  21. )
  22. sleep 1
  23. # fill body
  24. ticket_update(
  25. data: {
  26. body: 'keep me',
  27. },
  28. do_not_submit: true,
  29. )
  30. # scroll to reply - needed for chrome
  31. scroll_to(
  32. position: 'botton',
  33. css: '.content.active [data-type="emailReply"]',
  34. )
  35. # click reply
  36. click(css: '.content.active [data-type="emailReply"]')
  37. # check body
  38. watch_for(
  39. css: '.content.active .js-reset',
  40. value: '(Discard your unsaved changes.|Verwerfen der)',
  41. no_quote: true,
  42. )
  43. # check body
  44. ticket_verify(
  45. data: {
  46. body: 'keep me',
  47. },
  48. )
  49. # scroll to reply - needed for chrome
  50. sleep 5
  51. scroll_to(
  52. position: 'botton',
  53. css: '.content.active [data-type="emailReply"]',
  54. )
  55. # click reply
  56. click(css: '.content.active [data-type="emailReply"]')
  57. # check body
  58. watch_for(
  59. css: '.content.active .js-reset',
  60. value: '(Discard your unsaved changes.|Verwerfen der)',
  61. no_quote: true,
  62. )
  63. # check body
  64. ticket_verify(
  65. data: {
  66. body: 'keep me',
  67. },
  68. )
  69. end
  70. end