qa_robusta 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +41 -4
  3. data/common/lib/gems/.svn/entries +1 -1
  4. data/common/lib/gems/cache/.svn/entries +1 -1
  5. data/common/lib/gems/doc/.svn/entries +1 -1
  6. data/common/lib/gems/gems/.svn/entries +1 -1
  7. data/common/lib/gems/installed/.svn/entries +1 -1
  8. data/common/lib/gems/installed/cache/.svn/entries +1 -1
  9. data/common/lib/gems/installed/doc/.svn/entries +1 -1
  10. data/common/lib/gems/installed/gems/.svn/entries +1 -1
  11. data/common/lib/gems/installed/specifications/.svn/entries +1 -1
  12. data/common/lib/gems/specifications/.svn/entries +1 -1
  13. data/demo/public/images/arrow_left_48.png +0 -0
  14. data/demo/public/images/arrow_right_48.png +0 -0
  15. data/demo/public/images/down.gif +0 -0
  16. data/demo/public/images/header.jpg +0 -0
  17. data/demo/public/images/menu.gif +0 -0
  18. data/demo/public/images/menuhover.gif +0 -0
  19. data/demo/public/javascripts/browser.menu.js +61 -0
  20. data/demo/public/javascripts/cyberconnect_helpers.js +369 -0
  21. data/demo/public/javascripts/jquery-1.5.1.min.js +16 -0
  22. data/demo/public/javascripts/jquery-ui-1.8.10.custom.min.js +1370 -0
  23. data/demo/public/javascripts/jquery.layout.min-1.2.0.js +80 -0
  24. data/demo/public/javascripts/jqueryslidemenu.css +93 -0
  25. data/demo/public/javascripts/jqueryslidemenu.js +48 -0
  26. data/demo/public/javascripts/ui.accordion.js +477 -0
  27. data/demo/public/jquery.ui.all.css +11 -0
  28. data/demo/public/jquery.ui.base.css +11 -0
  29. data/demo/public/jquery.ui.theme.css +252 -0
  30. data/demo/public/jquery_css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  31. data/demo/public/jquery_css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  32. data/demo/public/jquery_css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  33. data/demo/public/jquery_css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  34. data/demo/public/jquery_css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  35. data/demo/public/jquery_css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  36. data/demo/public/jquery_css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  37. data/demo/public/jquery_css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  38. data/demo/public/jquery_css/images/ui-icons_222222_256x240.png +0 -0
  39. data/demo/public/jquery_css/images/ui-icons_2e83ff_256x240.png +0 -0
  40. data/demo/public/jquery_css/images/ui-icons_454545_256x240.png +0 -0
  41. data/demo/public/jquery_css/images/ui-icons_888888_256x240.png +0 -0
  42. data/demo/public/jquery_css/images/ui-icons_cd0a0a_256x240.png +0 -0
  43. data/demo/public/jquery_css/jquery-ui-1.8.10.custom.css +573 -0
  44. data/demo/public/jquery_layout.css +14 -0
  45. data/demo/public/jqueryslidemenu.css +93 -0
  46. data/demo/public/menu.css +12 -0
  47. data/demo/public/style.css +193 -1
  48. data/demo/views/index.erb +263 -9
  49. data/lib/qa_robusta.rb +1 -1
  50. data/qa_observer/lib/doc.rb +8 -4
  51. data/qa_observer/lib/form_helpers.rb +1 -1
  52. data/qa_observer/lib/watir.rb +41 -41
  53. data/qa_observer/sites/demo/elements/demo_elements.rb +50 -1
  54. data/qa_observer/sites/demo/flows/demo_flows.rb +32 -7
  55. data/qa_observer/sites/demo/test_cases/home_page.rb +34 -17
  56. data/qa_observer/sites/demo/test_cases/test_element_scroll_to.rb +9 -9
  57. data/qa_observer/sites/demo/test_cases/test_menu.rb +59 -0
  58. data/qa_observer/sites/demo/test_cases/test_registration.rb +140 -0
  59. data/qa_observer/suites/demo_release_decision/release.yaml +23 -0
  60. data/qa_observer/suites/init.rb +45 -2
  61. data/qa_observer/test_runner.rb +3 -5
  62. metadata +45 -9
  63. data/test/test_qa_robusta.rb +0 -8
@@ -0,0 +1,140 @@
1
+ base = File.expand_path(File.dirname(__FILE__))
2
+
3
+ # If the user is executing the test case stand alone
4
+ # without an agent we need to set a reference to
5
+ # for where to find the qa_observer_client as well as let
6
+ # the qa_observer_client know where the test case directory is
7
+ # URGENT: DO NOT MODIFY
8
+ unless $qa_observer_client
9
+ TEST_CASE_DIR = "#{base}"
10
+ $qa_observer_client = File.expand_path("#{base}/../../..")
11
+ end
12
+ # END OF DO NOT MODIFY
13
+
14
+ require "#{$qa_observer_client}/lib/system_test"
15
+ require "#{$qa_observer_client}/lib/env_details.rb"
16
+
17
+ class TestRegistration < SystemTest
18
+ def setup
19
+ # if the user hasn't provided the environment as an input
20
+ # parameter to the interpreter default to :test
21
+ $test_environment ||= :test
22
+ super
23
+ @browse_site = SiteFlows.new
24
+ @browse_site.register_flows.home
25
+ end
26
+
27
+ def teardown
28
+ # NOTE: Place all items you wish to do at after each test method
29
+ # in the unless @skip section before the $browser.close. DO NOT
30
+ # remove this section as it's critical if the test class is executed
31
+ # by an agent.
32
+ unless @skip
33
+ $browser.close if $browser
34
+ end
35
+
36
+ super
37
+ end
38
+
39
+ =begin rdoc
40
+ <b>Test Purpose</b>: Verify the user can not move from step 1 to step 2 with an invalid email and valid password
41
+
42
+ Steps:
43
+ 1. <b>Navigate</b> to the <i>home page http://127.0.0.1:9090</i>
44
+ 2. <b>Click</b> on the <i>User Registration</i> tab
45
+ 3. Leave both the <i>email</i> and <i>password</i> fields blank
46
+ followed by <b>clicking</b> the next link.
47
+ 4. <b>Verify</b> the user is on step 1.
48
+ =end
49
+ def test_invalid_email_with_valid_password
50
+ assert !@browse_site.register_flows.register_elements.step_2_displayed?
51
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
52
+ @browse_site.register_flows.step_1(:password => 'a', :submit => true)
53
+ assert !@browse_site.register_flows.register_elements.step_2_displayed?
54
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
55
+ end
56
+
57
+ =begin rdoc
58
+ <b>Test Purpose</b>: Verify the user can not move from step 1 to step 2 with a valid email and invalid password
59
+
60
+ Steps:
61
+ 1. <b>Navigate</b> to the <i>home page http://127.0.0.1:9090</i>
62
+ 2. <b>Click</b> on the <i>User Registration</i> tab
63
+ 3. <b>Enter</b> a valid entry in the <i>email</i> field and a blank
64
+ value in <i>password</i> field followed by <b>clicking</b> the <i>next</i> link.
65
+ 4. <b>Verify</b> the user is on <i>step 1</i>.
66
+ =end
67
+ def test_email_with_invalid_password
68
+ assert !@browse_site.register_flows.register_elements.step_2_displayed?
69
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
70
+ @browse_site.register_flows.step_1(:email => 'a', :submit => true)
71
+ assert_equal 'Enter a value', @browse_site.register_flows.register_elements.password_error.text
72
+ assert_equal '', @browse_site.register_flows.register_elements.email_error.text
73
+ assert !@browse_site.register_flows.register_elements.step_2_displayed?
74
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
75
+ end
76
+
77
+ =begin rdoc
78
+ <b>Test Purpose</b>: Verify the user can not move from step 1 to step 2 with an invalid email and a valid password
79
+
80
+ Steps:
81
+ 1. <b>Navigate</b> to the <i>home page http://127.0.0.1:9090</i>
82
+ 2. <b>Click</b> on the <i>User Registration</i> tab
83
+ 3. <b>Leave</b> both the email and password fields empty
84
+ followed by <b>clicking</b> the <i>next</i> link.
85
+ 4. <b>Verify</b> the user is on <i>step 1</i>.
86
+ =end
87
+ def test_invalid_email_and_invalid_password
88
+ assert !@browse_site.register_flows.register_elements.step_2_displayed?
89
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
90
+ @browse_site.register_flows.step_1(:submit => true)
91
+ assert_equal 'Enter a value', @browse_site.register_flows.register_elements.email_error.text
92
+ assert_equal 'Enter a value', @browse_site.register_flows.register_elements.password_error.text
93
+ assert !@browse_site.register_flows.register_elements.step_2_displayed?
94
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
95
+ end
96
+
97
+ =begin rdoc
98
+ <b>Test Purpose</b>: Verify the user can move from step 1 to step 2 when providing a valid email and password.
99
+
100
+ Steps:
101
+ 1. <b>Navigate</b> to the <i>home page http://127.0.0.1:9090</i>
102
+ 2. <b>Click</b> on the <i>User Registration</i> tab
103
+ 3. <b>Enter</b> valid entries in both the <i>email</i> and <i>password> fields
104
+ followed by <b>clicking</b> the <i>next</i> link.
105
+ 4. <b>Verify</b> the user is on <i>step 2</i>.
106
+ =end
107
+ def test_valid_email_and_valid_password
108
+ assert !@browse_site.register_flows.register_elements.step_2_displayed?
109
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
110
+ @browse_site.register_flows.step_1(:email => 'a', :password => 'a', :submit => true)
111
+ assert @browse_site.register_flows.register_elements.step_2_displayed?
112
+ assert !@browse_site.register_flows.register_elements.step_1_displayed?
113
+ end
114
+
115
+ =begin rdoc
116
+ <b>Test Purpose</b>: Verify that the user can move back and forth between steps 1 & 2 when using valid values. Ensure that the previous values entered are not lost in the navigation.
117
+
118
+ Steps:
119
+ 1. <b>Navigate</b> to the <i>home page http://127.0.0.1:9090</i>
120
+ 2. <b>Click</b> on the <i>User Registration</i> tab
121
+ 3. Enter valid values in both the <i>email</i> and <i>password</i>
122
+ fields followed by <b>clicking<b> the <i>next</i> link.
123
+ 4. <b>Verify</b> the user is on <i>step 2</i>.
124
+ 5. <b>Click</b> on the <i>previous</i> link
125
+ 6. <b>Verify</b> that the user is on <i>step 2</i> and that the <i>email</i> and <i>password</i> fields
126
+ have the same values used during step 3
127
+ 7. <b>Repeat</b> <i>steps 3 - 6</i> <b>using</b> different values for <i>email</i> and <i>password</i> for <i>step 3</i>
128
+ =end
129
+ def test_navigate_between_steps_1_and_2
130
+ 3.times { |ct|
131
+ assert @browse_site.register_flows.register_elements.step_1_displayed?
132
+ @browse_site.register_flows.step_1(:email => ct.to_s, :password => ct.to_s, :submit => true)
133
+ assert @browse_site.register_flows.register_elements.step_2_displayed?
134
+ @browse_site.register_flows.register_elements.step_2_prev.click
135
+ assert_equal ct.to_s, @browse_site.register_flows.register_elements.email.value
136
+ assert_equal ct.to_s, @browse_site.register_flows.register_elements.password.value
137
+ }
138
+ end
139
+
140
+ end
@@ -0,0 +1,23 @@
1
+ ---
2
+ # global setup items, can override on a per suite basis
3
+ :default:
4
+ :browser: chrome
5
+
6
+ :suites:
7
+ - :site: demo
8
+ :test_case_file: home_page.rb
9
+ :environment: test
10
+ :methods_to_execute: test_home_elements
11
+ - :site: demo
12
+ :test_case_file: test_element_scroll_to.rb
13
+ :environment: test
14
+ :methods_to_execute: all
15
+ - :site: demo
16
+ :test_case_file: test_menu.rb
17
+ :environment: test
18
+ :methods_to_execute: all
19
+ - :site: demo
20
+ :test_case_file: test_registration.rb
21
+ :environment: test
22
+ :methods_to_execute: all
23
+
@@ -1,10 +1,10 @@
1
1
  require 'yaml'
2
+ BASE = File.expand_path(File.dirname(__FILE__))
2
3
 
3
4
  module SuiteHelper
4
5
  def self.exec(suite, junit=false, proxy=nil)
5
6
  base = File.expand_path(File.dirname(__FILE__))
6
7
  cfg = YAML::load_file(suite)
7
-
8
8
  optional_options = ''
9
9
 
10
10
  if proxy
@@ -14,8 +14,15 @@ module SuiteHelper
14
14
  if junit
15
15
  optional_options += " --format=junit"
16
16
  end
17
-
17
+
18
+ existing_html_files = []
19
+ html_reports = []
20
+
18
21
  cfg[:suites].each { |test|
22
+ Dir.entries(BASE + "/../sites/#{test[:site]}/results").each { |i|
23
+ existing_html_files << i if i =~ /\.html$/
24
+ }
25
+
19
26
  puts "looking at test: #{test.inspect}"
20
27
 
21
28
  # if the current test for the suite has a browser use that
@@ -29,13 +36,49 @@ module SuiteHelper
29
36
  params = "--site=#{test[:site]} --file_name=#{test[:test_case_file]} --execute_methods=#{test[:methods_to_execute]} --browser=#{browser} --environment=#{test[:environment]} #{optional_options}"
30
37
 
31
38
  puts "executing test_runner with options: #{params}"
39
+
40
+
32
41
  out = `ruby #{base}/../test_runner.rb #{params}`
33
42
  puts out
34
43
 
44
+ Dir.entries(BASE + "/../sites/#{test[:site]}/results").each { |i|
45
+ if i =~ /\.html$/
46
+ html_reports << i unless existing_html_files.include?(i)
47
+ end
48
+ }
35
49
  }
50
+ test = cfg[:suites].first
51
+ demo = File.expand_path("#{BASE}/../../demo")
52
+ html = <<-EOF
53
+ <html>
54
+ <head>
55
+ <script type="text/javascript" src="file://#{demo}/public/javascripts/jquery-1.5.1.min.js"></script>
56
+
57
+ <script>
58
+ $(function() {
59
+ $('a.new-window').click(function(){
60
+ window.open(this.href);
61
+ return false;
62
+ });
63
+ });
64
+ </script>
65
+
66
+ </head>
67
+ <body><h1>Test Results for suite #{suite}</h1><br><br><ul>
68
+ EOF
69
+ fd = File.open(BASE + "/../sites/#{test[:site]}/results/index.html", 'w+')
70
+ html_reports.each { |i|
71
+ f = File.expand_path("#{BASE}/../sites/#{test[:site]}/results/#{i}")
72
+ html += "<li><a class='new-window' href='file://#{f}'>#{i}</a></li>"
73
+ }
74
+ html += "</ul></body></html>"
75
+ fd.puts html
76
+ fd.close
36
77
  end
37
78
  end
38
79
 
39
80
  suite = ARGV[0]
40
81
  raise ArgumentError unless File.exists? suite
82
+
83
+
41
84
  SuiteHelper.exec suite
@@ -68,10 +68,8 @@ else
68
68
  end
69
69
  end
70
70
 
71
- content = File.readlines(file).to_s
72
-
71
+ content = File.read(file)
73
72
  method_names = TCDoc.method_names_from_file(content)
74
-
75
73
  if opt.execute_methods == 'all'
76
74
  $job = {:methods => method_names}
77
75
  else
@@ -106,9 +104,9 @@ if opt.format == 'junit'
106
104
  fd = File.open(tmp_file, 'w+')
107
105
  fd.puts content.to_s
108
106
  fd.close
107
+ puts "TMP: #{tmp_file}"
109
108
  results=`ruby #{tmp_file}`
110
-
111
- FileUtils.rm_f tmp_file
109
+ #FileUtils.rm_f tmp_file
112
110
 
113
111
  else
114
112
  load file
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: qa_robusta
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.8
5
+ version: 0.1.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Cliff Cyphers
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-06 00:00:00 Z
13
+ date: 2011-10-11 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: platform_helpers
@@ -114,10 +114,6 @@ files:
114
114
  - remote_unix/lib/ssh.rb
115
115
  - remote_unix/lib/postfix_info.rb
116
116
  - remote_unix/lib/requires.rb
117
- - demo/public/javascripts/jquery-1.6.2.min.js
118
- - demo/public/style.css
119
- - demo/demo_site.rb
120
- - demo/views/index.erb
121
117
  - mechanize_interface/conf/app.yaml
122
118
  - mechanize_interface/lib/get_page.rb
123
119
  - mechanize_interface/lib/login.rb
@@ -127,6 +123,8 @@ files:
127
123
  - mechanize_interface/test/lib/mech_unit_test.rb
128
124
  - qa_observer/script/generate
129
125
  - qa_observer/script/destroy
126
+ - qa_observer/sites/demo/test_cases/test_menu.rb
127
+ - qa_observer/sites/demo/test_cases/test_registration.rb
130
128
  - qa_observer/sites/demo/test_cases/home_page.rb
131
129
  - qa_observer/sites/demo/test_cases/test_element_scroll_to.rb
132
130
  - qa_observer/sites/demo/elements/demo_elements.rb
@@ -144,6 +142,7 @@ files:
144
142
  - qa_observer/conf/development.yaml
145
143
  - qa_observer/conf/qa_observer_links.yaml
146
144
  - qa_observer/suites/init.rb
145
+ - qa_observer/suites/demo_release_decision/release.yaml
147
146
  - qa_observer/suites/demo_sm_chrome/sm.yaml
148
147
  - qa_observer/suites/demo_lg_chrome/lg.yaml
149
148
  - qa_observer/suites/demo_md_chrome/md.yaml
@@ -197,7 +196,44 @@ files:
197
196
  - common/lib/gen_suite_doc.rb
198
197
  - common/lib/constants.rb
199
198
  - lib/monkey_patch.rb
200
- - test/test_qa_robusta.rb
199
+ - demo/public/jquery_layout.css
200
+ - demo/public/javascripts/jquery.layout.min-1.2.0.js
201
+ - demo/public/javascripts/jquery-ui-1.8.10.custom.min.js
202
+ - demo/public/javascripts/browser.menu.js
203
+ - demo/public/javascripts/jqueryslidemenu.js
204
+ - demo/public/javascripts/jquery-1.5.1.min.js
205
+ - demo/public/javascripts/jquery-1.6.2.min.js
206
+ - demo/public/javascripts/ui.accordion.js
207
+ - demo/public/javascripts/jqueryslidemenu.css
208
+ - demo/public/javascripts/cyberconnect_helpers.js
209
+ - demo/public/jquery_css/images/ui-bg_glass_55_fbf9ee_1x400.png
210
+ - demo/public/jquery_css/images/ui-icons_888888_256x240.png
211
+ - demo/public/jquery_css/images/ui-icons_2e83ff_256x240.png
212
+ - demo/public/jquery_css/images/ui-icons_222222_256x240.png
213
+ - demo/public/jquery_css/images/ui-bg_glass_95_fef1ec_1x400.png
214
+ - demo/public/jquery_css/images/ui-bg_glass_65_ffffff_1x400.png
215
+ - demo/public/jquery_css/images/ui-bg_glass_75_dadada_1x400.png
216
+ - demo/public/jquery_css/images/ui-bg_glass_75_e6e6e6_1x400.png
217
+ - demo/public/jquery_css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
218
+ - demo/public/jquery_css/images/ui-icons_454545_256x240.png
219
+ - demo/public/jquery_css/images/ui-icons_cd0a0a_256x240.png
220
+ - demo/public/jquery_css/images/ui-bg_flat_0_aaaaaa_40x100.png
221
+ - demo/public/jquery_css/images/ui-bg_flat_75_ffffff_40x100.png
222
+ - demo/public/jquery_css/jquery-ui-1.8.10.custom.css
223
+ - demo/public/style.css
224
+ - demo/public/images/menuhover.gif
225
+ - demo/public/images/down.gif
226
+ - demo/public/images/arrow_left_48.png
227
+ - demo/public/images/menu.gif
228
+ - demo/public/images/arrow_right_48.png
229
+ - demo/public/images/header.jpg
230
+ - demo/public/menu.css
231
+ - demo/public/jquery.ui.theme.css
232
+ - demo/public/jqueryslidemenu.css
233
+ - demo/public/jquery.ui.all.css
234
+ - demo/public/jquery.ui.base.css
235
+ - demo/demo_site.rb
236
+ - demo/views/index.erb
201
237
  - .gemtest
202
238
  homepage: https://cyberconnect.biz/opensource/qa_robusta.html
203
239
  licenses: []
@@ -227,5 +263,5 @@ rubygems_version: 1.8.10
227
263
  signing_key:
228
264
  specification_version: 3
229
265
  summary: QA Robusta is an automation framework easing pain points away from automation test case writers
230
- test_files:
231
- - test/test_qa_robusta.rb
266
+ test_files: []
267
+
@@ -1,8 +0,0 @@
1
- require "test/unit"
2
- require "qa_robusta"
3
-
4
- class TestQaRobusta < Test::Unit::TestCase
5
- def test_sanity
6
- flunk "write tests or I will kneecap you"
7
- end
8
- end