awetestlib 0.1.30-x86-mingw32 → 1.2.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +101 -41
  3. data/awetestlib.gemspec +36 -47
  4. data/awetestlib_osx.gemspec +24 -18
  5. data/awetestlib_windows.gemspec +46 -0
  6. data/bin/awetestlib +130 -111
  7. data/bin/awetestlib-driver-setup.rb +0 -2
  8. data/bin/awetestlib-helpers.rb +43 -30
  9. data/lib/awetestlib.rb +196 -20
  10. data/lib/awetestlib/command_line.rb +44 -0
  11. data/lib/awetestlib/html_report.rb +57 -50
  12. data/lib/awetestlib/logging.rb +242 -171
  13. data/lib/awetestlib/regression/awetest_dsl.rb +4240 -0
  14. data/lib/awetestlib/regression/browser.rb +514 -397
  15. data/lib/awetestlib/regression/date_and_time.rb +280 -0
  16. data/lib/awetestlib/regression/drag_and_drop.rb +24 -0
  17. data/lib/awetestlib/regression/find.rb +70 -43
  18. data/lib/awetestlib/regression/legacy.rb +1 -1
  19. data/lib/awetestlib/regression/mobile.rb +293 -0
  20. data/lib/awetestlib/regression/reporting.rb +298 -0
  21. data/lib/awetestlib/regression/runner.rb +156 -200
  22. data/lib/awetestlib/regression/tables.rb +117 -7
  23. data/lib/awetestlib/regression/test_data.rb +354 -0
  24. data/lib/awetestlib/regression/user_input.rb +179 -93
  25. data/lib/awetestlib/regression/utilities.rb +755 -286
  26. data/lib/awetestlib/regression/validations.rb +325 -115
  27. data/lib/awetestlib/regression/waits.rb +60 -133
  28. data/lib/awetestlib/runner.rb +5 -2
  29. data/lib/version.rb +11 -2
  30. data/setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb +109 -49
  31. data/setup_samples/sample_mobile_app/features/support/env.rb +1 -1
  32. data/test/google_search2.rb +7 -6
  33. data/test/popup_child_0.rb +13 -0
  34. data/test/popup_child_1.rb +33 -0
  35. data/test/watir_no_require.rb +13 -0
  36. data/test/watir_with_require.rb +16 -0
  37. data/test/zoho_exercise.rb +8 -8
  38. metadata +216 -303
  39. data/AwetestLib Instructions.rtf +0 -0
  40. data/awetestlib.windows.gemspec +0 -42
  41. data/lib/patches/README +0 -2
  42. data/lib/patches/firewatir.rb +0 -106
  43. data/lib/patches/watir.rb +0 -175
data/bin/awetestlib CHANGED
@@ -1,114 +1,133 @@
1
- $: << "./lib"
2
-
3
- $base_time = Time.now
4
- $load_times = Hash.new
5
- $capture_load_times = true
6
-
7
- require File.join(File.dirname(__FILE__),"awetestlib-helpers")
8
- require 'fileutils' #: load_time
9
-
10
- cmd = ARGV[0]
11
-
12
- if cmd.nil?
13
- print_usage
14
-
15
- elsif cmd == "regression_setup"
16
- require File.join(File.dirname(__FILE__),"awetestlib-regression-setup")
17
- awetestlib_regression_setup
18
- elsif cmd == "rubymine_setup"
19
- require File.join(File.dirname(__FILE__),"awetestlib-rubymine-setup")
20
- awetestlib_rubymine_setup
21
- elsif cmd == "netbeans_setup"
22
- require File.join(File.dirname(__FILE__),"awetestlib-netbeans-setup")
23
- awetestlib_netbeans_setup
24
- elsif cmd == 'cucumber_setup'
25
- require File.join(File.dirname(__FILE__),"awetestlib-cucumber-setup")
26
- awetestlib_cucumber_setup
27
- elsif cmd == 'mobile_app_setup'
28
- require File.join(File.dirname(__FILE__),"awetestlib-mobile-app-setup")
29
- awetestlib_mobile_app_setup
30
- elsif cmd == 'android_setup'
31
- require File.join(File.dirname(__FILE__),"awetestlib-android-setup")
32
- awetestlib_android_setup
33
- elsif cmd == 'driver_setup'
34
- require File.join(File.dirname(__FILE__),"awetestlib-driver-setup")
35
- awetestlib_driver_setup
36
- else
37
-
38
- require 'optparse' #; load_time('optparse')
39
- require 'awetestlib' #; load_time
40
-
41
- options = { }
42
- OptionParser.new do |opts|
43
- opts.banner = "Usage: awetestlib <script_file> [options]"
44
-
45
- opts.on("-m RUN_MODE", "--run_mode RUN_MODE", "Specify the run mode: local, local_zip, remote_zip") do |run_mode|
46
- options[:run_mode] = run_mode
47
- end
48
- opts.on("-r ROOT_PATH", "--root_path ROOT_PATH", "Specify the root path") do |root_path|
49
- options[:root_path] = root_path
50
- end
51
- opts.on("-l LIBRARY", "--library LIBRARY", "Specify a library to be loaded") do |library|
52
- options[:library] = library.to_s
53
- end
54
- opts.on("-x EXCEL_FILE", "--excel EXCEL_FILE", "Specify an excel file containing variables to be loaded") do |xls_path|
55
- options[:xls_path] = xls_path
56
- end
57
- opts.on("-b BROWSER", "--browser BROWSER", "Specify a browser (IE, FF, S, C)") do |browser|
58
- options[:browser] = browser
59
- end
60
- opts.on("-v VERSION", "--version VERSION", "Specify a browser version") do |v|
61
- options[:version] = v
62
- end
63
- opts.on("-e", "--environment_url ENVIRONMENT_URL", "Specify the environment URL") do |environment_url|
64
- options[:environment_url] = environment_url
65
- end
66
- opts.on("-f", "--environment_node_name ENVIRONMENT_NODENAME", "Specify the environment node name") do |node_name|
67
- options[:environment_nodename] = node_name
68
- end
69
- opts.on("-n", "--environment_name ENVIRONMENT_NAME", "Specify the environment name") do |environment_name|
70
- options[:environment_name] = environment_name
71
- end
72
- opts.on("-u SELENIUM_REMOTE_URL", "--selenium_remote_url SELENIUM_REMOTE_URL", "Specify the device's remote url and port") do |remote_url|
73
- options[:remote_url] = remote_url
74
- end
75
- opts.on("-s SCREENCAP_PATH", "--screencap-path SCREENCAP_PATH", "Specify the path where screenshots will be saved") do |screencap_path|
76
- options[:screencap_path] = screencap_path
77
- end
78
- opts.on("-d", "--debug", "Run debugger on first script failure") do
79
- options[:debug_on_fail] = true
80
- end
81
- # add persistent logging for awetestlib. pmn 05jun2012
82
- opts.on("-o", "--output_to_log", "Write to log file") do
83
- options[:output_to_log] = true
84
- end
85
- opts.on("-c", "--classic_watir", "Use Classic Watir for IE instead of Watir-webdriver") do
86
- options[:classic_watir] = true
87
- end
88
- opts.on("", "--log_path_subdir LOG_PATH_SUBDIR", "Specify log path relative to root_path.") do |log_path_subdir|
89
- options[:log_path_subdir] = log_path_subdir
90
- end
91
- opts.on("", "--report_all_test_refs REPORT_ALL_TEST_REFS", "Include list of all error/test case reference ids actually validated.") do
92
- options[:report_all_test_refs] = true
93
- end
94
- opts.on("", "--capture_load_times CAPTURE_LOAD_TIMES", "Capture load time for gem requires.") do
95
- options[:capture_load_times] = true
96
- end
97
-
98
- end.parse!
99
-
100
- options[:environment] ||= {}
101
- options[:environment]["name"] = options[:environment_name]
102
- options[:environment]["url"] = options[:environment_url]
103
- options[:environment]["nodename"] = options[:environment_nodename]
104
- check_script_type(options)
105
-
106
- $watir_script = options[:classic_watir]
107
- $capture_load_times = options[:capture_load_times] unless $capture_load_times
108
-
109
-
110
- IS_WIN_2008 = File.exists?("config/win2008.txt")
111
- Awetestlib::Runner.new(options)
1
+ $: << './lib'
2
+
3
+ $begin_time = Time.now
4
+ $base_time = Time.now
5
+ $load_times = Hash.new
6
+ $capture_load_times = true if ENV['AWETESTLIB-LOAD-TIMES']
7
+
8
+ require File.join(File.dirname(__FILE__), 'awetestlib-helpers')
9
+ require 'fileutils' # ; load_time
10
+
11
+ if ENV['RUBY-PROF']
12
+ require 'ruby-prof' # ; load_time
13
+ end
14
+
15
+ case ARGV[0]
16
+ when nil?
17
+ print_usage
18
+ else
19
+
20
+ require 'optparse' #; load_time('optparse')
21
+ require 'awetestlib' #; load_time('awetestlib')
22
+
23
+ options = {}
24
+
25
+ parse_script_type(options)
26
+
27
+ OptionParser.new do |opts|
28
+ opts.banner = "Usage: awetestlib <script_file> [options]"
29
+
30
+ opts.on("-b", "--browser BROWSER", :required, "Specify a browser by abbreviation (IE, FF, S, C) Required.") do |browser|
31
+ options[:browser] = browser
32
+ end
33
+ opts.on("-d", "--debug", "Turn on dsl debug messaging") do
34
+ options[:debug_dsl] = true
35
+ end
36
+ opts.on("-e", "--environment_url ENVIRONMENT_URL", "Specify the environment URL") do |environment_url|
37
+ options[:environment_url] = environment_url
38
+ end
39
+ opts.on("-f", "--environment_node_name ENVIRONMENT_NODENAME", "Specify the environment node name") do |node_name|
40
+ options[:environment_nodename] = node_name
41
+ end
42
+ opts.on("-l", "--library LIBRARY", "Specify a library to be loaded") do |library|
43
+ options[:library] = library.to_s
44
+ end
45
+ opts.on("-m", "--run_mode RUN_MODE", "Specify the run mode: local, local_zip, remote_zip") do |run_mode|
46
+ options[:run_mode] = run_mode
47
+ end
48
+ opts.on("-n", "--environment_name ENVIRONMENT_NAME", "Specify the environment name") do |environment_name|
49
+ options[:environment_name] = environment_name
50
+ end
51
+ opts.on("-o", "--output_to_log", "Write to log file") do
52
+ options[:output_to_log] = true
53
+ end
54
+ opts.on("-p", "--pry", "Require Pry for debugging") do
55
+ options[:pry] = true
56
+ end
57
+ opts.on("-r", "--root_path ROOT_PATH", "Specify the root path") do |root_path|
58
+ options[:root_path] = root_path
59
+ end
60
+ opts.on("-s", "--screencap-path SCREENCAP_PATH", "Specify the path where screenshots will be saved") do |screencap_path|
61
+ options[:screencap_path] = screencap_path
62
+ end
63
+ opts.on("-t", "--locate_timeout LOCATE_TIMEOUT", "Set timeout for locating DOM elements.") do |seconds|
64
+ options[:locate_timeout] = seconds
65
+ end
66
+ opts.on("-u", "--selenium_remote_url SELENIUM_REMOTE_URL", "Specify the device's remote url and port") do |remote_url|
67
+ options[:remote_url] = remote_url
68
+ end
69
+ opts.on("-v", "--version VERSION", "Specify a browser version") do |version|
70
+ options[:version] = version
71
+ end
72
+ opts.on("-x", "--excel EXCEL_FILE", "Specify an excel file containing variables to be loaded") do |xls_path|
73
+ options[:xls_path] = xls_path
74
+ end
75
+ opts.on("-E", "--emulator EMULATOR", "Mobile emulator image (avd)") do |emulator|
76
+ options[:emulator] = emulator
77
+ end
78
+ opts.on("-T", "--device_type DEVICE_TYPE", "Mobile device type (ipad, iphone)") do |device_type|
79
+ options[:device_type] = device_type
80
+ end
81
+ opts.on("-I", "--device_id DEVICE_ID", "Mobile device identifier 'UDID'") do |device_id|
82
+ options[:device_id] = device_id
83
+ end
84
+ opts.on("-K", "--sdk SDK", "Mobile native sdk") do |sdk|
85
+ options[:sdk] = sdk
86
+ end
87
+ opts.on("-P", "--platform PLATFORM", "Mobile or desktop platform: Android, iOS, Windows, or Mac") do |platform|
88
+ options[:platform] = platform
89
+ end
90
+ opts.on("-S", "--log_path_subdir LOG_PATH_SUBDIR", "Specify log path relative to root_path.") do |log_path_subdir|
91
+ options[:log_path_subdir] = log_path_subdir
92
+ end
93
+ opts.on("-R", "--report_all_test_refs REPORT_ALL_REFS", "Include report of all error/test case reference ids actually validated. Default is true") do |report_all_test_refs|
94
+ options[:report_all_test_refs] = report_all_test_refs
95
+ end
96
+ opts.on("-D", "--global_debug", "Set all global debug variables to true. ($DEBUG, $debug, $Debug") do
97
+ options[:global_debug] = true
98
+ end
99
+ opts.on("-L", "--capture_load_times", "Capture load time for gem requires.") do
100
+ options[:capture_load_times] = true
101
+ end
102
+ opts.on("-h", "--help", "Awetestlib options:") do
103
+ puts opts
104
+ exit
105
+ end
106
+
107
+ end.parse!
108
+
109
+ unless options[:report_all_test_refs] and options[:report_all_test_refs] == false
110
+ options[:report_all_test_refs] = true
111
+ end
112
+
113
+ unless options[:browser]
114
+ puts "Missing -b/--browser option. We can't test a browser without knowing which one..."
115
+ puts opts
116
+ exit
117
+ end
118
+
119
+ options[:environment] ||= {}
120
+ options[:environment]['name'] = options[:environment_name]
121
+ options[:environment]['url'] = options[:environment_url]
122
+ options[:environment]['nodename'] = options[:environment_nodename]
123
+
124
+ options[:log_path_subdir] = 'awetest_report' if options[:output_to_log] and not options[:log_path_subdir]
125
+
126
+ # $watir_script = options[:classic_watir]
127
+ $capture_load_times = options[:capture_load_times] unless $capture_load_times
128
+
129
+ IS_WIN_2008 = File.exists?('config/win2008.txt')
130
+ Awetestlib::Runner.new(options)
112
131
 
113
132
 
114
133
  end
@@ -1,8 +1,6 @@
1
- require 'pry'
2
1
  def awetestlib_driver_setup
3
2
  current_dir = Dir.pwd
4
3
  drivers_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "drivers"))
5
- # binding.pry
6
4
  ie_driver = File.join(drivers_dir,"IEDriverServer.exe")
7
5
  chrome_driver = File.join(drivers_dir,"chromedriver.exe")
8
6
  msg("Question") do
@@ -1,39 +1,45 @@
1
1
  def msg(title, &block)
2
2
  puts "\n" + "-"*10 + title + "-"*10
3
3
  block.call
4
- puts "-"*10 + "-------" + "-"*10 + "\n"
4
+ puts "-"*10 + "-"*title.length + "-"*10 + "\n"
5
5
  end
6
6
 
7
7
 
8
8
  def print_usage
9
9
  puts <<EOF
10
- Usage Options:
11
-
12
- awetestlib regression_setup
13
- setup awetest regression and register autoitx3.dll in Windows
14
-
15
- awetestlib rubymine_setup <project_name>
16
- setup a rubymine project
17
-
18
- awetestlib netbeans_setup <project_name>
19
- setup a netbeans project
20
-
21
- awetestlib mobile_app_setup <project_name>
22
- setup a mobile app project
23
-
24
- awetestlib cucumber_setup <project_name>
25
- setup cucumber regression and provide skeleton folder structure
10
+ Usage:
26
11
 
27
12
  awetestlib <script_file> [parameters]
28
13
  run an awetest regression script
29
14
 
30
15
  EOF
16
+
17
+ # awetestlib regression_setup
18
+ # setup awetest regression and register autoitx3.dll in Windows
19
+ #
20
+ # awetestlib rubymine_setup <project_name>
21
+ # setup a rubymine project
22
+ #
23
+ # awetestlib netbeans_setup <project_name>
24
+ # setup a netbeans project
25
+ #
26
+ # awetestlib mobile_app_setup <project_name>
27
+ # setup a mobile app project
28
+ #
29
+ # awetestlib cucumber_setup <project_name>
30
+ # setup cucumber regression and provide skeleton folder structure
31
+
31
32
  end
32
33
 
33
- def check_script_type(options)
34
- script_options = ['Regression', 'Cucumber']
34
+ def parse_script_type(options)
35
+ script_options = ['Regression', 'Awetest', 'AwetestDSL', 'Awetestlib', 'Cucumber']
35
36
  if script_options.include? ARGV[0]
36
- options[:script_type] = ARGV[0]
37
+ case ARGV[0]
38
+ when 'Regression', 'Awetest', 'AwetestDSL', 'Awetestlib'
39
+ options[:script_type] = 'Regression'
40
+ else
41
+ options[:script_type] = ARGV[0]
42
+ end
37
43
  options[:script_file] = ARGV[1]
38
44
  else
39
45
  options[:script_type] = 'Regression'
@@ -41,21 +47,28 @@ def check_script_type(options)
41
47
  end
42
48
  end
43
49
 
44
- def load_time(what = nil, time = Time.now)
50
+ def load_time(what = nil, base = nil, time = Time.now)
45
51
  if $capture_load_times
46
52
  caller = Kernel.caller
47
53
  called = $"
48
54
  unless what
49
- what = "#{caller[0]} => #{called[called.length - 1]}"
55
+ drv, file, line, meth = caller[0].split(':')
56
+ if drv.length > 2
57
+ meth = line
58
+ line = file
59
+ file = drv
60
+ end
61
+ what = "#{File.basename(file)} at #{line} #{meth} => #{called[called.length - 1]}"
62
+ #what = "#{File.basename(caller[0])} => #{called[called.length - 1]}"
50
63
  end
51
- elapsed = time - $base_time
52
- msg = "#{what} #{sprintf('%.4f', elapsed)}"
53
- $load_times[time.to_f] = msg
54
- begin
55
- debug_to_report("#{time.to_f}: #{msg}")
56
- rescue
57
- puts("#{time.to_f}: #{msg}")
64
+ if base
65
+ elapsed = time - base
66
+ else
67
+ elapsed = time - $base_time
58
68
  end
59
- $base_time = time
69
+ msg = "#{what} took #{sprintf('%.4f', elapsed)} seconds"
70
+ $load_times[time.to_f] = msg
71
+ puts("#{time.to_f}: #{msg}")
72
+ $base_time = time unless base
60
73
  end
61
74
  end
data/lib/awetestlib.rb CHANGED
@@ -1,17 +1,30 @@
1
- #require 'yaml' #Couldn't find use anywhere
2
- require 'active_support/core_ext/hash'
3
-
4
1
  module Awetestlib
2
+
5
3
  ::USING_WINDOWS = !!((RUBY_PLATFORM =~ /(win|w)(32|64)$/) || (RUBY_PLATFORM=~ /mswin|mingw/))
6
- ::USING_OSX = RUBY_PLATFORM =~ /darwin/
4
+
5
+ if !defined?(JRUBY_VERSION).nil?
6
+ ::USING_OSX = !defined?(JRUBY_VERSION).nil?
7
+ else
8
+ ::USING_OSX = RUBY_PLATFORM =~ /darwin/
9
+ end
7
10
 
8
11
  # @private
9
- BROWSER_MAP = {
12
+ BROWSER_MAP = {
10
13
  'FF' => 'Firefox',
11
14
  'IE' => 'Internet Explorer',
15
+ 'ED' => 'Microsoft Edge',
12
16
  'S' => 'Safari',
13
- 'MS' => 'Mobile Safari',
14
- 'C' => 'Chrome'
17
+ 'O' => 'Opera',
18
+ 'GC' => 'Google Chrome',
19
+ 'C' => 'Google Chrome',
20
+ 'MI' => 'Mobile Internet Explorer',
21
+ 'ME' => 'Mobile Edge',
22
+ 'IS' => 'iOS Safari',
23
+ 'MS' => 'iOS Safari',
24
+ 'IC' => 'iOS Chrome',
25
+ 'MC' => 'iOS Chrome',
26
+ 'AC' => 'Android Chrome',
27
+ 'AB' => 'Android Browser'
15
28
  }
16
29
 
17
30
  # @private
@@ -20,22 +33,185 @@ module Awetestlib
20
33
  'Windows' => { 'S' => 'IE' }
21
34
  }
22
35
 
23
- if USING_WINDOWS
24
- #require 'win32ole' <-- We'll load this later in Shamisen::AwetestLegacy::Runner. It has to be loaded after watir, see https://www.pivotaltracker.com/story/show/19249981
25
- #require 'win32/screenshot' # triggering segmentation fault 10sep2012 pmn
26
- end
27
- #require 'active_support/inflector'
28
- #require 'active_support/core_ext/object'
29
- #require 'active_support/core_ext/hash'
30
- require 'awetestlib/runner' #; load_time
31
- require 'andand' #; load_time
32
- require 'awetestlib/regression/runner' #; load_time
33
- require 'pry' #; load_time
36
+ HTML_COLORS = {
37
+ "#{'Black'.downcase}" => '#000000',
38
+ "#{'Navy'.downcase}" => '#000080',
39
+ "#{'DarkBlue'.downcase}" => '#00008B',
40
+ "#{'MediumBlue'.downcase}" => '#0000CD',
41
+ "#{'Blue'.downcase}" => '#0000FF',
42
+ "#{'DarkGreen'.downcase}" => '#006400',
43
+ "#{'Green'.downcase}" => '#008000',
44
+ "#{'Teal'.downcase}" => '#008080',
45
+ "#{'DarkCyan'.downcase}" => '#008B8B',
46
+ "#{'DeepSkyBlue'.downcase}" => '#00BFFF',
47
+ "#{'DarkTurquoise'.downcase}" => '#00CED1',
48
+ "#{'MediumSpringGreen'.downcase}" => '#00FA9A',
49
+ "#{'Lime'.downcase}" => '#00FF00',
50
+ "#{'SpringGreen'.downcase}" => '#00FF7F',
51
+ "#{'Aqua'.downcase}" => '#00FFFF',
52
+ "#{'Cyan'.downcase}" => '#00FFFF',
53
+ "#{'MidnightBlue'.downcase}" => '#191970',
54
+ "#{'DodgerBlue'.downcase}" => '#1E90FF',
55
+ "#{'LightSeaGreen'.downcase}" => '#20B2AA',
56
+ "#{'ForestGreen'.downcase}" => '#228B22',
57
+ "#{'SeaGreen'.downcase}" => '#2E8B57',
58
+ "#{'DarkSlateGray'.downcase}" => '#2F4F4F',
59
+ "#{'LimeGreen'.downcase}" => '#32CD32',
60
+ "#{'MediumSeaGreen'.downcase}" => '#3CB371',
61
+ "#{'Turquoise'.downcase}" => '#40E0D0',
62
+ "#{'RoyalBlue'.downcase}" => '#4169E1',
63
+ "#{'SteelBlue'.downcase}" => '#4682B4',
64
+ "#{'DarkSlateBlue'.downcase}" => '#483D8B',
65
+ "#{'MediumTurquoise'.downcase}" => '#48D1CC',
66
+ "#{'Indigo'.downcase}" => '#4B0082',
67
+ "#{'DarkOliveGreen'.downcase}" => '#556B2F',
68
+ "#{'CadetBlue'.downcase}" => '#5F9EA0',
69
+ "#{'CornflowerBlue'.downcase}" => '#6495ED',
70
+ "#{'MediumAquaMarine'.downcase}" => '#66CDAA',
71
+ "#{'DimGray'.downcase}" => '#696969',
72
+ "#{'SlateBlue'.downcase}" => '#6A5ACD',
73
+ "#{'OliveDrab'.downcase}" => '#6B8E23',
74
+ "#{'SlateGray'.downcase}" => '#708090',
75
+ "#{'LightSlateGray'.downcase}" => '#778899',
76
+ "#{'MediumSlateBlue'.downcase}" => '#7B68EE',
77
+ "#{'LawnGreen'.downcase}" => '#7CFC00',
78
+ "#{'Chartreuse'.downcase}" => '#7FFF00',
79
+ "#{'Aquamarine'.downcase}" => '#7FFFD4',
80
+ "#{'Maroon'.downcase}" => '#800000',
81
+ "#{'Purple'.downcase}" => '#800080',
82
+ "#{'Olive'.downcase}" => '#808000',
83
+ "#{'Gray'.downcase}" => '#808080',
84
+ "#{'SkyBlue'.downcase}" => '#87CEEB',
85
+ "#{'LightSkyBlue'.downcase}" => '#87CEFA',
86
+ "#{'BlueViolet'.downcase}" => '#8A2BE2',
87
+ "#{'DarkRed'.downcase}" => '#8B0000',
88
+ "#{'DarkMagenta'.downcase}" => '#8B008B',
89
+ "#{'SaddleBrown'.downcase}" => '#8B4513',
90
+ "#{'DarkSeaGreen'.downcase}" => '#8FBC8F',
91
+ "#{'LightGreen'.downcase}" => '#90EE90',
92
+ "#{'MediumPurple'.downcase}" => '#9370DB',
93
+ "#{'DarkViolet'.downcase}" => '#9400D3',
94
+ "#{'PaleGreen'.downcase}" => '#98FB98',
95
+ "#{'DarkOrchid'.downcase}" => '#9932CC',
96
+ "#{'YellowGreen'.downcase}" => '#9ACD32',
97
+ "#{'Sienna'.downcase}" => '#A0522D',
98
+ "#{'Brown'.downcase}" => '#A52A2A',
99
+ "#{'DarkGray'.downcase}" => '#A9A9A9',
100
+ "#{'LightBlue'.downcase}" => '#ADD8E6',
101
+ "#{'GreenYellow'.downcase}" => '#ADFF2F',
102
+ "#{'PaleTurquoise'.downcase}" => '#AFEEEE',
103
+ "#{'LightSteelBlue'.downcase}" => '#B0C4DE',
104
+ "#{'PowderBlue'.downcase}" => '#B0E0E6',
105
+ "#{'FireBrick'.downcase}" => '#B22222',
106
+ "#{'DarkGoldenRod'.downcase}" => '#B8860B',
107
+ "#{'MediumOrchid'.downcase}" => '#BA55D3',
108
+ "#{'RosyBrown'.downcase}" => '#BC8F8F',
109
+ "#{'DarkKhaki'.downcase}" => '#BDB76B',
110
+ "#{'Silver'.downcase}" => '#C0C0C0',
111
+ "#{'MediumVioletRed'.downcase}" => '#C71585',
112
+ "#{'IndianRed'.downcase}" => '#CD5C5C',
113
+ "#{'Peru'.downcase}" => '#CD853F',
114
+ "#{'Chocolate'.downcase}" => '#D2691E',
115
+ "#{'Tan'.downcase}" => '#D2B48C',
116
+ "#{'LightGray'.downcase}" => '#D3D3D3',
117
+ "#{'Thistle'.downcase}" => '#D8BFD8',
118
+ "#{'Orchid'.downcase}" => '#DA70D6',
119
+ "#{'GoldenRod'.downcase}" => '#DAA520',
120
+ "#{'PaleVioletRed'.downcase}" => '#DB7093',
121
+ "#{'Crimson'.downcase}" => '#DC143C',
122
+ "#{'Gainsboro'.downcase}" => '#DCDCDC',
123
+ "#{'Plum'.downcase}" => '#DDA0DD',
124
+ "#{'BurlyWood'.downcase}" => '#DEB887',
125
+ "#{'LightCyan'.downcase}" => '#E0FFFF',
126
+ "#{'Lavender'.downcase}" => '#E6E6FA',
127
+ "#{'DarkSalmon'.downcase}" => '#E9967A',
128
+ "#{'Violet'.downcase}" => '#EE82EE',
129
+ "#{'PaleGoldenRod'.downcase}" => '#EEE8AA',
130
+ "#{'LightCoral'.downcase}" => '#F08080',
131
+ "#{'Khaki'.downcase}" => '#F0E68C',
132
+ "#{'AliceBlue'.downcase}" => '#F0F8FF',
133
+ "#{'HoneyDew'.downcase}" => '#F0FFF0',
134
+ "#{'Azure'.downcase}" => '#F0FFFF',
135
+ "#{'SandyBrown'.downcase}" => '#F4A460',
136
+ "#{'Wheat'.downcase}" => '#F5DEB3',
137
+ "#{'Beige'.downcase}" => '#F5F5DC',
138
+ "#{'WhiteSmoke'.downcase}" => '#F5F5F5',
139
+ "#{'MintCream'.downcase}" => '#F5FFFA',
140
+ "#{'GhostWhite'.downcase}" => '#F8F8FF',
141
+ "#{'Salmon'.downcase}" => '#FA8072',
142
+ "#{'AntiqueWhite'.downcase}" => '#FAEBD7',
143
+ "#{'Linen'.downcase}" => '#FAF0E6',
144
+ "#{'LightGoldenRodYellow'.downcase}" => '#FAFAD2',
145
+ "#{'OldLace'.downcase}" => '#FDF5E6',
146
+ "#{'Red'.downcase}" => '#FF0000',
147
+ "#{'Fuchsia'.downcase}" => '#FF00FF',
148
+ "#{'Magenta'.downcase}" => '#FF00FF',
149
+ "#{'DeepPink'.downcase}" => '#FF1493',
150
+ "#{'OrangeRed'.downcase}" => '#FF4500',
151
+ "#{'Tomato'.downcase}" => '#FF6347',
152
+ "#{'HotPink'.downcase}" => '#FF69B4',
153
+ "#{'Coral'.downcase}" => '#FF7F50',
154
+ "#{'DarkOrange'.downcase}" => '#FF8C00',
155
+ "#{'LightSalmon'.downcase}" => '#FFA07A',
156
+ "#{'Orange'.downcase}" => '#FFA500',
157
+ "#{'LightPink'.downcase}" => '#FFB6C1',
158
+ "#{'Pink'.downcase}" => '#FFC0CB',
159
+ "#{'Gold'.downcase}" => '#FFD700',
160
+ "#{'PeachPuff'.downcase}" => '#FFDAB9',
161
+ "#{'NavajoWhite'.downcase}" => '#FFDEAD',
162
+ "#{'Moccasin'.downcase}" => '#FFE4B5',
163
+ "#{'Bisque'.downcase}" => '#FFE4C4',
164
+ "#{'MistyRose'.downcase}" => '#FFE4E1',
165
+ "#{'BlanchedAlmond'.downcase}" => '#FFEBCD',
166
+ "#{'PapayaWhip'.downcase}" => '#FFEFD5',
167
+ "#{'LavenderBlush'.downcase}" => '#FFF0F5',
168
+ "#{'SeaShell'.downcase}" => '#FFF5EE',
169
+ "#{'Cornsilk'.downcase}" => '#FFF8DC',
170
+ "#{'LemonChiffon'.downcase}" => '#FFFACD',
171
+ "#{'FloralWhite'.downcase}" => '#FFFAF0',
172
+ "#{'Snow'.downcase}" => '#FFFAFA',
173
+ "#{'Yellow'.downcase}" => '#FFFF00',
174
+ "#{'LightYellow'.downcase}" => '#FFFFE0',
175
+ "#{'Ivory'.downcase}" => '#FFFFF0',
176
+ "#{'White'.downcase}" => '#FFFFFF',
177
+ }
178
+
179
+ VERIFY_MSG = true
180
+ NO_DOLLAR_BANG = false
181
+
182
+ require 'date'
183
+ require 'active_support/all'
184
+ require 'awetestlib/runner'
185
+ require 'yaml'
186
+ # require 'andand'
187
+ require 'awetestlib/regression/runner'
188
+ require 'html_validation'
189
+ require 'html_validation/page_validations'
190
+ require 'html_validation/html_validation_result'
191
+ require 'w3c_validators'
192
+ require 'roo'
193
+ require 'pry'
194
+ require 'rbconfig'
34
195
 
35
196
  if USING_OSX
36
- require 'appscript' #; load_time
197
+ # Issue with jruby unable to compile
198
+ # require 'appscript' #; load_time
37
199
  end
38
200
 
39
- #require 'roo' #moved to awetestlib runner
201
+ def using_windows?
202
+ host_os.include?("mswin") || host_os.include?("mingw")
203
+ end
204
+
205
+ def using_osx?
206
+ host_os.include?("darwin")
207
+ end
208
+
209
+ def host_os
210
+ RbConfig::CONFIG['host_os']
211
+ end
212
+
213
+ def using_jruby?
214
+ defined?(JRUBY_VERSION)
215
+ end
40
216
 
41
217
  end