qa_robusta 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +23 -0
- data/.gemtest +0 -0
- data/History.txt +6 -0
- data/Manifest.txt +101 -0
- data/README.txt +48 -0
- data/Rakefile +18 -0
- data/bin/qa_robusta +14 -0
- data/common/Rakefile +95 -0
- data/common/conf/monkey_patch.yaml +8 -0
- data/common/conf/monkey_patch.yaml.ex +10 -0
- data/common/lib/array.rb +9 -0
- data/common/lib/cache.rb +12 -0
- data/common/lib/constants.rb +35 -0
- data/common/lib/error_defns.rb +13 -0
- data/common/lib/format_html_tmp.html +34 -0
- data/common/lib/formatters.rb +18 -0
- data/common/lib/gem_helpers.rb +29 -0
- data/common/lib/gems/.svn/entries +43 -0
- data/common/lib/gems/cache/.svn/entries +28 -0
- data/common/lib/gems/doc/.svn/entries +28 -0
- data/common/lib/gems/gems/.svn/entries +28 -0
- data/common/lib/gems/installed/.svn/entries +40 -0
- data/common/lib/gems/installed/cache/.svn/entries +28 -0
- data/common/lib/gems/installed/doc/.svn/entries +28 -0
- data/common/lib/gems/installed/gems/.svn/entries +28 -0
- data/common/lib/gems/installed/specifications/.svn/entries +28 -0
- data/common/lib/gems/specifications/.svn/entries +28 -0
- data/common/lib/gen_suite_doc.rb +52 -0
- data/common/lib/load_test_data.rb +18 -0
- data/common/lib/monkey_patch.rb +149 -0
- data/common/lib/navigate_mech.rb +79 -0
- data/common/lib/update_element.rb +12 -0
- data/common/monkey_patches/mechanize.rb +589 -0
- data/common/monkey_patches/table.rb +363 -0
- data/common/monkey_patches/telnet.rb +420 -0
- data/common/monkey_patches/unit.rb +538 -0
- data/demo/demo_site.rb +38 -0
- data/demo/public/javascripts/jquery-1.6.2.min.js +18 -0
- data/demo/views/index.erb +35 -0
- data/lib/monkey_patch.rb +26 -0
- data/lib/qa_robusta.rb +3 -0
- data/mechanize_interface/conf/app.yaml +10 -0
- data/mechanize_interface/lib/agent.rb +18 -0
- data/mechanize_interface/lib/app_require.rb +19 -0
- data/mechanize_interface/lib/get_page.rb +20 -0
- data/mechanize_interface/lib/login.rb +30 -0
- data/mechanize_interface/lib/navigation_paths.rb +12 -0
- data/mechanize_interface/test/lib/mech_unit_test.rb +19 -0
- data/qa_observer/conf/dev_users.yaml +9 -0
- data/qa_observer/conf/development.yaml +3 -0
- data/qa_observer/conf/qa_observer_links.yaml +10 -0
- data/qa_observer/generators/site/site_generator.rb +61 -0
- data/qa_observer/generators/site/templates/base_urls.yaml.erb +6 -0
- data/qa_observer/generators/site/templates/create_flow.rb.erb +54 -0
- data/qa_observer/generators/site/templates/elements.rb.erb +61 -0
- data/qa_observer/generators/site/templates/html_elements.yaml +22 -0
- data/qa_observer/generators/site/templates/navigate.rb +32 -0
- data/qa_observer/generators/site/templates/reports.rb +7 -0
- data/qa_observer/generators/site/templates/users_list.yaml +21 -0
- data/qa_observer/generators/test_case/templates/test_case.rb.erb +62 -0
- data/qa_observer/generators/test_case/test_case_generator.rb +29 -0
- data/qa_observer/lib/doc.rb +103 -0
- data/qa_observer/lib/env_details.rb +2 -0
- data/qa_observer/lib/error_defns.rb +3 -0
- data/qa_observer/lib/form_helpers.rb +52 -0
- data/qa_observer/lib/reports.rb +7 -0
- data/qa_observer/lib/requires.rb +23 -0
- data/qa_observer/lib/system_test.rb +146 -0
- data/qa_observer/lib/test_extention.rb +29 -0
- data/qa_observer/lib/update_element.rb +12 -0
- data/qa_observer/lib/watir.rb +42 -0
- data/qa_observer/script/destroy +14 -0
- data/qa_observer/script/generate +14 -0
- data/qa_observer/sites/demo/conf/base_urls.yaml +6 -0
- data/qa_observer/sites/demo/conf/html_elements.yaml +22 -0
- data/qa_observer/sites/demo/conf/remote_machine.yaml +12 -0
- data/qa_observer/sites/demo/conf/users_list.yaml +21 -0
- data/qa_observer/sites/demo/elements/demo_elements.rb +9 -0
- data/qa_observer/sites/demo/flows/demo_flows.rb +37 -0
- data/qa_observer/sites/demo/helpers/.placeholder +0 -0
- data/qa_observer/sites/demo/lib/navigate.rb +32 -0
- data/qa_observer/sites/demo/lib/reports.rb +7 -0
- data/qa_observer/sites/demo/results/.placeholder +0 -0
- data/qa_observer/sites/demo/results/images/.placeholder +0 -0
- data/qa_observer/sites/demo/test_cases/home_page.rb +106 -0
- data/qa_observer/suites/demo_lg_chrome/lg.yaml +11 -0
- data/qa_observer/suites/demo_md_chrome/md.yaml +11 -0
- data/qa_observer/suites/demo_sm_chrome/sm.yaml +11 -0
- data/qa_observer/suites/init.rb +41 -0
- data/qa_observer/test_runner.rb +125 -0
- data/remote_unix/helpers/constants.rb +8 -0
- data/remote_unix/helpers/out_xforms.rb +48 -0
- data/remote_unix/lib/common.rb +52 -0
- data/remote_unix/lib/error_defn.rb +4 -0
- data/remote_unix/lib/general_unix.rb +308 -0
- data/remote_unix/lib/network_commands.rb +41 -0
- data/remote_unix/lib/network_info.rb +98 -0
- data/remote_unix/lib/postfix_commands.rb +87 -0
- data/remote_unix/lib/postfix_info.rb +30 -0
- data/remote_unix/lib/requires.rb +25 -0
- data/remote_unix/lib/scp.rb +22 -0
- data/remote_unix/lib/ssh.rb +46 -0
- data/test/test_qa_robusta.rb +8 -0
- metadata +219 -0
data/.autotest
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'autotest/restart'
|
4
|
+
|
5
|
+
# Autotest.add_hook :initialize do |at|
|
6
|
+
# at.extra_files << "../some/external/dependency.rb"
|
7
|
+
#
|
8
|
+
# at.libs << ":../some/external"
|
9
|
+
#
|
10
|
+
# at.add_exception 'vendor'
|
11
|
+
#
|
12
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
13
|
+
# at.files_matching(/test_.*rb$/)
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# %w(TestA TestB).each do |klass|
|
17
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
|
21
|
+
# Autotest.add_hook :run_command do |at|
|
22
|
+
# system "rake build"
|
23
|
+
# end
|
data/.gemtest
ADDED
File without changes
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
.autotest
|
2
|
+
History.txt
|
3
|
+
Manifest.txt
|
4
|
+
README.txt
|
5
|
+
Rakefile
|
6
|
+
bin/qa_robusta
|
7
|
+
lib/qa_robusta.rb
|
8
|
+
remote_unix/helpers/constants.rb
|
9
|
+
remote_unix/helpers/out_xforms.rb
|
10
|
+
remote_unix/lib/scp.rb
|
11
|
+
remote_unix/lib/error_defn.rb
|
12
|
+
remote_unix/lib/network_info.rb
|
13
|
+
remote_unix/lib/general_unix.rb
|
14
|
+
remote_unix/lib/network_commands.rb
|
15
|
+
remote_unix/lib/postfix_commands.rb
|
16
|
+
remote_unix/lib/common.rb
|
17
|
+
remote_unix/lib/ssh.rb
|
18
|
+
remote_unix/lib/postfix_info.rb
|
19
|
+
remote_unix/lib/requires.rb
|
20
|
+
demo/public/javascripts/jquery-1.6.2.min.js
|
21
|
+
demo/demo_site.rb
|
22
|
+
demo/views/index.erb
|
23
|
+
mechanize_interface/conf/app.yaml
|
24
|
+
mechanize_interface/lib/get_page.rb
|
25
|
+
mechanize_interface/lib/login.rb
|
26
|
+
mechanize_interface/lib/navigation_paths.rb
|
27
|
+
mechanize_interface/lib/agent.rb
|
28
|
+
mechanize_interface/lib/app_require.rb
|
29
|
+
mechanize_interface/test/lib/mech_unit_test.rb
|
30
|
+
qa_observer/script/generate
|
31
|
+
qa_observer/script/destroy
|
32
|
+
qa_observer/sites/demo/test_cases/home_page.rb
|
33
|
+
qa_observer/sites/demo/elements/demo_elements.rb
|
34
|
+
qa_observer/sites/demo/conf/base_urls.yaml
|
35
|
+
qa_observer/sites/demo/conf/users_list.yaml
|
36
|
+
qa_observer/sites/demo/conf/html_elements.yaml
|
37
|
+
qa_observer/sites/demo/conf/remote_machine.yaml
|
38
|
+
qa_observer/sites/demo/flows/demo_flows.rb
|
39
|
+
qa_observer/sites/demo/lib/reports.rb
|
40
|
+
qa_observer/sites/demo/lib/navigate.rb
|
41
|
+
qa_observer/sites/demo/helpers/.placeholder
|
42
|
+
qa_observer/sites/demo/results/.placeholder
|
43
|
+
qa_observer/sites/demo/results/images/.placeholder
|
44
|
+
qa_observer/conf/dev_users.yaml
|
45
|
+
qa_observer/conf/development.yaml
|
46
|
+
qa_observer/conf/qa_observer_links.yaml
|
47
|
+
qa_observer/suites/init.rb
|
48
|
+
qa_observer/suites/demo_sm_chrome/sm.yaml
|
49
|
+
qa_observer/suites/demo_lg_chrome/lg.yaml
|
50
|
+
qa_observer/suites/demo_md_chrome/md.yaml
|
51
|
+
qa_observer/test_runner.rb
|
52
|
+
qa_observer/generators/test_case/templates/test_case.rb.erb
|
53
|
+
qa_observer/generators/test_case/test_case_generator.rb
|
54
|
+
qa_observer/generators/site/templates/base_urls.yaml.erb
|
55
|
+
qa_observer/generators/site/templates/reports.rb
|
56
|
+
qa_observer/generators/site/templates/create_flow.rb.erb
|
57
|
+
qa_observer/generators/site/templates/navigate.rb
|
58
|
+
qa_observer/generators/site/templates/elements.rb.erb
|
59
|
+
qa_observer/generators/site/templates/users_list.yaml
|
60
|
+
qa_observer/generators/site/templates/html_elements.yaml
|
61
|
+
qa_observer/generators/site/site_generator.rb
|
62
|
+
qa_observer/lib/form_helpers.rb
|
63
|
+
qa_observer/lib/error_defns.rb
|
64
|
+
qa_observer/lib/env_details.rb
|
65
|
+
qa_observer/lib/reports.rb
|
66
|
+
qa_observer/lib/doc.rb
|
67
|
+
qa_observer/lib/update_element.rb
|
68
|
+
qa_observer/lib/watir.rb
|
69
|
+
qa_observer/lib/test_extention.rb
|
70
|
+
qa_observer/lib/system_test.rb
|
71
|
+
qa_observer/lib/requires.rb
|
72
|
+
common/monkey_patches/table.rb
|
73
|
+
common/monkey_patches/unit.rb
|
74
|
+
common/monkey_patches/telnet.rb
|
75
|
+
common/monkey_patches/mechanize.rb
|
76
|
+
common/conf/monkey_patch.yaml
|
77
|
+
common/conf/monkey_patch.yaml.ex
|
78
|
+
common/Rakefile
|
79
|
+
common/lib/formatters.rb
|
80
|
+
common/lib/error_defns.rb
|
81
|
+
common/lib/navigate_mech.rb
|
82
|
+
common/lib/gems/gems/.svn/entries
|
83
|
+
common/lib/gems/doc/.svn/entries
|
84
|
+
common/lib/gems/cache/.svn/entries
|
85
|
+
common/lib/gems/installed/gems/.svn/entries
|
86
|
+
common/lib/gems/installed/doc/.svn/entries
|
87
|
+
common/lib/gems/installed/cache/.svn/entries
|
88
|
+
common/lib/gems/installed/specifications/.svn/entries
|
89
|
+
common/lib/gems/installed/.svn/entries
|
90
|
+
common/lib/gems/specifications/.svn/entries
|
91
|
+
common/lib/gems/.svn/entries
|
92
|
+
common/lib/load_test_data.rb
|
93
|
+
common/lib/monkey_patch.rb
|
94
|
+
common/lib/format_html_tmp.html
|
95
|
+
common/lib/update_element.rb
|
96
|
+
common/lib/cache.rb
|
97
|
+
common/lib/array.rb
|
98
|
+
common/lib/gem_helpers.rb
|
99
|
+
common/lib/gen_suite_doc.rb
|
100
|
+
common/lib/constants.rb
|
101
|
+
lib/monkey_patch.rb
|
data/README.txt
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
= qa_robusta
|
2
|
+
|
3
|
+
* https://cyberconnect.biz/opensource/qa_robusta.html
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
QA Robusta is an automation framework easing pain points away from automation test case writers. How is pain relieved?
|
8
|
+
|
9
|
+
* Elements, such as links, buttons, and other html objects are defined in one
|
10
|
+
location. This ensures over time the user won't have definitions spread out
|
11
|
+
throughout different layers of code requiring time consuming updates if the
|
12
|
+
application under test is modified.
|
13
|
+
* Well defined flows allows the user to have a common means for navigating and
|
14
|
+
controlling interactions with the application under test. This takes all logic
|
15
|
+
out of test classes and yields in higher more modular code re-use.
|
16
|
+
* When an application requiring testing has the elements and flows implemented
|
17
|
+
less code savy resources can easily add new test cases once trained on how to
|
18
|
+
access the flows and elements.
|
19
|
+
* When ever a link or button is clicked a screen shot is taken
|
20
|
+
* Results are available under site/results directory in html format. Report
|
21
|
+
includes the rdoc on a per test class method along with any screen shots taken.
|
22
|
+
Example report: https://cyberconnect.biz/opensource/demo_results.html
|
23
|
+
* Transparent remote Unix command execution leading to well defined interfaces
|
24
|
+
for common task. For example, one may have a class defined specifically for
|
25
|
+
RemoteUnixNetwork. This class would have methods such as, assign_ip, ifup, ifdown,
|
26
|
+
etc. This class then would be able to perform these task on any remote Unix machine.
|
27
|
+
* Executes the same on Windows or Linux/Unix environments. Developers have the
|
28
|
+
freedom to develop on the platform of choice.
|
29
|
+
* Mechanize extension: Allows the user to define a web application's page elements in
|
30
|
+
a YAML format and provide navigation paths accessing the YAML structure to interact
|
31
|
+
with the web application. Users can also perform direct http.post or any other
|
32
|
+
mechanize functionality when defining state-full interfaces to hit a web application
|
33
|
+
without going through a browser.
|
34
|
+
|
35
|
+
== FEATURES/PROBLEMS:
|
36
|
+
|
37
|
+
Helping eliminate pain points when automating system testing for quick release cycles.
|
38
|
+
|
39
|
+
== INSTALL:
|
40
|
+
|
41
|
+
See https://cyberconnect.biz/opensource/qa_robusta.html for complete setup instructions.
|
42
|
+
|
43
|
+
== LICENSE:
|
44
|
+
|
45
|
+
GPLv3: http://www.gnu.org/licenses/gpl.html
|
46
|
+
|
47
|
+
Copyright (c) 2011 Cliff Cyphers
|
48
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
|
6
|
+
# Hoe.plugin :compiler
|
7
|
+
# Hoe.plugin :gem_prelude_sucks
|
8
|
+
# Hoe.plugin :inline
|
9
|
+
# Hoe.plugin :racc
|
10
|
+
# Hoe.plugin :rubyforge
|
11
|
+
|
12
|
+
Hoe.spec 'qa_robusta' do
|
13
|
+
developer('Cliff Cyphers', 'cliff.cyphers@gmail.com')
|
14
|
+
extra_deps << ['platform_helpers', '0.1.2']
|
15
|
+
extra_deps << 'rubigen'
|
16
|
+
end
|
17
|
+
|
18
|
+
# vim: syntax=ruby
|
data/bin/qa_robusta
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
require 'getoptlong'
|
4
|
+
raise StandardError unless RUBY_VERSION =~ /^1\.9\.\d$/
|
5
|
+
|
6
|
+
|
7
|
+
opts = GetoptLong.new([ '--snapshot', '-s', GetoptLong::REQUIRED_ARGUMENT ])
|
8
|
+
|
9
|
+
opts.each { |opt, arg|
|
10
|
+
if opt == '--snapshot' || opt == '-s'
|
11
|
+
raise ArgumentError, "Please provide a valid directory." unless File.directory?(arg)
|
12
|
+
FileUtils.cp_r File.expand_path(File.dirname(__FILE__) + '/..'), arg
|
13
|
+
end
|
14
|
+
}
|
data/common/Rakefile
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'platform_helpers'
|
5
|
+
#require 'archive/tar/minitar'
|
6
|
+
#require 'zlib'
|
7
|
+
|
8
|
+
base_dir = File.expand_path(File.dirname(__FILE__))
|
9
|
+
require "#{base_dir}/lib/monkey_patch"
|
10
|
+
require "#{base_dir}/lib/gem_helpers"
|
11
|
+
|
12
|
+
namespace :doc do
|
13
|
+
|
14
|
+
desc "create a CSV file for all test cases defined in a test suite(s)"
|
15
|
+
task :some_site_suites do
|
16
|
+
require "#{base_dir}/lib/gen_suite_doc"
|
17
|
+
Suite.create_doc(:suite_dir => "#{base_dir}/../qa_observer/suites",
|
18
|
+
:suites => [])
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
namespace :install do
|
23
|
+
desc "install gems to project"
|
24
|
+
task :gems do
|
25
|
+
puts "Go get a cup of black gold..this will take a bit"
|
26
|
+
|
27
|
+
reqs = [
|
28
|
+
'archive-tar-minitar', 'mechanize', 'minitest',
|
29
|
+
'minitest_tu_shim', 'net-scp', 'net-ssh', 'net-ssh-telnet -v 0.0.1', 'rmagick',
|
30
|
+
'templater', 'fastercsv', 'rubigen',
|
31
|
+
'getoptions', 'platform_helpers -v 0.1.2', 'color', 'json_pure', 'capture_io -v 0.1.1',
|
32
|
+
'transaction-simple', 'watir-webdriver', 'selenium-webdriver',
|
33
|
+
'childprocess', 'ffi', 'rubyzip', 'faker', 'i18n', 'rdoc', 'hpricot', 'wait_for'
|
34
|
+
]
|
35
|
+
=begin
|
36
|
+
reqs = [
|
37
|
+
'ruby_core_source', 'aquarium', 'archive-tar-minitar', 'mechanize', 'minitest',
|
38
|
+
'minitest_tu_shim', 'net-scp', 'net-ssh', 'net-ssh-telnet', 'rmagick',
|
39
|
+
'templater', 'pdf-reader', 'pdf-writer', 'fastercsv', 'linecache19',
|
40
|
+
'rubigen', 'getoptions', 'platform_helpers', 'color', 'json_pure', 'columnize',
|
41
|
+
'transaction-simple', 'watir-webdriver', 'selenium-webdriver', 'ruby-debug19',
|
42
|
+
'childprocess', 'ffi', 'rubyzip', 'faker', 'i18n', 'rdoc', 'hpricot'
|
43
|
+
]
|
44
|
+
=end
|
45
|
+
|
46
|
+
reqs.each { |gem| GemHelpers.install(gem, "#{base_dir}/gems/installed") }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
namespace :build do
|
51
|
+
desc "apply patches and update template files"
|
52
|
+
task :patch do
|
53
|
+
Build.monkey_patch
|
54
|
+
#Build.update_firewatir
|
55
|
+
end
|
56
|
+
|
57
|
+
desc "copy skeleton files to project directories"
|
58
|
+
task :copy_skeleton do
|
59
|
+
Build.copy_skeletons_to_project
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "modify gems/installed/bin/*.rb to include GemHelpers.update_gem_path"
|
63
|
+
task :update_gem_bin do
|
64
|
+
Build.update_bin
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Check pre-requisites"
|
68
|
+
task :pre do
|
69
|
+
Build.files_include?("#{base_dir}/../qa_observer", ['debugger', 'TODO', 'FIXME', 'NOTE'])
|
70
|
+
Build.files_include?("#{base_dir}/../mechanize_interface", ['debugger', 'TODO', 'FIXME', 'NOTE'])
|
71
|
+
Build.files_include?("#{base_dir}/../remote_unix", ['debugger', 'TODO', 'FIXME', 'NOTE'])
|
72
|
+
# TODO: add additional checks
|
73
|
+
end
|
74
|
+
|
75
|
+
desc "Apply modifications to client"
|
76
|
+
task :install_client do
|
77
|
+
['\qa_observer\client\gems\cache\archive-tar-minitar-0.5.2.gem', '\qa_observer\client\gems\cache\rubygems-update-1.3.2.gem'].each { |g|
|
78
|
+
`gem install #{g}`
|
79
|
+
}
|
80
|
+
GemHelpers.install("#{base_dir}/gems/cache", "#{base_dir}/gems/installed")
|
81
|
+
Build.update_bin
|
82
|
+
Build.monkey_patch
|
83
|
+
Build.update_firewatir
|
84
|
+
end
|
85
|
+
|
86
|
+
desc "perform a fresh checkout and create tar ball"
|
87
|
+
task :package_client do
|
88
|
+
Build.clean_client
|
89
|
+
Build.package_client
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
namespace :create_project do
|
94
|
+
end
|
95
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
- :patch:
|
3
|
+
:source: monkey_patches/MozillaBaseElement.rb
|
4
|
+
:destination: gems/installed/gems/firewatir-1.6.2/lib/firewatir
|
5
|
+
- :update_text:
|
6
|
+
:file: ./lib/agent.rb
|
7
|
+
:search: <QA_OBSERVER_INSTALL_SET_PATH>
|
8
|
+
:replace_eval: '"#{File.expand_path(File.dirname(__FILE__))}/.."'
|
9
|
+
:string_wrap: true
|
10
|
+
|
data/common/lib/array.rb
ADDED
data/common/lib/cache.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
class CacheStore
|
2
|
+
attr_accessor :store
|
3
|
+
def initialize(cache="#{File.expand_path(File.dirname(__FILE__))}/cache.pstore")
|
4
|
+
@store = PStore.new(cache)
|
5
|
+
end
|
6
|
+
def put(store_name, obj)
|
7
|
+
@store.transaction { @store[store_name] = obj }
|
8
|
+
end
|
9
|
+
def get(store_name)
|
10
|
+
@store.transaction { |store_keeper| store_keeper.fetch(store_name) }
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Constants
|
2
|
+
module Timeout
|
3
|
+
MONGREL=45
|
4
|
+
end
|
5
|
+
module Wine
|
6
|
+
PATH='/usr/bin/wine'
|
7
|
+
end
|
8
|
+
|
9
|
+
SUPPORTED_BROWSERS = %w(chrome firefox ie)
|
10
|
+
|
11
|
+
SET_SELECTION=['ALPHA', 'NUMERIC', 'SPECIAL']
|
12
|
+
|
13
|
+
|
14
|
+
alpha=%w(a b c d e f g h i j k l m n o p q r s t q u v w x y z Q W E R T Y U I O P A S D F G H J K L Z X C V B N M)
|
15
|
+
numeric=%w(0 1 2 3 4 5 6 7 8 9)
|
16
|
+
special=%w(~ ! @ # $ % ^ & * ( ) _ + ` _ + [ ] \ ; ' , . / { } | : " < > ?)
|
17
|
+
|
18
|
+
SETS = {:alpha => alpha, :numeric => numeric, :special => special}
|
19
|
+
|
20
|
+
# TODO, add options for speficying which sets to pull data from and
|
21
|
+
# other filtering capabilities
|
22
|
+
def self.rand_data(params={})
|
23
|
+
# default 100 rand chars using all sets
|
24
|
+
params[:length] ||= rand(100)
|
25
|
+
params[:sets] ||= [:alpha, :numeric, :special]
|
26
|
+
|
27
|
+
chars = []
|
28
|
+
params[:length].times { |ct|
|
29
|
+
set_key = params[:sets][rand(params[:sets].length)]
|
30
|
+
set = SETS[set_key]
|
31
|
+
chars << set[rand(set.length)]
|
32
|
+
}
|
33
|
+
chars
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class NotSupportedError < TypeError ; end
|
2
|
+
|
3
|
+
# mechanize interface definitions
|
4
|
+
class ManageTapesError < StandardError ; end
|
5
|
+
class ManageInitiatorsError < StandardError ; end
|
6
|
+
class ProxyArgumentError < ArgumentError ; end
|
7
|
+
class DepreciatedMethodError < StandardError ; end
|
8
|
+
class DBError < StandardError ; end
|
9
|
+
class CheckSumMisMatchError < StandardError ; end
|
10
|
+
class ImplemenationError < StandardError
|
11
|
+
puts = "Need to implement"
|
12
|
+
end
|
13
|
+
class FileNotFoundError< StandardError ; end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
<p>Test Purpose: After the user arrives on the home page verify the create
|
4
|
+
file feature</p>
|
5
|
+
|
6
|
+
<p>Steps:</p>
|
7
|
+
<ul><li>
|
8
|
+
<p>Naviage to the home page</p>
|
9
|
+
</li><li>
|
10
|
+
<p>Enter a file name in the Create Tmp File text field</p>
|
11
|
+
</li><li>
|
12
|
+
<p>Click the Create Tmp File submit button</p>
|
13
|
+
</li><li>
|
14
|
+
<p>Verify a message is displayed on the home page that the file was created</p>
|
15
|
+
</li><li>
|
16
|
+
<p>Login to the remote machine and ensure that the file exists</p>
|
17
|
+
</li></ul>
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<div class="method-source-code" id="test_file_created-source">
|
22
|
+
<pre>
|
23
|
+
<span class="ruby-comment"># File /home/cliff/l_bkup/svn/co/cyberconnect/qa_robusta/qa_observer/sites/demo/test_cases/home_page.rb, line 77</span>
|
24
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_file_created</span>
|
25
|
+
<span class="ruby-ivar">@demo_flows</span>.<span class="ruby-identifier">home</span>
|
26
|
+
<span class="ruby-ivar">@demo_flows</span>.<span class="ruby-identifier">home_page</span>.<span class="ruby-identifier">create_file_text_field</span>.<span class="ruby-identifier">set</span>(<span class="ruby-string">'blah'</span>)
|
27
|
+
<span class="ruby-ivar">@demo_flows</span>.<span class="ruby-identifier">home_page</span>.<span class="ruby-identifier">submit_create_file</span>.<span class="ruby-identifier">click</span>
|
28
|
+
<span class="ruby-identifier">wait_for</span>(<span class="ruby-value">2</span>) { <span class="ruby-ivar">@demo_flows</span>.<span class="ruby-identifier">home_page</span>.<span class="ruby-identifier">file_status</span>.<span class="ruby-identifier">text</span> <span class="ruby-operator">!=</span> <span class="ruby-string">''</span> }
|
29
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'file created'</span>, <span class="ruby-ivar">@demo_flows</span>.<span class="ruby-identifier">home_page</span>.<span class="ruby-identifier">file_status</span>.<span class="ruby-identifier">text</span>
|
30
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-ivar">@remote_unix</span>.<span class="ruby-identifier">file_exists?</span>(<span class="ruby-string">'/tmp/blah'</span>)
|
31
|
+
<span class="ruby-keyword">end</span></pre>
|
32
|
+
</div><!-- test_file_created-source -->
|
33
|
+
|
34
|
+
|