abb_one_group_test.rb 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  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#{SecureRandom.uuid}"
  6. @browser = browser_instance
  7. login(
  8. username: 'admin@example.com',
  9. password: 'test',
  10. url: browser_url,
  11. )
  12. tasks_close_all
  13. # create new ticket
  14. 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(css: '#navigation a[href="#dashboard"]')
  34. click(css: '.active.content .tab[data-area="first-steps-widgets"]')
  35. watch_for(
  36. css: '.active.content',
  37. value: 'Configuration',
  38. )
  39. click(css: '.active.content .js-inviteAgent')
  40. modal_ready
  41. set(
  42. css: '.modal [name="firstname"]',
  43. value: 'Bob',
  44. )
  45. set(
  46. css: '.modal [name="lastname"]',
  47. value: 'Smith',
  48. )
  49. set(
  50. css: '.modal [name="email"]',
  51. value: "#{agent}@example.com",
  52. )
  53. check(css: '.modal .js-groupListItem[value=full]')
  54. click(
  55. css: '.modal button.btn.btn--primary',
  56. fast: true,
  57. ajax: false,
  58. )
  59. watch_for_disappear(
  60. css: 'body div.modal',
  61. value: 'Sending',
  62. )
  63. click(css: '#navigation a[href="#dashboard"]')
  64. click(css: '.active.content .tab[data-area="first-steps-widgets"]')
  65. watch_for(
  66. css: '.active.content',
  67. value: 'Configuration',
  68. )
  69. click(css: '.active.content .js-inviteAgent')
  70. modal_ready
  71. set(
  72. css: '.modal [name="firstname"]',
  73. value: 'Bob2',
  74. )
  75. set(
  76. css: '.modal [name="lastname"]',
  77. value: 'Smith2',
  78. )
  79. set(
  80. css: '.modal [name="email"]',
  81. value: "#{agent}2@example.com",
  82. )
  83. check(css: '.modal .js-groupListItem[value=full]')
  84. click(
  85. css: '.modal button.btn.btn--primary',
  86. fast: true,
  87. ajax: false,
  88. )
  89. watch_for_disappear(
  90. css: 'body div.modal',
  91. value: 'Sending',
  92. )
  93. tasks_close_all
  94. end
  95. def test_bbb_customer_ticket_create_with_one_group
  96. @browser = browser_instance
  97. login(
  98. username: 'nicole.braun@zammad.org',
  99. password: 'test',
  100. url: browser_url,
  101. )
  102. # customer ticket create
  103. click(css: 'a[href="#new"]', only_if_exists: true)
  104. click(css: 'a[href="#customer_ticket_new"]')
  105. watch_for(
  106. css: '.newTicket',
  107. value: 'New Ticket',
  108. )
  109. exists(css: '.newTicket .form-group.hide select[name="group_id"]')
  110. set(
  111. css: '.newTicket input[name="title"]',
  112. value: 'one group',
  113. )
  114. set(
  115. css: '.newTicket [data-name="body"]',
  116. value: 'one group body',
  117. )
  118. click(css: '.newTicket button.js-submit', wait: 5)
  119. # check if ticket is shown
  120. location_check(url: '#ticket/zoom/')
  121. match(
  122. css: '.active div.ticket-article',
  123. value: 'one group body',
  124. no_quote: true,
  125. )
  126. # update ticket
  127. set(
  128. css: '.active [data-name="body"]',
  129. value: 'one group - some body 1234 äöüß',
  130. no_click: true,
  131. )
  132. task_type(
  133. type: 'stayOnTab',
  134. )
  135. click(css: '.active .js-submit')
  136. watch_for(
  137. css: '.active div.ticket-article',
  138. value: 'one group - some body 1234 äöüß',
  139. )
  140. tasks_close_all
  141. end
  142. def test_ccc_agent_ticket_create_with_more_groups
  143. @browser = browser_instance
  144. login(
  145. username: 'admin@example.com',
  146. password: 'test',
  147. url: browser_url,
  148. )
  149. tasks_close_all
  150. group_create(
  151. data: {
  152. name: "some group #{SecureRandom.uuid}",
  153. member: [
  154. {
  155. login: 'admin@example.com',
  156. access: 'full',
  157. },
  158. {
  159. login: 'agent1@example.com',
  160. access: 'full',
  161. },
  162. ],
  163. },
  164. )
  165. # wait to push new group dependencies to browser (to show group selection)
  166. sleep 12
  167. # create new ticket
  168. ticket_create(
  169. data: {
  170. customer: 'nico',
  171. group: 'Users',
  172. title: 'some subject 123äöü - one group 2',
  173. body: 'some body 123äöü - one group 2',
  174. },
  175. )
  176. sleep 1
  177. # update ticket
  178. ticket_update(
  179. data: {
  180. body: 'some body 1234 äöüß - one group 2 - update',
  181. group: 'Users',
  182. },
  183. )
  184. tasks_close_all
  185. end
  186. end