taskbar_session_test.rb 1.4 KB

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