page-object 2.2.3 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.coveralls.yml +1 -1
- data/.gitignore +8 -8
- data/.rspec +2 -2
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/.travis.yml +17 -17
- data/ChangeLog +928 -899
- data/Gemfile +13 -13
- data/Guardfile +20 -20
- data/LICENSE +20 -20
- data/README.md +114 -114
- data/Rakefile +29 -29
- data/cucumber.yml +8 -8
- data/lib/page-object.rb +431 -420
- data/lib/page-object/accessors.rb +1201 -1175
- data/lib/page-object/element_locators.rb +21 -21
- data/lib/page-object/elements.rb +62 -61
- data/lib/page-object/elements/area.rb +9 -9
- data/lib/page-object/elements/audio.rb +9 -9
- data/lib/page-object/elements/bold.rb +9 -9
- data/lib/page-object/elements/button.rb +12 -12
- data/lib/page-object/elements/canvas.rb +10 -10
- data/lib/page-object/elements/check_box.rb +9 -9
- data/lib/page-object/elements/date_field.rb +10 -0
- data/lib/page-object/elements/div.rb +9 -9
- data/lib/page-object/elements/element.rb +212 -216
- data/lib/page-object/elements/file_field.rb +9 -9
- data/lib/page-object/elements/form.rb +9 -9
- data/lib/page-object/elements/heading.rb +14 -14
- data/lib/page-object/elements/hidden_field.rb +9 -9
- data/lib/page-object/elements/image.rb +10 -10
- data/lib/page-object/elements/italic.rb +9 -9
- data/lib/page-object/elements/label.rb +9 -9
- data/lib/page-object/elements/link.rb +9 -9
- data/lib/page-object/elements/list_item.rb +9 -9
- data/lib/page-object/elements/media.rb +11 -11
- data/lib/page-object/elements/option.rb +9 -9
- data/lib/page-object/elements/ordered_list.rb +43 -43
- data/lib/page-object/elements/paragraph.rb +9 -9
- data/lib/page-object/elements/radio_button.rb +9 -9
- data/lib/page-object/elements/select_list.rb +42 -42
- data/lib/page-object/elements/span.rb +9 -9
- data/lib/page-object/elements/table.rb +85 -68
- data/lib/page-object/elements/table_cell.rb +10 -10
- data/lib/page-object/elements/table_row.rb +52 -52
- data/lib/page-object/elements/text_area.rb +9 -9
- data/lib/page-object/elements/text_field.rb +10 -10
- data/lib/page-object/elements/unordered_list.rb +42 -42
- data/lib/page-object/elements/video.rb +9 -9
- data/lib/page-object/indexed_properties.rb +41 -41
- data/lib/page-object/javascript/angularjs.rb +14 -14
- data/lib/page-object/javascript/jquery.rb +14 -14
- data/lib/page-object/javascript/prototype.rb +14 -14
- data/lib/page-object/javascript/yui.rb +18 -18
- data/lib/page-object/javascript_framework_facade.rb +80 -80
- data/lib/page-object/locator_generator.rb +183 -182
- data/lib/page-object/nested_elements.rb +17 -17
- data/lib/page-object/page_factory.rb +108 -108
- data/lib/page-object/page_populator.rb +105 -93
- data/lib/page-object/platforms/watir.rb +50 -50
- data/lib/page-object/platforms/watir/page_object.rb +1155 -1124
- data/lib/page-object/section_collection.rb +16 -16
- data/lib/page-object/version.rb +4 -4
- data/lib/page-object/widgets.rb +98 -98
- data/page-object.gemspec +31 -32
- metadata +12 -26
@@ -1,41 +1,41 @@
|
|
1
|
-
module PageObject
|
2
|
-
module IndexedProperties
|
3
|
-
class TableOfElements
|
4
|
-
include PageObject
|
5
|
-
|
6
|
-
def initialize (browser, identifier_list)
|
7
|
-
initialize_browser(browser)
|
8
|
-
@identifier_list = identifier_list
|
9
|
-
@indexed_property_class = Class.new {
|
10
|
-
include PageObject
|
11
|
-
extend Accessors
|
12
|
-
|
13
|
-
def initialize (browser, index, identifier_list)
|
14
|
-
initialize_browser(browser)
|
15
|
-
|
16
|
-
identifier_list.each do |identifier|
|
17
|
-
type = identifier[0]
|
18
|
-
name = identifier[1]
|
19
|
-
how_and_what = identifier[2].clone # Cannot modify the original...
|
20
|
-
how_and_what.each do |key, value|
|
21
|
-
next if value.is_a? Regexp # Cannot format Regexp with %
|
22
|
-
if key == :index
|
23
|
-
how_and_what[key] = (value % index).to_i
|
24
|
-
elsif key == :frame
|
25
|
-
how_and_what[key] = value #passthrough frame without modification
|
26
|
-
else
|
27
|
-
how_and_what[key] = value % index
|
28
|
-
end
|
29
|
-
end
|
30
|
-
self.class.send type, name, how_and_what unless Class.instance_methods.include? name
|
31
|
-
end
|
32
|
-
end
|
33
|
-
}
|
34
|
-
end
|
35
|
-
|
36
|
-
def [] (index)
|
37
|
-
@indexed_property_class.new(@browser, index, @identifier_list)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
1
|
+
module PageObject
|
2
|
+
module IndexedProperties
|
3
|
+
class TableOfElements
|
4
|
+
include PageObject
|
5
|
+
|
6
|
+
def initialize (browser, identifier_list)
|
7
|
+
initialize_browser(browser)
|
8
|
+
@identifier_list = identifier_list
|
9
|
+
@indexed_property_class = Class.new {
|
10
|
+
include PageObject
|
11
|
+
extend Accessors
|
12
|
+
|
13
|
+
def initialize (browser, index, identifier_list)
|
14
|
+
initialize_browser(browser)
|
15
|
+
|
16
|
+
identifier_list.each do |identifier|
|
17
|
+
type = identifier[0]
|
18
|
+
name = identifier[1]
|
19
|
+
how_and_what = identifier[2].clone # Cannot modify the original...
|
20
|
+
how_and_what.each do |key, value|
|
21
|
+
next if value.is_a? Regexp # Cannot format Regexp with %
|
22
|
+
if key == :index
|
23
|
+
how_and_what[key] = (value % index).to_i
|
24
|
+
elsif key == :frame
|
25
|
+
how_and_what[key] = value #passthrough frame without modification
|
26
|
+
else
|
27
|
+
how_and_what[key] = value % index
|
28
|
+
end
|
29
|
+
end
|
30
|
+
self.class.send type, name, how_and_what unless Class.instance_methods.include? name
|
31
|
+
end
|
32
|
+
end
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def [] (index)
|
37
|
+
@indexed_property_class.new(@browser, index, @identifier_list)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module PageObject
|
2
|
-
module Javascript
|
3
|
-
|
4
|
-
module AngularJS
|
5
|
-
#
|
6
|
-
# return the number of pending ajax requests
|
7
|
-
#
|
8
|
-
def self.pending_requests
|
9
|
-
'return angular.element(document.body).injector().get(\'$http\').pendingRequests.length;'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
1
|
+
module PageObject
|
2
|
+
module Javascript
|
3
|
+
|
4
|
+
module AngularJS
|
5
|
+
#
|
6
|
+
# return the number of pending ajax requests
|
7
|
+
#
|
8
|
+
def self.pending_requests
|
9
|
+
'return angular.element(document.body).injector().get(\'$http\').pendingRequests.length;'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module PageObject
|
2
|
-
module Javascript
|
3
|
-
|
4
|
-
module JQuery
|
5
|
-
#
|
6
|
-
# return the number of pending ajax requests
|
7
|
-
#
|
8
|
-
def self.pending_requests
|
9
|
-
'return jQuery.active'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
1
|
+
module PageObject
|
2
|
+
module Javascript
|
3
|
+
|
4
|
+
module JQuery
|
5
|
+
#
|
6
|
+
# return the number of pending ajax requests
|
7
|
+
#
|
8
|
+
def self.pending_requests
|
9
|
+
'return jQuery.active'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module PageObject
|
2
|
-
module Javascript
|
3
|
-
|
4
|
-
module Prototype
|
5
|
-
#
|
6
|
-
# return the number of pending ajax requests
|
7
|
-
#
|
8
|
-
def self.pending_requests
|
9
|
-
'return Ajax.activeRequestCount'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
1
|
+
module PageObject
|
2
|
+
module Javascript
|
3
|
+
|
4
|
+
module Prototype
|
5
|
+
#
|
6
|
+
# return the number of pending ajax requests
|
7
|
+
#
|
8
|
+
def self.pending_requests
|
9
|
+
'return Ajax.activeRequestCount'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
module PageObject
|
2
|
-
module Javascript
|
3
|
-
|
4
|
-
module YUI
|
5
|
-
#
|
6
|
-
# return the number of pending ajax requests
|
7
|
-
#
|
8
|
-
def self.pending_requests
|
9
|
-
"var inProgress=0
|
10
|
-
for(var i=0; i < YAHOO.util.Connect._transaction_id; i++) {
|
11
|
-
if(YAHOO.util.Connect.isCallInProgress(i))
|
12
|
-
inProgress++;
|
13
|
-
}
|
14
|
-
return inProgress;"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
1
|
+
module PageObject
|
2
|
+
module Javascript
|
3
|
+
|
4
|
+
module YUI
|
5
|
+
#
|
6
|
+
# return the number of pending ajax requests
|
7
|
+
#
|
8
|
+
def self.pending_requests
|
9
|
+
"var inProgress=0
|
10
|
+
for(var i=0; i < YAHOO.util.Connect._transaction_id; i++) {
|
11
|
+
if(YAHOO.util.Connect.isCallInProgress(i))
|
12
|
+
inProgress++;
|
13
|
+
}
|
14
|
+
return inProgress;"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
19
|
end
|
@@ -1,80 +1,80 @@
|
|
1
|
-
require 'page-object/javascript/jquery'
|
2
|
-
require 'page-object/javascript/prototype'
|
3
|
-
require 'page-object/javascript/yui'
|
4
|
-
require 'page-object/javascript/angularjs'
|
5
|
-
|
6
|
-
|
7
|
-
module PageObject
|
8
|
-
#
|
9
|
-
# Provide hooks into different common Javascript Frameworks.
|
10
|
-
# Currently this module only supports jQuery and Prototype but it
|
11
|
-
# has the ability for you to plug your own framework into it and
|
12
|
-
# therefore have it work with this gem. You do this by calling the
|
13
|
-
# #add_framework method. The module you provide must implement the
|
14
|
-
# necessary methods. Please look at the jQuery or Prototype
|
15
|
-
# implementations to determine the necessary methods
|
16
|
-
#
|
17
|
-
module JavascriptFrameworkFacade
|
18
|
-
|
19
|
-
class << self
|
20
|
-
#
|
21
|
-
# Set the framework to use.
|
22
|
-
#
|
23
|
-
# @param[Symbol] the framework to use. :jquery, :prototype, :yui,
|
24
|
-
# and :angularjs are supported
|
25
|
-
#
|
26
|
-
def framework=(framework)
|
27
|
-
initialize_script_builder unless @builder
|
28
|
-
raise unknown_framework(framework) unless @builder[framework]
|
29
|
-
@framework = framework
|
30
|
-
end
|
31
|
-
|
32
|
-
#
|
33
|
-
# Get the framework that will be used
|
34
|
-
#
|
35
|
-
def framework
|
36
|
-
@framework
|
37
|
-
end
|
38
|
-
|
39
|
-
#
|
40
|
-
# Add a framework and make it available to the system.
|
41
|
-
#
|
42
|
-
def add_framework(key, value)
|
43
|
-
raise invalid_framework unless value.respond_to? :pending_requests
|
44
|
-
initialize_script_builder unless @builder
|
45
|
-
@builder[key] = value
|
46
|
-
end
|
47
|
-
|
48
|
-
#
|
49
|
-
# get the javascript to determine number of pending requests
|
50
|
-
#
|
51
|
-
def pending_requests
|
52
|
-
script_builder.pending_requests
|
53
|
-
end
|
54
|
-
|
55
|
-
def script_builder
|
56
|
-
initialize_script_builder unless @builder
|
57
|
-
@builder[@framework]
|
58
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
def initialize_script_builder
|
63
|
-
@builder = {
|
64
|
-
:jquery => ::PageObject::Javascript::JQuery,
|
65
|
-
:prototype => ::PageObject::Javascript::Prototype,
|
66
|
-
:yui => ::PageObject::Javascript::YUI,
|
67
|
-
:angularjs => ::PageObject::Javascript::AngularJS
|
68
|
-
}
|
69
|
-
end
|
70
|
-
|
71
|
-
def unknown_framework(framework)
|
72
|
-
"You specified the Javascript framework #{framework} and it is unknown to the system"
|
73
|
-
end
|
74
|
-
|
75
|
-
def invalid_framework
|
76
|
-
"The Javascript framework you provided does not implement the necessary methods"
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
1
|
+
require 'page-object/javascript/jquery'
|
2
|
+
require 'page-object/javascript/prototype'
|
3
|
+
require 'page-object/javascript/yui'
|
4
|
+
require 'page-object/javascript/angularjs'
|
5
|
+
|
6
|
+
|
7
|
+
module PageObject
|
8
|
+
#
|
9
|
+
# Provide hooks into different common Javascript Frameworks.
|
10
|
+
# Currently this module only supports jQuery and Prototype but it
|
11
|
+
# has the ability for you to plug your own framework into it and
|
12
|
+
# therefore have it work with this gem. You do this by calling the
|
13
|
+
# #add_framework method. The module you provide must implement the
|
14
|
+
# necessary methods. Please look at the jQuery or Prototype
|
15
|
+
# implementations to determine the necessary methods
|
16
|
+
#
|
17
|
+
module JavascriptFrameworkFacade
|
18
|
+
|
19
|
+
class << self
|
20
|
+
#
|
21
|
+
# Set the framework to use.
|
22
|
+
#
|
23
|
+
# @param[Symbol] the framework to use. :jquery, :prototype, :yui,
|
24
|
+
# and :angularjs are supported
|
25
|
+
#
|
26
|
+
def framework=(framework)
|
27
|
+
initialize_script_builder unless @builder
|
28
|
+
raise unknown_framework(framework) unless @builder[framework]
|
29
|
+
@framework = framework
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Get the framework that will be used
|
34
|
+
#
|
35
|
+
def framework
|
36
|
+
@framework
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Add a framework and make it available to the system.
|
41
|
+
#
|
42
|
+
def add_framework(key, value)
|
43
|
+
raise invalid_framework unless value.respond_to? :pending_requests
|
44
|
+
initialize_script_builder unless @builder
|
45
|
+
@builder[key] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# get the javascript to determine number of pending requests
|
50
|
+
#
|
51
|
+
def pending_requests
|
52
|
+
script_builder.pending_requests
|
53
|
+
end
|
54
|
+
|
55
|
+
def script_builder
|
56
|
+
initialize_script_builder unless @builder
|
57
|
+
@builder[@framework]
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def initialize_script_builder
|
63
|
+
@builder = {
|
64
|
+
:jquery => ::PageObject::Javascript::JQuery,
|
65
|
+
:prototype => ::PageObject::Javascript::Prototype,
|
66
|
+
:yui => ::PageObject::Javascript::YUI,
|
67
|
+
:angularjs => ::PageObject::Javascript::AngularJS
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
def unknown_framework(framework)
|
72
|
+
"You specified the Javascript framework #{framework} and it is unknown to the system"
|
73
|
+
end
|
74
|
+
|
75
|
+
def invalid_framework
|
76
|
+
"The Javascript framework you provided does not implement the necessary methods"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -1,182 +1,183 @@
|
|
1
|
-
module PageObject
|
2
|
-
module LocatorGenerator
|
3
|
-
|
4
|
-
BASIC_ELEMENTS = %i(
|
5
|
-
abbr
|
6
|
-
address
|
7
|
-
animate
|
8
|
-
animate_motion
|
9
|
-
animate_transform
|
10
|
-
article
|
11
|
-
as
|
12
|
-
aside
|
13
|
-
base
|
14
|
-
bdi
|
15
|
-
bdo
|
16
|
-
blockquote
|
17
|
-
body
|
18
|
-
br
|
19
|
-
caption
|
20
|
-
circle
|
21
|
-
cite
|
22
|
-
code
|
23
|
-
col
|
24
|
-
colgroup
|
25
|
-
command
|
26
|
-
cursor
|
27
|
-
data
|
28
|
-
datalist
|
29
|
-
dd
|
30
|
-
defs
|
31
|
-
del
|
32
|
-
desc
|
33
|
-
details
|
34
|
-
dfn
|
35
|
-
dialog
|
36
|
-
discard
|
37
|
-
dl
|
38
|
-
dt
|
39
|
-
ellipse
|
40
|
-
em
|
41
|
-
embed
|
42
|
-
fieldset
|
43
|
-
figcaption
|
44
|
-
figure
|
45
|
-
font
|
46
|
-
footer
|
47
|
-
foreign_object
|
48
|
-
g
|
49
|
-
head
|
50
|
-
header
|
51
|
-
hgroup
|
52
|
-
hr
|
53
|
-
html
|
54
|
-
ins
|
55
|
-
kbd
|
56
|
-
keygen
|
57
|
-
legend
|
58
|
-
line
|
59
|
-
linear_gradient
|
60
|
-
main
|
61
|
-
map
|
62
|
-
mark
|
63
|
-
marker
|
64
|
-
menu
|
65
|
-
menuitem
|
66
|
-
mesh_gradient
|
67
|
-
mesh_patch
|
68
|
-
mesh_row
|
69
|
-
meta
|
70
|
-
metadata
|
71
|
-
meter
|
72
|
-
mpath
|
73
|
-
nav
|
74
|
-
noscript
|
75
|
-
object
|
76
|
-
optgroup
|
77
|
-
output
|
78
|
-
p
|
79
|
-
param
|
80
|
-
path
|
81
|
-
pattern
|
82
|
-
polygon
|
83
|
-
polyline
|
84
|
-
pre
|
85
|
-
progress
|
86
|
-
q
|
87
|
-
radial_gradient
|
88
|
-
rect
|
89
|
-
rp
|
90
|
-
rt
|
91
|
-
ruby
|
92
|
-
s
|
93
|
-
samp
|
94
|
-
script
|
95
|
-
section
|
96
|
-
set
|
97
|
-
small
|
98
|
-
source
|
99
|
-
stop
|
100
|
-
strong
|
101
|
-
style
|
102
|
-
sub
|
103
|
-
summary
|
104
|
-
sup
|
105
|
-
switch
|
106
|
-
symbol
|
107
|
-
template
|
108
|
-
text_path
|
109
|
-
thread
|
110
|
-
time
|
111
|
-
title
|
112
|
-
track
|
113
|
-
tspan
|
114
|
-
u
|
115
|
-
use
|
116
|
-
var
|
117
|
-
view
|
118
|
-
wbr
|
119
|
-
)
|
120
|
-
|
121
|
-
|
122
|
-
ADVANCED_ELEMENTS = %i(
|
123
|
-
text_field
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
end
|
1
|
+
module PageObject
|
2
|
+
module LocatorGenerator
|
3
|
+
|
4
|
+
BASIC_ELEMENTS = %i(
|
5
|
+
abbr
|
6
|
+
address
|
7
|
+
animate
|
8
|
+
animate_motion
|
9
|
+
animate_transform
|
10
|
+
article
|
11
|
+
as
|
12
|
+
aside
|
13
|
+
base
|
14
|
+
bdi
|
15
|
+
bdo
|
16
|
+
blockquote
|
17
|
+
body
|
18
|
+
br
|
19
|
+
caption
|
20
|
+
circle
|
21
|
+
cite
|
22
|
+
code
|
23
|
+
col
|
24
|
+
colgroup
|
25
|
+
command
|
26
|
+
cursor
|
27
|
+
data
|
28
|
+
datalist
|
29
|
+
dd
|
30
|
+
defs
|
31
|
+
del
|
32
|
+
desc
|
33
|
+
details
|
34
|
+
dfn
|
35
|
+
dialog
|
36
|
+
discard
|
37
|
+
dl
|
38
|
+
dt
|
39
|
+
ellipse
|
40
|
+
em
|
41
|
+
embed
|
42
|
+
fieldset
|
43
|
+
figcaption
|
44
|
+
figure
|
45
|
+
font
|
46
|
+
footer
|
47
|
+
foreign_object
|
48
|
+
g
|
49
|
+
head
|
50
|
+
header
|
51
|
+
hgroup
|
52
|
+
hr
|
53
|
+
html
|
54
|
+
ins
|
55
|
+
kbd
|
56
|
+
keygen
|
57
|
+
legend
|
58
|
+
line
|
59
|
+
linear_gradient
|
60
|
+
main
|
61
|
+
map
|
62
|
+
mark
|
63
|
+
marker
|
64
|
+
menu
|
65
|
+
menuitem
|
66
|
+
mesh_gradient
|
67
|
+
mesh_patch
|
68
|
+
mesh_row
|
69
|
+
meta
|
70
|
+
metadata
|
71
|
+
meter
|
72
|
+
mpath
|
73
|
+
nav
|
74
|
+
noscript
|
75
|
+
object
|
76
|
+
optgroup
|
77
|
+
output
|
78
|
+
p
|
79
|
+
param
|
80
|
+
path
|
81
|
+
pattern
|
82
|
+
polygon
|
83
|
+
polyline
|
84
|
+
pre
|
85
|
+
progress
|
86
|
+
q
|
87
|
+
radial_gradient
|
88
|
+
rect
|
89
|
+
rp
|
90
|
+
rt
|
91
|
+
ruby
|
92
|
+
s
|
93
|
+
samp
|
94
|
+
script
|
95
|
+
section
|
96
|
+
set
|
97
|
+
small
|
98
|
+
source
|
99
|
+
stop
|
100
|
+
strong
|
101
|
+
style
|
102
|
+
sub
|
103
|
+
summary
|
104
|
+
sup
|
105
|
+
switch
|
106
|
+
symbol
|
107
|
+
template
|
108
|
+
text_path
|
109
|
+
thread
|
110
|
+
time
|
111
|
+
title
|
112
|
+
track
|
113
|
+
tspan
|
114
|
+
u
|
115
|
+
use
|
116
|
+
var
|
117
|
+
view
|
118
|
+
wbr
|
119
|
+
)
|
120
|
+
|
121
|
+
|
122
|
+
ADVANCED_ELEMENTS = %i(
|
123
|
+
text_field
|
124
|
+
date_field
|
125
|
+
hidden_field
|
126
|
+
text_area
|
127
|
+
select_list
|
128
|
+
link
|
129
|
+
checkbox
|
130
|
+
radio_button
|
131
|
+
button
|
132
|
+
div
|
133
|
+
span
|
134
|
+
table
|
135
|
+
cell
|
136
|
+
row
|
137
|
+
image
|
138
|
+
form
|
139
|
+
list_item
|
140
|
+
ordered_list
|
141
|
+
unordered_list
|
142
|
+
h1
|
143
|
+
h2
|
144
|
+
h3
|
145
|
+
h4
|
146
|
+
h5
|
147
|
+
h6
|
148
|
+
paragraph
|
149
|
+
label
|
150
|
+
file_field
|
151
|
+
area
|
152
|
+
canvas
|
153
|
+
audio
|
154
|
+
video
|
155
|
+
b
|
156
|
+
i
|
157
|
+
svg
|
158
|
+
)
|
159
|
+
|
160
|
+
def self.generate_locators(target)
|
161
|
+
ADVANCED_ELEMENTS.each do |tag|
|
162
|
+
target.send(:define_method, "#{tag.to_s}_element") do |*identifier|
|
163
|
+
@platform.send "#{tag.to_s}_for", locator(identifier)
|
164
|
+
end
|
165
|
+
|
166
|
+
target.send(:define_method, "#{tag.to_s}_elements") do |*identifier|
|
167
|
+
@platform.send("#{tag.to_s}s_for", identifier[0] ? identifier[0] : {})
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
BASIC_ELEMENTS.each do |tag|
|
172
|
+
target.send(:define_method, "#{tag.to_s}_element") do |*identifier|
|
173
|
+
@platform.send :element_for, tag, locator(identifier)
|
174
|
+
end
|
175
|
+
|
176
|
+
target.send(:define_method, "#{tag.to_s}_elements") do |*identifier|
|
177
|
+
@platform.send(:elements_for, tag, identifier[0] ? identifier[0] : {})
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
end
|
183
|
+
end
|