taskbar_session_test.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'browser_test_helper'
  3. class TaskbarSessionTest < TestCase
  4. def test_current_session_a_same_agent
  5. # check taken over session block screen with same user
  6. browser1 = browser_instance
  7. login(
  8. browser: browser1,
  9. username: 'agent1@example.com',
  10. password: 'test',
  11. url: browser_url,
  12. )
  13. browser2 = browser_instance
  14. login(
  15. browser: browser2,
  16. username: 'agent1@example.com',
  17. password: 'test',
  18. url: browser_url,
  19. )
  20. sleep 8
  21. match(
  22. browser: browser1,
  23. css: 'body',
  24. value: 'Continue session',
  25. )
  26. match_not(
  27. browser: browser2,
  28. css: 'body',
  29. value: 'Continue session',
  30. )
  31. end
  32. def test_current_session_b_different_agent
  33. # check taken over session block screen with same user
  34. browser1 = browser_instance
  35. login(
  36. browser: browser1,
  37. username: 'admin@example.com',
  38. password: 'test',
  39. url: browser_url,
  40. )
  41. browser2 = browser_instance
  42. login(
  43. browser: browser2,
  44. username: 'agent1@example.com',
  45. password: 'test',
  46. url: browser_url,
  47. )
  48. sleep 8
  49. match_not(
  50. browser: browser1,
  51. css: 'body',
  52. value: 'Continue session',
  53. )
  54. match_not(
  55. browser: browser2,
  56. css: 'body',
  57. value: 'Continue session',
  58. )
  59. end
  60. end