taskbar_session_test.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # encoding: utf-8
  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: 'master@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