commonwatir 1.6.5 → 1.6.6.rc1
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.
- data/CHANGES +461 -0
- data/{README.txt → LICENSE} +22 -48
- data/Rakefile +13 -11
- data/VERSION +1 -0
- data/lib/commonwatir.rb +3 -3
- data/lib/watir.rb +7 -6
- data/lib/watir/assertions.rb +44 -44
- data/lib/watir/browser.rb +149 -149
- data/lib/watir/browsers.rb +13 -12
- data/lib/watir/exceptions.rb +47 -47
- data/lib/watir/matches.rb +17 -17
- data/lib/watir/options.rb +53 -52
- data/lib/watir/testcase.rb +97 -58
- data/lib/watir/waiter.rb +91 -91
- data/unittests/attach_to_existing_window_test.rb +71 -0
- data/unittests/browser_test.rb +18 -0
- data/unittests/buttons_test.rb +224 -0
- data/unittests/dd_test.rb +70 -0
- data/unittests/dl_test.rb +68 -0
- data/unittests/dt_test.rb +68 -0
- data/unittests/element_collections_test.rb +22 -0
- data/unittests/em_test.rb +67 -0
- data/unittests/form2_test.rb +22 -0
- data/unittests/html/blankpage.html +12 -0
- data/unittests/html/buttons1.html +41 -0
- data/unittests/html/buttons2.html +61 -0
- data/unittests/html/definition_lists.html +48 -0
- data/unittests/html/emphasis.html +12 -0
- data/unittests/html/entertainment_com.html +668 -0
- data/unittests/html/frame_buttons.html +4 -0
- data/unittests/html/images/button.jpg +0 -0
- data/unittests/html/pass.html +10 -0
- data/unittests/html/phrase_elements.html +15 -0
- data/unittests/html/select_lists.html +18 -0
- data/unittests/html/utf8.html +12 -0
- data/unittests/html/visibility.html +90 -0
- data/unittests/html/watir_unit_tests.css +64 -0
- data/unittests/html/whitespace.html +29 -0
- data/unittests/inspect_test.rb +29 -0
- data/unittests/options.yml.example +13 -0
- data/unittests/select_list_test.rb +19 -0
- data/unittests/setup.rb +17 -0
- data/unittests/setup/browser.rb +14 -0
- data/unittests/setup/capture_io_helper.rb +17 -0
- data/unittests/setup/filter.rb +24 -0
- data/unittests/setup/lib.rb +22 -0
- data/unittests/setup/options.rb +29 -0
- data/unittests/setup/testUnitAddons.rb +8 -0
- data/unittests/setup/watir-unittest.rb +74 -0
- data/unittests/strong_test.rb +32 -0
- data/unittests/utf8_test.rb +24 -0
- data/unittests/visibility_test.rb +47 -0
- data/unittests/whitespace_test.rb +40 -0
- metadata +121 -39
- data/History.txt +0 -5
- data/Manifest.txt +0 -14
data/{README.txt → LICENSE}
RENAMED
@@ -1,48 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
* sudo gem install commonwatir
|
24
|
-
|
25
|
-
== LICENSE:
|
26
|
-
|
27
|
-
(The MIT License)
|
28
|
-
|
29
|
-
Copyright (c) 2008, 2009 Bret Pettichord
|
30
|
-
|
31
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
32
|
-
a copy of this software and associated documentation files (the
|
33
|
-
'Software'), to deal in the Software without restriction, including
|
34
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
35
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
36
|
-
permit persons to whom the Software is furnished to do so, subject to
|
37
|
-
the following conditions:
|
38
|
-
|
39
|
-
The above copyright notice and this permission notice shall be
|
40
|
-
included in all copies or substantial portions of the Software.
|
41
|
-
|
42
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
43
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
44
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
45
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
46
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
47
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
48
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2008, 2009 Bret Pettichord
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/gempackagetask'
|
5
|
+
|
6
|
+
task :default => :package
|
7
|
+
|
8
|
+
gemspec = eval(File.read('commonwatir.gemspec'))
|
9
|
+
Rake::GemPackageTask.new(gemspec) do |p|
|
10
|
+
p.gem_spec = gemspec
|
11
|
+
p.need_tar = false
|
12
|
+
p.need_zip = false
|
13
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.6.6.rc1
|
data/lib/commonwatir.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
class CommonWatir
|
2
|
-
VERSION = '1.6.5'
|
3
|
-
end
|
1
|
+
class CommonWatir
|
2
|
+
VERSION = '1.6.5'
|
3
|
+
end
|
data/lib/watir.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# implementations.
|
4
|
-
|
5
|
-
|
6
|
-
require 'watir/
|
1
|
+
#--
|
2
|
+
# The 'watir' library loads the common watir code, common to all watir
|
3
|
+
# implementations. The 'watir/browser' library will autoload the actual
|
4
|
+
# implementations.
|
5
|
+
|
6
|
+
require 'watir/waiter'
|
7
|
+
require 'watir/browser'
|
data/lib/watir/assertions.rb
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
require 'test/unit/assertions'
|
2
|
-
|
3
|
-
module Watir
|
4
|
-
# Verification methods
|
5
|
-
module Assertions
|
6
|
-
include Test::Unit::Assertions
|
7
|
-
|
8
|
-
# Log a failure if the boolean is true. The message is the failure
|
9
|
-
# message logged.
|
10
|
-
# Whether true or false, the assertion count is incremented.
|
11
|
-
def verify boolean, message = 'verify failed.'
|
12
|
-
add_assertion
|
13
|
-
add_failure message.to_s, caller unless boolean
|
14
|
-
end
|
15
|
-
|
16
|
-
def verify_equal expected, actual, message=nil
|
17
|
-
full_message = build_message(message, <<EOT, expected, actual)
|
18
|
-
<?> expected but was
|
19
|
-
<?>.
|
20
|
-
EOT
|
21
|
-
verify(expected == actual, full_message)
|
22
|
-
end
|
23
|
-
def verify_match pattern, string, message=nil
|
24
|
-
pattern = case(pattern)
|
25
|
-
when String
|
26
|
-
Regexp.new(Regexp.escape(pattern))
|
27
|
-
else
|
28
|
-
pattern
|
29
|
-
end
|
30
|
-
full_message = build_message(message, "<?> expected to be =~\n<?>.", string, pattern)
|
31
|
-
verify(string =~ pattern, full_message)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
module Test::Unit::Assertions
|
38
|
-
def assert_false(boolean, message=nil)
|
39
|
-
_wrap_assertion do
|
40
|
-
assert_block("assert should not be called with a block.") { !block_given? }
|
41
|
-
assert_block(build_message(message, "<?> is not false.", boolean)) { !boolean }
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
1
|
+
require 'test/unit/assertions'
|
2
|
+
|
3
|
+
module Watir
|
4
|
+
# Verification methods used by Watir::TestCase
|
5
|
+
module Assertions
|
6
|
+
include Test::Unit::Assertions
|
7
|
+
|
8
|
+
# Log a failure if the boolean is true. The message is the failure
|
9
|
+
# message logged.
|
10
|
+
# Whether true or false, the assertion count is incremented.
|
11
|
+
def verify boolean, message = 'verify failed.'
|
12
|
+
add_assertion
|
13
|
+
add_failure message.to_s, caller unless boolean
|
14
|
+
end
|
15
|
+
|
16
|
+
def verify_equal expected, actual, message=nil
|
17
|
+
full_message = build_message(message, <<EOT, expected, actual)
|
18
|
+
<?> expected but was
|
19
|
+
<?>.
|
20
|
+
EOT
|
21
|
+
verify(expected == actual, full_message)
|
22
|
+
end
|
23
|
+
def verify_match pattern, string, message=nil
|
24
|
+
pattern = case(pattern)
|
25
|
+
when String
|
26
|
+
Regexp.new(Regexp.escape(pattern))
|
27
|
+
else
|
28
|
+
pattern
|
29
|
+
end
|
30
|
+
full_message = build_message(message, "<?> expected to be =~\n<?>.", string, pattern)
|
31
|
+
verify(string =~ pattern, full_message)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
module Test::Unit::Assertions
|
38
|
+
def assert_false(boolean, message=nil)
|
39
|
+
_wrap_assertion do
|
40
|
+
assert_block("assert should not be called with a block.") { !block_given? }
|
41
|
+
assert_block(build_message(message, "<?> is not false.", boolean)) { !boolean }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/watir/browser.rb
CHANGED
@@ -1,149 +1,149 @@
|
|
1
|
-
# watir/browser
|
2
|
-
require 'watir/options'
|
3
|
-
module Watir
|
4
|
-
|
5
|
-
=begin rdoc
|
6
|
-
|
7
|
-
Watir is a family of open-source drivers for automating web browsers. You
|
8
|
-
can use it to write tests that are easy to read and maintain.
|
9
|
-
|
10
|
-
Watir drives browsers the same way people do. It clicks links, fills in forms,
|
11
|
-
presses buttons. Watir also checks results, such as whether expected text
|
12
|
-
appears on a page.
|
13
|
-
|
14
|
-
The Watir family currently includes support for Internet Explorer (on Windows),
|
15
|
-
Firefox (on Windows, Mac and Linux) and Safari (on Mac).
|
16
|
-
|
17
|
-
Project Homepage: http://wtr.rubyforge.org
|
18
|
-
|
19
|
-
This Browser module provides a generic interface
|
20
|
-
that tests can use to access any browser. The actual browser (and thus
|
21
|
-
the actual Watir driver) is determined at runtime based on configuration
|
22
|
-
settings.
|
23
|
-
|
24
|
-
require 'watir'
|
25
|
-
browser = Watir::Browser.new
|
26
|
-
browser.goto 'http://google.com'
|
27
|
-
browser.text_field(:name, 'q').set 'pickaxe'
|
28
|
-
browser.button(:name, 'btnG').click
|
29
|
-
if browser.text.include? 'Programming Ruby'
|
30
|
-
puts 'Text was found'
|
31
|
-
else
|
32
|
-
puts 'Text was not found'
|
33
|
-
end
|
34
|
-
|
35
|
-
A comprehensive summary of the Watir API can be found here
|
36
|
-
http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
|
37
|
-
|
38
|
-
There are two ways to configure the browser that will be used by your tests.
|
39
|
-
|
40
|
-
One is to set the +watir_browser+ environment variable to +ie+ or +firefox+.
|
41
|
-
(How you do this depends on your platform.)
|
42
|
-
|
43
|
-
The other is to create a file that looks like this.
|
44
|
-
|
45
|
-
browser: ie
|
46
|
-
|
47
|
-
And then to add this line to your script, after the require statement and
|
48
|
-
before you invoke Browser.new.
|
49
|
-
|
50
|
-
Watir.options_file = 'path/to/the/file/you/just/created'
|
51
|
-
|
52
|
-
=end rdoc
|
53
|
-
|
54
|
-
module Browser
|
55
|
-
@@browser_classes = {}
|
56
|
-
@@sub_options = {}
|
57
|
-
@@default = nil
|
58
|
-
class << self
|
59
|
-
|
60
|
-
# Create a new instance of a browser driver, as determined by the
|
61
|
-
# configuration settings. (Don't be fooled: this is not actually
|
62
|
-
# an instance of Browser class.)
|
63
|
-
def new
|
64
|
-
set_sub_options
|
65
|
-
klass.new
|
66
|
-
end
|
67
|
-
# Create a new instance as with #new and start the browser on the
|
68
|
-
# specified url.
|
69
|
-
def start url
|
70
|
-
set_sub_options
|
71
|
-
klass.start url
|
72
|
-
end
|
73
|
-
# Attach to an existing browser.
|
74
|
-
def attach(how, what)
|
75
|
-
set_sub_options
|
76
|
-
klass.attach(how, what)
|
77
|
-
end
|
78
|
-
def set_options options
|
79
|
-
return unless
|
80
|
-
klass.set_options options
|
81
|
-
end
|
82
|
-
def options
|
83
|
-
return {} unless
|
84
|
-
klass.options
|
85
|
-
end
|
86
|
-
|
87
|
-
def klass
|
88
|
-
key = Watir.options[:browser]
|
89
|
-
eval @@browser_classes[key] # this triggers the autoload
|
90
|
-
end
|
91
|
-
private :klass
|
92
|
-
# Add support for the browser option, using the specified class,
|
93
|
-
# provided as a string. Optionally, additional options supported by
|
94
|
-
# the class can be specified as an array of symbols. Options specified
|
95
|
-
# by the user and included in this list will be passed (as a hash) to
|
96
|
-
# the set_options class method (if defined) before creating an instance.
|
97
|
-
def support hash_args
|
98
|
-
option = hash_args[:name]
|
99
|
-
class_string = hash_args[:class]
|
100
|
-
additional_options = hash_args[:options]
|
101
|
-
library = hash_args[:library]
|
102
|
-
gem = hash_args[:gem] || library
|
103
|
-
|
104
|
-
@@browser_classes[option] = class_string
|
105
|
-
@@sub_options[option] = additional_options
|
106
|
-
|
107
|
-
autoload class_string, library
|
108
|
-
activate_gem gem, option
|
109
|
-
end
|
110
|
-
|
111
|
-
def default
|
112
|
-
@@default
|
113
|
-
end
|
114
|
-
# Specifies a default browser. Must be specified before options are parsed.
|
115
|
-
def default= option
|
116
|
-
@@default = option
|
117
|
-
end
|
118
|
-
# Returns the names of the browsers that are supported by this module.
|
119
|
-
# These are the options for 'watir_browser' (env var) or 'browser:' (yaml).
|
120
|
-
def browser_names
|
121
|
-
@@browser_classes.keys
|
122
|
-
end
|
123
|
-
|
124
|
-
private
|
125
|
-
def autoload class_string, library
|
126
|
-
mod, klass = class_string.split('::')
|
127
|
-
eval "module ::#{mod}; autoload :#{klass}, '#{library}'; end"
|
128
|
-
end
|
129
|
-
# Activate the gem (if installed). The default browser will be set
|
130
|
-
# to the first gem that activates.
|
131
|
-
def activate_gem gem_name, option
|
132
|
-
begin
|
133
|
-
gem gem_name
|
134
|
-
@@default ||= option
|
135
|
-
rescue Gem::LoadError
|
136
|
-
end
|
137
|
-
end
|
138
|
-
def set_sub_options
|
139
|
-
sub_options = @@sub_options[Watir.options[:browser]]
|
140
|
-
return if sub_options.nil?
|
141
|
-
specified_options = Watir.options.reject {|k, v| !sub_options.include? k}
|
142
|
-
self.set_options specified_options
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
end
|
148
|
-
|
149
|
-
require 'watir/browsers'
|
1
|
+
# watir/browser
|
2
|
+
require 'watir/options'
|
3
|
+
module Watir
|
4
|
+
|
5
|
+
=begin rdoc
|
6
|
+
|
7
|
+
Watir is a family of open-source drivers for automating web browsers. You
|
8
|
+
can use it to write tests that are easy to read and maintain.
|
9
|
+
|
10
|
+
Watir drives browsers the same way people do. It clicks links, fills in forms,
|
11
|
+
presses buttons. Watir also checks results, such as whether expected text
|
12
|
+
appears on a page.
|
13
|
+
|
14
|
+
The Watir family currently includes support for Internet Explorer (on Windows),
|
15
|
+
Firefox (on Windows, Mac and Linux) and Safari (on Mac).
|
16
|
+
|
17
|
+
Project Homepage: http://wtr.rubyforge.org
|
18
|
+
|
19
|
+
This Browser module provides a generic interface
|
20
|
+
that tests can use to access any browser. The actual browser (and thus
|
21
|
+
the actual Watir driver) is determined at runtime based on configuration
|
22
|
+
settings.
|
23
|
+
|
24
|
+
require 'watir'
|
25
|
+
browser = Watir::Browser.new
|
26
|
+
browser.goto 'http://google.com'
|
27
|
+
browser.text_field(:name, 'q').set 'pickaxe'
|
28
|
+
browser.button(:name, 'btnG').click
|
29
|
+
if browser.text.include? 'Programming Ruby'
|
30
|
+
puts 'Text was found'
|
31
|
+
else
|
32
|
+
puts 'Text was not found'
|
33
|
+
end
|
34
|
+
|
35
|
+
A comprehensive summary of the Watir API can be found here
|
36
|
+
http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
|
37
|
+
|
38
|
+
There are two ways to configure the browser that will be used by your tests.
|
39
|
+
|
40
|
+
One is to set the +watir_browser+ environment variable to +ie+ or +firefox+.
|
41
|
+
(How you do this depends on your platform.)
|
42
|
+
|
43
|
+
The other is to create a file that looks like this.
|
44
|
+
|
45
|
+
browser: ie
|
46
|
+
|
47
|
+
And then to add this line to your script, after the require statement and
|
48
|
+
before you invoke Browser.new.
|
49
|
+
|
50
|
+
Watir.options_file = 'path/to/the/file/you/just/created'
|
51
|
+
|
52
|
+
=end rdoc
|
53
|
+
|
54
|
+
module Browser
|
55
|
+
@@browser_classes = {}
|
56
|
+
@@sub_options = {}
|
57
|
+
@@default = nil
|
58
|
+
class << self
|
59
|
+
|
60
|
+
# Create a new instance of a browser driver, as determined by the
|
61
|
+
# configuration settings. (Don't be fooled: this is not actually
|
62
|
+
# an instance of Browser class.)
|
63
|
+
def new
|
64
|
+
set_sub_options
|
65
|
+
klass.new
|
66
|
+
end
|
67
|
+
# Create a new instance as with #new and start the browser on the
|
68
|
+
# specified url.
|
69
|
+
def start url
|
70
|
+
set_sub_options
|
71
|
+
klass.start url
|
72
|
+
end
|
73
|
+
# Attach to an existing browser.
|
74
|
+
def attach(how, what)
|
75
|
+
set_sub_options
|
76
|
+
klass.attach(how, what)
|
77
|
+
end
|
78
|
+
def set_options options
|
79
|
+
return unless klass.respond_to?(:set_options)
|
80
|
+
klass.set_options options
|
81
|
+
end
|
82
|
+
def options
|
83
|
+
return {} unless klass.respond_to?(:options)
|
84
|
+
klass.options
|
85
|
+
end
|
86
|
+
|
87
|
+
def klass
|
88
|
+
key = Watir.options[:browser]
|
89
|
+
eval @@browser_classes[key] # this triggers the autoload
|
90
|
+
end
|
91
|
+
private :klass
|
92
|
+
# Add support for the browser option, using the specified class,
|
93
|
+
# provided as a string. Optionally, additional options supported by
|
94
|
+
# the class can be specified as an array of symbols. Options specified
|
95
|
+
# by the user and included in this list will be passed (as a hash) to
|
96
|
+
# the set_options class method (if defined) before creating an instance.
|
97
|
+
def support hash_args
|
98
|
+
option = hash_args[:name]
|
99
|
+
class_string = hash_args[:class]
|
100
|
+
additional_options = hash_args[:options]
|
101
|
+
library = hash_args[:library]
|
102
|
+
gem = hash_args[:gem] || library
|
103
|
+
|
104
|
+
@@browser_classes[option] = class_string
|
105
|
+
@@sub_options[option] = additional_options
|
106
|
+
|
107
|
+
autoload class_string, library
|
108
|
+
activate_gem gem, option
|
109
|
+
end
|
110
|
+
|
111
|
+
def default
|
112
|
+
@@default
|
113
|
+
end
|
114
|
+
# Specifies a default browser. Must be specified before options are parsed.
|
115
|
+
def default= option
|
116
|
+
@@default = option
|
117
|
+
end
|
118
|
+
# Returns the names of the browsers that are supported by this module.
|
119
|
+
# These are the options for 'watir_browser' (env var) or 'browser:' (yaml).
|
120
|
+
def browser_names
|
121
|
+
@@browser_classes.keys
|
122
|
+
end
|
123
|
+
|
124
|
+
private
|
125
|
+
def autoload class_string, library
|
126
|
+
mod, klass = class_string.split('::')
|
127
|
+
eval "module ::#{mod}; autoload :#{klass}, '#{library}'; end"
|
128
|
+
end
|
129
|
+
# Activate the gem (if installed). The default browser will be set
|
130
|
+
# to the first gem that activates.
|
131
|
+
def activate_gem gem_name, option
|
132
|
+
begin
|
133
|
+
gem gem_name
|
134
|
+
@@default ||= option
|
135
|
+
rescue Gem::LoadError
|
136
|
+
end
|
137
|
+
end
|
138
|
+
def set_sub_options
|
139
|
+
sub_options = @@sub_options[Watir.options[:browser]]
|
140
|
+
return if sub_options.nil?
|
141
|
+
specified_options = Watir.options.reject {|k, v| !sub_options.include? k}
|
142
|
+
self.set_options specified_options
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
end
|
148
|
+
|
149
|
+
require 'watir/browsers'
|