abb_one_group_test.rb 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. # encoding: utf-8
  2. require 'browser_test_helper'
  3. class AgentTicketActionLevel0Test < TestCase
  4. def test_aaa_agent_ticket_create_with_one_group
  5. agent = "bob.smith_one_group#{rand(99_999_999)}"
  6. @browser = browser_instance
  7. login(
  8. username: 'master@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: '-NONE-',
  18. title: 'some subject 123äöü - one group 1',
  19. body: 'some body 123äöü - one group 1',
  20. },
  21. )
  22. sleep 1
  23. # update ticket
  24. ticket_update(
  25. data: {
  26. State: 'closed',
  27. Group: '-NONE-',
  28. body: 'some body 1234 äöüß - one group 1 - update',
  29. },
  30. )
  31. tasks_close_all()
  32. # invite agent (with one group)
  33. click(
  34. css: '#navigation a[href="#dashboard"]',
  35. )
  36. click(
  37. css: '.active.content .tab[data-area="first-steps-widgets"]',
  38. )
  39. watch_for(
  40. css: '.active.content',
  41. value: 'Configuration',
  42. )
  43. click(
  44. css: '.active.content .js-inviteAgent',
  45. )
  46. sleep 4
  47. set(
  48. css: '.modal [name="firstname"]',
  49. value: 'Bob',
  50. )
  51. set(
  52. css: '.modal [name="lastname"]',
  53. value: 'Smith',
  54. )
  55. set(
  56. css: '.modal [name="email"]',
  57. value: "#{agent}@example.com",
  58. )
  59. exists_not(
  60. css: '.modal select[name="group_ids"]',
  61. )
  62. click(
  63. css: '.modal button.btn.btn--primary',
  64. fast: true,
  65. )
  66. watch_for(
  67. css: 'body div.modal',
  68. value: 'Sending',
  69. )
  70. watch_for_disappear(
  71. css: 'body div.modal',
  72. value: 'Sending',
  73. )
  74. end
  75. def test_bbb_customer_ticket_create_with_one_group
  76. @browser = browser_instance
  77. login(
  78. username: 'nicole.braun@zammad.org',
  79. password: 'test',
  80. url: browser_url,
  81. )
  82. # customer ticket create
  83. click(css: 'a[href="#new"]')
  84. click(css: 'a[href="#customer_ticket_new"]')
  85. sleep 2
  86. exists_not(
  87. css: '.newTicket select[name="group_id"]',
  88. )
  89. set(
  90. css: '.newTicket input[name="title"]',
  91. value: 'one group',
  92. )
  93. set(
  94. css: '.newTicket [data-name="body"]',
  95. value: 'one group body',
  96. )
  97. click(css: '.newTicket button.js-submit')
  98. sleep 5
  99. # check if ticket is shown
  100. location_check(url: '#ticket/zoom/')
  101. match(
  102. css: '.active div.ticket-article',
  103. value: 'one group body',
  104. no_quote: true,
  105. )
  106. # update ticket
  107. set(
  108. css: '.active [data-name="body"]',
  109. value: 'one group - some body 1234 äöüß',
  110. no_click: true,
  111. )
  112. task_type(
  113. type: 'stayOnTab',
  114. )
  115. click(css: '.active .js-submit')
  116. watch_for(
  117. css: '.active div.ticket-article',
  118. value: 'one group - some body 1234 äöüß',
  119. )
  120. end
  121. def test_ccc_agent_ticket_create_with_more_groups
  122. @browser = browser_instance
  123. login(
  124. username: 'master@example.com',
  125. password: 'test',
  126. url: browser_url,
  127. )
  128. tasks_close_all()
  129. group_create(
  130. data: {
  131. name: "some group #{rand(999_999_999)}",
  132. member: [
  133. 'master@example.com',
  134. 'agent1@example.com',
  135. ],
  136. },
  137. )
  138. # create new ticket
  139. ticket1 = ticket_create(
  140. data: {
  141. customer: 'nico',
  142. group: 'Users',
  143. title: 'some subject 123äöü - one group 2',
  144. body: 'some body 123äöü - one group 2',
  145. },
  146. )
  147. sleep 1
  148. # update ticket
  149. ticket_update(
  150. data: {
  151. body: 'some body 1234 äöüß - one group 2 - update',
  152. Group: 'Users',
  153. },
  154. )
  155. tasks_close_all()
  156. end
  157. end