aaa_getting_started_test.rb 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # encoding: utf-8
  2. require 'browser_test_helper'
  3. class AaaGettingStartedTest < TestCase
  4. def test_getting_started
  5. tests = [
  6. {
  7. :name => 'start',
  8. :instance => browser_instance,
  9. :url => browser_url + '/',
  10. :action => [
  11. {
  12. :execute => 'check',
  13. :css => '#form-master',
  14. :result => true,
  15. },
  16. ],
  17. },
  18. {
  19. :name => 'getting started - master agent',
  20. :action => [
  21. {
  22. :execute => 'set',
  23. :css => '#form-master input[name="firstname"]',
  24. :value => 'Test Master',
  25. },
  26. {
  27. :execute => 'set',
  28. :css => '#form-master input[name="lastname"]',
  29. :value => 'Agent',
  30. },
  31. {
  32. :execute => 'set',
  33. :css => '#form-master input[name="email"]',
  34. :value => 'master@example.com',
  35. },
  36. {
  37. :execute => 'set',
  38. :css => '#form-master input[name="password"]',
  39. :value => 'test1234äöüß',
  40. },
  41. {
  42. :execute => 'set',
  43. :css => '#form-master input[name="password_confirm"]',
  44. :value => 'test1234äöüß',
  45. },
  46. {
  47. :execute => 'click',
  48. :css => '#form-master button[type="submit"]',
  49. },
  50. {
  51. :execute => 'wait',
  52. :value => 3,
  53. },
  54. {
  55. :execute => 'check',
  56. :element => :url,
  57. :result => '#getting_started',
  58. },
  59. ],
  60. },
  61. # create agent1
  62. {
  63. :name => 'getting started - agent 1',
  64. :action => [
  65. {
  66. :execute => 'match',
  67. :css => 'body',
  68. :value => 'Invite Agents',
  69. :match_result => true,
  70. },
  71. {
  72. :execute => 'set',
  73. :css => '#form-agent input[name="firstname"]',
  74. :value => 'Agent 1',
  75. },
  76. {
  77. :execute => 'set',
  78. :css => '#form-agent input[name="lastname"]',
  79. :value => 'Test',
  80. },
  81. {
  82. :execute => 'set',
  83. :css => '#form-agent input[name="email"]',
  84. :value => 'agent1@example.com',
  85. },
  86. {
  87. :execute => 'click',
  88. :css => '#form-agent input[name="group_ids"][value="1"]',
  89. },
  90. {
  91. :execute => 'click',
  92. :css => '#form-agent button[type="submit"]',
  93. },
  94. {
  95. :execute => 'watch_for',
  96. :area => 'body',
  97. :value => 'Invitation sent',
  98. },
  99. {
  100. :execute => 'check',
  101. :element => :url,
  102. :result => '#getting_started',
  103. },
  104. {
  105. :execute => 'match',
  106. :css => 'body',
  107. :value => 'Invite Agents',
  108. :match_result => true,
  109. },
  110. ],
  111. },
  112. ]
  113. browser_single_test(tests)
  114. end
  115. end