watir 5.0.0 → 6.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +5 -0
- data/.gitignore +21 -0
- data/.gitmodules +3 -0
- data/.travis.yml +35 -0
- data/CHANGES.md +1756 -0
- data/Gemfile +12 -0
- data/LICENSE +23 -0
- data/README.md +92 -0
- data/Rakefile +161 -32
- data/lib/watir.rb +127 -1
- data/lib/watir/after_hooks.rb +132 -0
- data/lib/watir/alert.rb +104 -0
- data/lib/watir/aliases.rb +6 -0
- data/lib/watir/atoms.rb +24 -0
- data/lib/watir/atoms/README +3 -0
- data/lib/watir/atoms/fireEvent.js +29 -0
- data/lib/watir/atoms/getAttribute.js +18 -0
- data/lib/watir/atoms/getInnerHtml.js +18 -0
- data/lib/watir/atoms/getOuterHtml.js +18 -0
- data/lib/watir/atoms/getParentElement.js +17 -0
- data/lib/watir/atoms/selectText.js +61 -0
- data/lib/watir/attribute_helper.rb +98 -0
- data/lib/watir/browser.rb +346 -0
- data/lib/watir/cell_container.rb +25 -0
- data/lib/watir/container.rb +51 -0
- data/lib/watir/cookies.rb +132 -0
- data/lib/watir/element_collection.rb +126 -0
- data/lib/watir/elements/area.rb +12 -0
- data/lib/watir/elements/button.rb +37 -0
- data/lib/watir/elements/cell.rb +17 -0
- data/lib/watir/elements/checkbox.rb +54 -0
- data/lib/watir/elements/dlist.rb +12 -0
- data/lib/watir/elements/element.rb +646 -0
- data/lib/watir/elements/file_field.rb +41 -0
- data/lib/watir/elements/font.rb +11 -0
- data/lib/watir/elements/form.rb +17 -0
- data/lib/watir/elements/hidden.rb +20 -0
- data/lib/watir/elements/html_elements.rb +2063 -0
- data/lib/watir/elements/iframe.rb +163 -0
- data/lib/watir/elements/image.rb +62 -0
- data/lib/watir/elements/input.rb +7 -0
- data/lib/watir/elements/link.rb +18 -0
- data/lib/watir/elements/option.rb +74 -0
- data/lib/watir/elements/radio.rb +42 -0
- data/lib/watir/elements/row.rb +17 -0
- data/lib/watir/elements/select.rb +238 -0
- data/lib/watir/elements/svg_elements.rb +667 -0
- data/lib/watir/elements/table.rb +42 -0
- data/lib/watir/elements/table_cell.rb +6 -0
- data/lib/watir/elements/table_row.rb +15 -0
- data/lib/watir/elements/table_section.rb +15 -0
- data/lib/watir/elements/text_area.rb +5 -0
- data/lib/watir/elements/text_field.rb +37 -0
- data/lib/watir/exception.rb +17 -0
- data/lib/watir/extensions/nokogiri.rb +14 -0
- data/lib/watir/extensions/select_text.rb +10 -0
- data/lib/watir/generator.rb +3 -0
- data/lib/watir/generator/base.rb +11 -0
- data/lib/watir/generator/base/generator.rb +115 -0
- data/lib/watir/generator/base/idl_sorter.rb +47 -0
- data/lib/watir/generator/base/spec_extractor.rb +138 -0
- data/lib/watir/generator/base/util.rb +21 -0
- data/lib/watir/generator/base/visitor.rb +157 -0
- data/lib/watir/generator/html.rb +15 -0
- data/lib/watir/generator/html/generator.rb +36 -0
- data/lib/watir/generator/html/spec_extractor.rb +50 -0
- data/lib/watir/generator/html/visitor.rb +21 -0
- data/lib/watir/generator/svg.rb +7 -0
- data/lib/watir/generator/svg/generator.rb +38 -0
- data/lib/watir/generator/svg/spec_extractor.rb +46 -0
- data/lib/watir/generator/svg/visitor.rb +21 -0
- data/lib/watir/has_window.rb +53 -0
- data/lib/watir/locators.rb +22 -0
- data/lib/watir/locators/button/locator.rb +38 -0
- data/lib/watir/locators/button/selector_builder.rb +27 -0
- data/lib/watir/locators/button/selector_builder/xpath.rb +29 -0
- data/lib/watir/locators/button/validator.rb +15 -0
- data/lib/watir/locators/cell/locator.rb +17 -0
- data/lib/watir/locators/cell/selector_builder.rb +24 -0
- data/lib/watir/locators/element/locator.rb +249 -0
- data/lib/watir/locators/element/selector_builder.rb +147 -0
- data/lib/watir/locators/element/selector_builder/css.rb +65 -0
- data/lib/watir/locators/element/selector_builder/xpath.rb +72 -0
- data/lib/watir/locators/element/validator.rb +23 -0
- data/lib/watir/locators/row/locator.rb +17 -0
- data/lib/watir/locators/row/selector_builder.rb +29 -0
- data/lib/watir/locators/text_area/locator.rb +13 -0
- data/lib/watir/locators/text_area/selector_builder.rb +22 -0
- data/lib/watir/locators/text_field/locator.rb +44 -0
- data/lib/watir/locators/text_field/selector_builder.rb +34 -0
- data/lib/watir/locators/text_field/selector_builder/xpath.rb +19 -0
- data/lib/watir/locators/text_field/validator.rb +20 -0
- data/lib/watir/row_container.rb +36 -0
- data/lib/watir/screenshot.rb +50 -0
- data/lib/watir/user_editable.rb +38 -0
- data/lib/watir/version.rb +3 -3
- data/lib/watir/wait.rb +250 -0
- data/lib/watir/wait/timer.rb +19 -0
- data/lib/watir/window.rb +244 -0
- data/lib/watir/xpath_support.rb +20 -0
- data/spec/always_locate_spec.rb +43 -0
- data/spec/browser_spec.rb +130 -0
- data/spec/click_spec.rb +19 -0
- data/spec/container_spec.rb +34 -0
- data/spec/element_locator_spec.rb +532 -0
- data/spec/element_spec.rb +136 -0
- data/spec/implementation.rb +216 -0
- data/spec/input_spec.rb +14 -0
- data/spec/locator_spec_helper.rb +57 -0
- data/spec/spec_helper.rb +35 -0
- data/spec/special_chars_spec.rb +13 -0
- data/support/doctest_helper.rb +78 -0
- data/support/travis.sh +44 -0
- data/support/version_differ.rb +59 -0
- data/watir.gemspec +37 -25
- metadata +288 -23
- data/lib/watir/loader.rb +0 -64
data/Gemfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
unless ENV['TRAVIS']
|
4
|
+
gem "simplecov", ">= 0.3.5", platform: :ruby_19
|
5
|
+
end
|
6
|
+
|
7
|
+
if ENV['LOCAL_WEBIDL']
|
8
|
+
gem 'webidl', path: File.expand_path('../webidl')
|
9
|
+
end
|
10
|
+
|
11
|
+
# Specify your gem's dependencies in watir.gemspec
|
12
|
+
gemspec
|
data/LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
(the MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2009-2015 Jari Bakken
|
4
|
+
Copyright (c) 2015-2016 Alex Rodionov, Titus Fortner
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
7
|
+
a copy of this software and associated documentation files (the
|
8
|
+
"Software"), to deal in the Software without restriction, including
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
12
|
+
the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be
|
15
|
+
included in all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
21
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
22
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
23
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
watir
|
2
|
+
===============
|
3
|
+
|
4
|
+
Watir Powered By Selenium!
|
5
|
+
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/watir.svg)](http://badge.fury.io/rb/watir)
|
7
|
+
[![Build Status](https://travis-ci.org/watir/watir.svg?branch=master)](https://travis-ci.org/watir/watir)
|
8
|
+
[![Code Climate](https://codeclimate.com/github/watir/watir.svg)](https://codeclimate.com/github/watir/watir)
|
9
|
+
[![Dependency Status](https://gemnasium.com/watir/watir.svg)](https://gemnasium.com/watir/watir)
|
10
|
+
[![Coverage Status](https://coveralls.io/repos/watir/watir/badge.svg?branch=master)](https://coveralls.io/r/watir/watir)
|
11
|
+
|
12
|
+
Example
|
13
|
+
-------
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'watir'
|
17
|
+
|
18
|
+
browser = Watir::Browser.new
|
19
|
+
browser.goto 'google.com'
|
20
|
+
browser.text_field(title: 'Search').set 'Hello World!'
|
21
|
+
browser.button(type: 'submit').click
|
22
|
+
|
23
|
+
puts browser.title
|
24
|
+
# => 'Hello World! - Google Search'
|
25
|
+
browser.close
|
26
|
+
```
|
27
|
+
|
28
|
+
Description
|
29
|
+
-----------
|
30
|
+
|
31
|
+
The majority of element methods Watir provides with is autogenerated from specifications.
|
32
|
+
This is done by extracting the IDL parts from the spec and processing them with the WebIDL gem (link below).
|
33
|
+
Currently supported specifications are:
|
34
|
+
|
35
|
+
* [HTML](https://www.whatwg.org/specs/web-apps/current-work/) (`lib/watir/elements/html_generated.rb`)
|
36
|
+
* [SVG](http://www.w3.org/TR/SVG2/single-page.html) (`lib/watir/elements/svg_generated.rb`)
|
37
|
+
|
38
|
+
Specs
|
39
|
+
-----
|
40
|
+
|
41
|
+
Watir uses [watirspec](http://github.com/watir/watirspec) for testing. After cloning, you should fetch the submodule:
|
42
|
+
|
43
|
+
```bash
|
44
|
+
git submodule init && git submodule update
|
45
|
+
```
|
46
|
+
|
47
|
+
Specs specific to Watir are found in `spec/*_spec.rb`, with watirspec in `spec/watirspec/`.
|
48
|
+
|
49
|
+
Doctests
|
50
|
+
--------
|
51
|
+
|
52
|
+
Watir uses [yard-doctest](https://github.com/p0deje/yard-doctest) for testing documentation examples.
|
53
|
+
|
54
|
+
```bash
|
55
|
+
rake yard:doctest
|
56
|
+
```
|
57
|
+
|
58
|
+
API docs
|
59
|
+
--------
|
60
|
+
|
61
|
+
* http://rdoc.info/gems/watir/ (updated on every release)
|
62
|
+
|
63
|
+
See also
|
64
|
+
--------
|
65
|
+
|
66
|
+
* http://watir.github.io
|
67
|
+
* http://github.com/jarib/webidl
|
68
|
+
* http://github.com/watir/watirspec
|
69
|
+
* https://github.com/seleniumhq/selenium
|
70
|
+
|
71
|
+
Dependencies
|
72
|
+
------------
|
73
|
+
|
74
|
+
* selenium-webdriver
|
75
|
+
|
76
|
+
Note on Patches/Pull Requests
|
77
|
+
-----------------------------
|
78
|
+
|
79
|
+
* Fork the project.
|
80
|
+
* Make your feature addition or bug fix.
|
81
|
+
* Add tests for it. This is important so I don't break it in a
|
82
|
+
future version unintentionally.
|
83
|
+
* Commit, do not mess with Rakefile, version, or history.
|
84
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
85
|
+
* Send me a pull request. Bonus points for topic branches.
|
86
|
+
|
87
|
+
Copyright
|
88
|
+
---------
|
89
|
+
|
90
|
+
Copyright (c) 2009-2015 Jari Bakken
|
91
|
+
Copyright (c) 2015-2016 Alex Rodionov, Titus Fortner
|
92
|
+
See LICENSE for details
|
data/Rakefile
CHANGED
@@ -1,32 +1,161 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
|
-
|
3
|
-
require 'bundler'
|
4
|
-
Bundler::GemHelper.install_tasks
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
|
+
|
3
|
+
require 'bundler'
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
8
|
+
spec.ruby_opts = "-I lib:spec"
|
9
|
+
spec.rspec_opts = %w[--color --require fuubar --format Fuubar]
|
10
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
11
|
+
end
|
12
|
+
|
13
|
+
namespace :spec do
|
14
|
+
RSpec::Core::RakeTask.new(:html) do |spec|
|
15
|
+
spec.ruby_opts = "-I lib:spec"
|
16
|
+
spec.rspec_opts = "--format html --out #{ENV["SPEC_REPORT"] || "specs.html"}"
|
17
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
{
|
22
|
+
html: 'https://www.whatwg.org/specs/web-apps/current-work/',
|
23
|
+
svg: 'http://www.w3.org/TR/SVG2/single-page.html'
|
24
|
+
}.each do |type, spec_uri|
|
25
|
+
namespace type do
|
26
|
+
spec_path = "support/#{type}.html"
|
27
|
+
|
28
|
+
task generator_lib: :lib do
|
29
|
+
require "watir/generator"
|
30
|
+
end
|
31
|
+
|
32
|
+
desc "Download #{type.upcase} spec from #{spec_uri}"
|
33
|
+
task :download do
|
34
|
+
require "open-uri"
|
35
|
+
mv spec_path, "#{spec_path}.old" if File.exist?(spec_path)
|
36
|
+
downloaded_bytes = 0
|
37
|
+
|
38
|
+
File.open(spec_path, "w") do |io|
|
39
|
+
io << "<!-- downloaded from #{spec_uri} on #{Time.now} -->\n"
|
40
|
+
io << data = open(spec_uri).read
|
41
|
+
downloaded_bytes = data.bytesize
|
42
|
+
end
|
43
|
+
|
44
|
+
puts "#{spec_uri} => #{spec_path} (#{downloaded_bytes} bytes)"
|
45
|
+
end
|
46
|
+
|
47
|
+
desc "Print IDL parts from #{spec_uri}"
|
48
|
+
task print: :generator_lib do
|
49
|
+
extractor = Watir::Generator.const_get("#{type.upcase}::SpecExtractor").new(spec_path)
|
50
|
+
|
51
|
+
extractor.process.each do |tag_name, interface_definitions|
|
52
|
+
puts "#{tag_name.ljust(10)} => #{interface_definitions.map(&:name)}"
|
53
|
+
end
|
54
|
+
|
55
|
+
extractor.print_hierarchy
|
56
|
+
|
57
|
+
if extractor.errors.any?
|
58
|
+
puts "\n\n<======================= ERRORS =======================>\n\n"
|
59
|
+
puts extractor.errors.join("\n" + "=" * 80 + "\n")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
desc 'Re-generate the base Watir element classes from the spec'
|
64
|
+
task generate: :generator_lib do
|
65
|
+
old_file = "lib/watir/elements/#{type}_elements.rb"
|
66
|
+
generator = Watir::Generator.const_get(type.upcase).new
|
67
|
+
|
68
|
+
File.open("#{old_file}.new", "w") do |file|
|
69
|
+
generator.generate(spec_path, file)
|
70
|
+
end
|
71
|
+
|
72
|
+
if File.exist?(old_file)
|
73
|
+
system "diff -Naut #{old_file} #{old_file}.new | less"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
desc "Move #{type}.rb.new to #{type}.rb"
|
78
|
+
task :overwrite do
|
79
|
+
file = "lib/watir/elements/#{type}_elements.rb"
|
80
|
+
mv "#{file}.new", file
|
81
|
+
end
|
82
|
+
|
83
|
+
desc "download spec -> generate -> #{type}.rb"
|
84
|
+
task update: [:download, :generate, :overwrite]
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
require 'yard'
|
89
|
+
YARD::Rake::YardocTask.new do |task|
|
90
|
+
task.options = %w[--debug] # this is pretty slow, so nice with some output
|
91
|
+
end
|
92
|
+
|
93
|
+
require 'yard-doctest'
|
94
|
+
YARD::Doctest::RakeTask.new do |task|
|
95
|
+
task.doctest_opts = ['-v']
|
96
|
+
end
|
97
|
+
|
98
|
+
namespace :changes do
|
99
|
+
task :differ do
|
100
|
+
require './support/version_differ'
|
101
|
+
end
|
102
|
+
|
103
|
+
desc 'Update CHANGES.md'
|
104
|
+
task update: :differ do
|
105
|
+
VersionDiffer.new.update('CHANGES.md')
|
106
|
+
end
|
107
|
+
|
108
|
+
desc 'Generate CHANGES.md from scratch'
|
109
|
+
task generate: :differ do
|
110
|
+
VersionDiffer.new.generate('CHANGES.md')
|
111
|
+
end
|
112
|
+
|
113
|
+
desc 'Print latest diff'
|
114
|
+
task print: :differ do
|
115
|
+
VersionDiffer.new.print_latest(STDOUT)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
load "spec/watirspec/watirspec.rake" if File.exist?("spec/watirspec/watirspec.rake")
|
120
|
+
|
121
|
+
task default: [:spec, 'yard:doctest']
|
122
|
+
|
123
|
+
namespace :spec do
|
124
|
+
require 'selenium-webdriver'
|
125
|
+
|
126
|
+
desc 'Run specs in all browsers'
|
127
|
+
task all_browsers: [:browsers, :remote_browsers]
|
128
|
+
|
129
|
+
desc 'Run specs locally for all browsers'
|
130
|
+
task browsers: [:chrome,
|
131
|
+
:firefox,
|
132
|
+
:ff_legacy,
|
133
|
+
:phantomjs,
|
134
|
+
(:safari if Selenium::WebDriver::Platform.os == :macosx),
|
135
|
+
(:ie if Selenium::WebDriver::Platform.os == :windows),
|
136
|
+
(:edge if Selenium::WebDriver::Platform.os == :windows)].compact
|
137
|
+
|
138
|
+
desc 'Run specs remotely for all browsers'
|
139
|
+
task remote_browsers: [:remote_chrome,
|
140
|
+
:remote_firefox,
|
141
|
+
:remote_ff_legacy,
|
142
|
+
:remote_phantomjs,
|
143
|
+
(:remote_safari if Selenium::WebDriver::Platform.os == :macosx),
|
144
|
+
(:remote_ie if Selenium::WebDriver::Platform.os == :windows),
|
145
|
+
(:remote_edge if Selenium::WebDriver::Platform.os == :windows)].compact
|
146
|
+
|
147
|
+
%w(firefox ff_legacy chrome safari phantomjs ie edge).each do |browser|
|
148
|
+
desc "Run specs in #{browser}"
|
149
|
+
task browser do
|
150
|
+
ENV['WATIR_BROWSER'] = browser
|
151
|
+
Rake::Task[:spec].execute
|
152
|
+
end
|
153
|
+
|
154
|
+
desc "Run specs in Remote #{browser}"
|
155
|
+
task "remote_#{browser}" do
|
156
|
+
ENV['WATIR_BROWSER'] = 'remote'
|
157
|
+
ENV['REMOTE_BROWSER'] = browser
|
158
|
+
Rake::Task[:spec].execute
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
data/lib/watir.rb
CHANGED
@@ -1 +1,127 @@
|
|
1
|
-
require
|
1
|
+
require 'selenium-webdriver'
|
2
|
+
|
3
|
+
require 'watir/wait'
|
4
|
+
require 'watir/exception'
|
5
|
+
require 'watir/xpath_support'
|
6
|
+
require 'watir/window'
|
7
|
+
require 'watir/has_window'
|
8
|
+
require 'watir/alert'
|
9
|
+
require 'watir/atoms'
|
10
|
+
require 'watir/container'
|
11
|
+
require 'watir/cookies'
|
12
|
+
require 'watir/browser'
|
13
|
+
require 'watir/screenshot'
|
14
|
+
require 'watir/after_hooks'
|
15
|
+
|
16
|
+
module Watir
|
17
|
+
@always_locate = true
|
18
|
+
|
19
|
+
class << self
|
20
|
+
def always_locate?
|
21
|
+
@always_locate
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# Whether or not Watir should cache element references or always re-locate an Element on use.
|
26
|
+
# Defaults to true.
|
27
|
+
#
|
28
|
+
|
29
|
+
def always_locate=(bool)
|
30
|
+
@always_locate = bool
|
31
|
+
end
|
32
|
+
|
33
|
+
def default_timeout
|
34
|
+
@default_timeout ||= 30
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Default wait time for wait methods.
|
39
|
+
#
|
40
|
+
|
41
|
+
def default_timeout=(value)
|
42
|
+
@default_timeout = value
|
43
|
+
end
|
44
|
+
|
45
|
+
def prefer_css?
|
46
|
+
@prefer_css
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Whether or not Watir should prefer CSS when translating the Watir selectors to Selenium.
|
51
|
+
# Defaults to false.
|
52
|
+
#
|
53
|
+
|
54
|
+
def prefer_css=(bool)
|
55
|
+
@prefer_css = bool
|
56
|
+
end
|
57
|
+
|
58
|
+
def locator_namespace
|
59
|
+
@locator_namespace ||= Watir::Locators
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Whether the locators should be used from a different namespace.
|
64
|
+
# Defaults to Watir::Locators.
|
65
|
+
#
|
66
|
+
|
67
|
+
def locator_namespace=(mod)
|
68
|
+
@locator_namespace = mod
|
69
|
+
end
|
70
|
+
|
71
|
+
#
|
72
|
+
# @api private
|
73
|
+
#
|
74
|
+
|
75
|
+
def tag_to_class
|
76
|
+
@tag_to_class ||= {}
|
77
|
+
end
|
78
|
+
|
79
|
+
#
|
80
|
+
# @api private
|
81
|
+
#
|
82
|
+
|
83
|
+
def element_class_for(tag_name)
|
84
|
+
tag_to_class[tag_name.to_sym] || HTMLElement
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
require 'watir/attribute_helper'
|
91
|
+
require 'watir/row_container'
|
92
|
+
require 'watir/cell_container'
|
93
|
+
require 'watir/user_editable'
|
94
|
+
require 'watir/element_collection'
|
95
|
+
require 'watir/elements/element'
|
96
|
+
|
97
|
+
require 'watir/elements/html_elements'
|
98
|
+
require 'watir/elements/svg_elements'
|
99
|
+
|
100
|
+
require 'watir/elements/area'
|
101
|
+
require 'watir/elements/button'
|
102
|
+
require 'watir/elements/cell'
|
103
|
+
require 'watir/elements/checkbox'
|
104
|
+
require 'watir/elements/dlist'
|
105
|
+
require 'watir/elements/file_field'
|
106
|
+
require 'watir/elements/font'
|
107
|
+
require 'watir/elements/form'
|
108
|
+
require 'watir/elements/iframe'
|
109
|
+
require 'watir/elements/hidden'
|
110
|
+
require 'watir/elements/image'
|
111
|
+
require 'watir/elements/input'
|
112
|
+
require 'watir/elements/link'
|
113
|
+
require 'watir/elements/option'
|
114
|
+
require 'watir/elements/radio'
|
115
|
+
require 'watir/elements/row'
|
116
|
+
require 'watir/elements/select'
|
117
|
+
require 'watir/elements/table'
|
118
|
+
require 'watir/elements/table_cell'
|
119
|
+
require 'watir/elements/table_row'
|
120
|
+
require 'watir/elements/table_section'
|
121
|
+
require 'watir/elements/text_area'
|
122
|
+
require 'watir/elements/text_field'
|
123
|
+
|
124
|
+
require 'watir/locators'
|
125
|
+
require 'watir/aliases'
|
126
|
+
|
127
|
+
Watir.tag_to_class.freeze
|