taskbar_session_test.rb 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # encoding: utf-8
  2. require 'browser_test_helper'
  3. class TaskbarSessionTest < TestCase
  4. def test_current_session_a_same_agent
  5. tests = [
  6. {
  7. :name => 'check taken over session block screen with same user',
  8. :instance1 => browser_instance,
  9. :instance2 => browser_instance,
  10. :instance1_username => 'agent1@example.com',
  11. :instance1_password => 'test',
  12. :instance2_username => 'agent1@example.com',
  13. :instance2_password => 'test',
  14. :url => browser_url,
  15. :action => [
  16. {
  17. :execute => 'wait',
  18. :value => 12,
  19. },
  20. {
  21. :where => :instance1,
  22. :execute => 'match',
  23. :css => 'body',
  24. :value => 'Reload application',
  25. :match_result => true,
  26. },
  27. {
  28. :where => :instance2,
  29. :execute => 'match',
  30. :css => 'body',
  31. :value => 'Reload application',
  32. :match_result => false,
  33. },
  34. ],
  35. },
  36. ]
  37. browser_double_test(tests)
  38. end
  39. def test_current_session_b_different_agent
  40. tests = [
  41. {
  42. :name => 'check taken over session block screen with same user',
  43. :instance1 => browser_instance,
  44. :instance2 => browser_instance,
  45. :instance1_username => 'master@example.com',
  46. :instance1_password => 'test',
  47. :instance2_username => 'agent1@example.com',
  48. :instance2_password => 'test',
  49. :url => browser_url,
  50. :action => [
  51. {
  52. :execute => 'wait',
  53. :value => 12,
  54. },
  55. {
  56. :where => :instance1,
  57. :execute => 'match',
  58. :css => 'body',
  59. :value => 'Reload application',
  60. :match_result => false,
  61. },
  62. {
  63. :where => :instance2,
  64. :execute => 'match',
  65. :css => 'body',
  66. :value => 'Reload application',
  67. :match_result => false,
  68. },
  69. ],
  70. },
  71. ]
  72. browser_double_test(tests)
  73. end
  74. end