user_switch_cache_test.rb 1.6 KB

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