user_switch_cache_test.rb 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'browser_test_helper'
  3. class UserSwitchCache < TestCase
  4. def test_re_login
  5. # login as agent and create one ticket
  6. @browser = browser_instance
  7. login(
  8. username: 'agent1@example.com',
  9. password: 'test',
  10. url: browser_url,
  11. )
  12. tasks_close_all
  13. ticket_create(
  14. data: {
  15. customer: 'nico',
  16. group: 'Users',
  17. title: 'some subject 123äöü - reply test',
  18. body: 'some body 123äöü - reply test',
  19. },
  20. )
  21. logout
  22. # login as customer and verify ticket create screen
  23. login(
  24. username: 'nicole.braun@zammad.org',
  25. password: 'test',
  26. url: browser_url,
  27. )
  28. click(css: 'a[href="#new"]', only_if_exists: true)
  29. click(css: 'a[href="#customer_ticket_new"]')
  30. sleep 4
  31. match(
  32. css: '#content',
  33. value: 'Priority',
  34. should_not_match: true,
  35. )
  36. match(
  37. css: '#content',
  38. value: 'Owner',
  39. should_not_match: true,
  40. )
  41. match(
  42. css: '#content',
  43. value: 'State',
  44. )
  45. logout
  46. # login again as customer and verify ticket create screen
  47. login(
  48. username: 'nicole.braun@zammad.org',
  49. password: 'test',
  50. url: browser_url,
  51. )
  52. click(css: 'a[href="#new"]', only_if_exists: true)
  53. click(css: 'a[href="#customer_ticket_new"]')
  54. sleep 4
  55. match(
  56. css: '#content',
  57. value: 'Priority',
  58. should_not_match: true,
  59. )
  60. match(
  61. css: '#content',
  62. value: 'Owner',
  63. should_not_match: true,
  64. )
  65. match(
  66. css: '#content',
  67. value: 'State',
  68. )
  69. end
  70. end