watir_pump 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,11 @@ module WatirPump
17
17
  a
18
18
  button
19
19
  link
20
+ div
21
+ span
22
+ li
23
+ td
24
+ th
20
25
  ].freeze
21
26
 
22
27
  WRITABLES = %i[
@@ -31,6 +36,7 @@ module WatirPump
31
36
  p
32
37
  link
33
38
  td
39
+ th
34
40
  text_field
35
41
  textarea
36
42
  h1
@@ -1,312 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # rubocop:disable Metrics/ModuleLength
4
- # rubocop:disable Style/MutableConstant
3
+ require 'active_support/core_ext/string'
5
4
 
6
5
  module WatirPump
7
- WATIR_METHOD_MAPPING = {
8
- a: Watir::Anchor,
9
- as: Watir::AnchorCollection,
10
- abbr: Watir::HTMLElement,
11
- abbrs: Watir::HTMLElementCollection,
12
- address: Watir::HTMLElement,
13
- addresses: Watir::HTMLElementCollection,
14
- area: Watir::Area,
15
- areas: Watir::AreaCollection,
16
- article: Watir::HTMLElement,
17
- articles: Watir::HTMLElementCollection,
18
- aside: Watir::HTMLElement,
19
- asides: Watir::HTMLElementCollection,
20
- audio: Watir::Audio,
21
- audios: Watir::AudioCollection,
22
- b: Watir::HTMLElement,
23
- bs: Watir::HTMLElementCollection,
24
- base: Watir::Base,
25
- bases: Watir::BaseCollection,
26
- bdi: Watir::HTMLElement,
27
- bdis: Watir::HTMLElementCollection,
28
- bdo: Watir::HTMLElement,
29
- bdos: Watir::HTMLElementCollection,
30
- blockquote: Watir::Quote,
31
- blockquotes: Watir::QuoteCollection,
32
- body: Watir::Body,
33
- bodys: Watir::BodyCollection,
34
- br: Watir::BR,
35
- brs: Watir::BRCollection,
36
- button: Watir::Button,
37
- buttons: Watir::ButtonCollection,
38
- canvas: Watir::Canvas,
39
- canvases: Watir::CanvasCollection,
40
- caption: Watir::TableCaption,
41
- captions: Watir::TableCaptionCollection,
42
- cite: Watir::HTMLElement,
43
- cites: Watir::HTMLElementCollection,
44
- code: Watir::HTMLElement,
45
- codes: Watir::HTMLElementCollection,
46
- col: Watir::TableCol,
47
- cols: Watir::TableColCollection,
48
- colgroup: Watir::TableCol,
49
- colgroups: Watir::TableColCollection,
50
- data: Watir::Data,
51
- datas: Watir::DataCollection,
52
- datalist: Watir::DataList,
53
- datalists: Watir::DataListCollection,
54
- dd: Watir::HTMLElement,
55
- dds: Watir::HTMLElementCollection,
56
- del: Watir::Mod,
57
- dels: Watir::ModCollection,
58
- details: Watir::Details,
59
- detailses: Watir::DetailsCollection,
60
- dfn: Watir::HTMLElement,
61
- dfns: Watir::HTMLElementCollection,
62
- div: Watir::Div,
63
- divs: Watir::DivCollection,
64
- dl: Watir::DList,
65
- dls: Watir::DListCollection,
66
- dt: Watir::HTMLElement,
67
- dts: Watir::HTMLElementCollection,
68
- em: Watir::HTMLElement,
69
- ems: Watir::HTMLElementCollection,
70
- embed: Watir::Embed,
71
- embeds: Watir::EmbedCollection,
72
- fieldset: Watir::FieldSet,
73
- fieldsets: Watir::FieldSetCollection,
74
- figcaption: Watir::HTMLElement,
75
- figcaptions: Watir::HTMLElementCollection,
76
- figure: Watir::HTMLElement,
77
- figures: Watir::HTMLElementCollection,
78
- footer: Watir::HTMLElement,
79
- footers: Watir::HTMLElementCollection,
80
- form: Watir::Form,
81
- forms: Watir::FormCollection,
82
- frameset: Watir::FrameSet,
83
- framesets: Watir::FrameSetCollection,
84
- h1: Watir::Heading,
85
- h1s: Watir::HeadingCollection,
86
- h2: Watir::Heading,
87
- h2s: Watir::HeadingCollection,
88
- h3: Watir::Heading,
89
- h3s: Watir::HeadingCollection,
90
- h4: Watir::Heading,
91
- h4s: Watir::HeadingCollection,
92
- h5: Watir::Heading,
93
- h5s: Watir::HeadingCollection,
94
- h6: Watir::Heading,
95
- h6s: Watir::HeadingCollection,
96
- head: Watir::Head,
97
- heads: Watir::HeadCollection,
98
- header: Watir::HTMLElement,
99
- headers: Watir::HTMLElementCollection,
100
- hr: Watir::HR,
101
- hrs: Watir::HRCollection,
102
- html: Watir::Html,
103
- htmls: Watir::HtmlCollection,
104
- i: Watir::HTMLElement,
105
- is: Watir::HTMLElementCollection,
106
- iframe: Watir::IFrame,
107
- iframes: Watir::IFrameCollection,
108
- image: Watir::Image,
109
- images: Watir::ImageCollection,
110
- img: Watir::Image,
111
- imgs: Watir::ImageCollection,
112
- input: Watir::Input,
113
- inputs: Watir::InputCollection,
114
- ins: Watir::Mod,
115
- inses: Watir::ModCollection,
116
- kbd: Watir::HTMLElement,
117
- kbds: Watir::HTMLElementCollection,
118
- label: Watir::Label,
119
- labels: Watir::LabelCollection,
120
- legend: Watir::Legend,
121
- legends: Watir::LegendCollection,
122
- li: Watir::LI,
123
- lis: Watir::LICollection,
124
- link: Watir::Anchor,
125
- links: Watir::AnchorCollection,
126
- main: Watir::HTMLElement,
127
- mains: Watir::HTMLElementCollection,
128
- map: Watir::Map,
129
- maps: Watir::MapCollection,
130
- mark: Watir::HTMLElement,
131
- marks: Watir::HTMLElementCollection,
132
- meta: Watir::Meta,
133
- metas: Watir::MetaCollection,
134
- meter: Watir::Meter,
135
- meters: Watir::MeterCollection,
136
- nav: Watir::HTMLElement,
137
- navs: Watir::HTMLElementCollection,
138
- noscript: Watir::HTMLElement,
139
- noscripts: Watir::HTMLElementCollection,
140
- object: Watir::Object,
141
- objects: Watir::ObjectCollection,
142
- ol: Watir::OList,
143
- ols: Watir::OListCollection,
144
- optgroup: Watir::OptGroup,
145
- optgroups: Watir::OptGroupCollection,
146
- option: Watir::Option,
147
- options: Watir::OptionCollection,
148
- output: Watir::Output,
149
- outputs: Watir::OutputCollection,
150
- p: Watir::Paragraph,
151
- ps: Watir::ParagraphCollection,
152
- param: Watir::Param,
153
- params: Watir::ParamCollection,
154
- picture: Watir::Picture,
155
- pictures: Watir::PictureCollection,
156
- pre: Watir::Pre,
157
- pres: Watir::PreCollection,
158
- progress: Watir::Progress,
159
- progresses: Watir::ProgressCollection,
160
- q: Watir::Quote,
161
- qs: Watir::QuoteCollection,
162
- rb: Watir::HTMLElement,
163
- rbs: Watir::HTMLElementCollection,
164
- rp: Watir::HTMLElement,
165
- rps: Watir::HTMLElementCollection,
166
- rt: Watir::HTMLElement,
167
- rts: Watir::HTMLElementCollection,
168
- rtc: Watir::HTMLElement,
169
- rtcs: Watir::HTMLElementCollection,
170
- ruby: Watir::HTMLElement,
171
- rubies: Watir::HTMLElementCollection,
172
- s: Watir::HTMLElement,
173
- ss: Watir::HTMLElementCollection,
174
- samp: Watir::HTMLElement,
175
- samps: Watir::HTMLElementCollection,
176
- script: Watir::Script,
177
- scripts: Watir::ScriptCollection,
178
- section: Watir::HTMLElement,
179
- sections: Watir::HTMLElementCollection,
180
- select: Watir::Select,
181
- selects: Watir::SelectCollection,
182
- small: Watir::HTMLElement,
183
- smalls: Watir::HTMLElementCollection,
184
- source: Watir::Source,
185
- sources: Watir::SourceCollection,
186
- span: Watir::Span,
187
- spans: Watir::SpanCollection,
188
- strong: Watir::HTMLElement,
189
- strongs: Watir::HTMLElementCollection,
190
- style: Watir::Style,
191
- styles: Watir::StyleCollection,
192
- sub: Watir::HTMLElement,
193
- subs: Watir::HTMLElementCollection,
194
- summary: Watir::HTMLElement,
195
- summaries: Watir::HTMLElementCollection,
196
- sup: Watir::HTMLElement,
197
- sups: Watir::HTMLElementCollection,
198
- table: Watir::Table,
199
- tables: Watir::TableCollection,
200
- tbody: Watir::TableSection,
201
- tbodys: Watir::TableSectionCollection,
202
- td: Watir::TableDataCell,
203
- tds: Watir::TableDataCellCollection,
204
- template: Watir::Template,
205
- templates: Watir::TemplateCollection,
206
- textarea: Watir::TextArea,
207
- textareas: Watir::TextAreaCollection,
208
- tfoot: Watir::TableSection,
209
- tfoots: Watir::TableSectionCollection,
210
- th: Watir::TableHeaderCell,
211
- ths: Watir::TableHeaderCellCollection,
212
- thead: Watir::TableSection,
213
- theads: Watir::TableSectionCollection,
214
- time: Watir::Time,
215
- times: Watir::TimeCollection,
216
- title: Watir::Title,
217
- titles: Watir::TitleCollection,
218
- tr: Watir::TableRow,
219
- trs: Watir::TableRowCollection,
220
- track: Watir::Track,
221
- tracks: Watir::TrackCollection,
222
- u: Watir::HTMLElement,
223
- us: Watir::HTMLElementCollection,
224
- ul: Watir::UList,
225
- uls: Watir::UListCollection,
226
- var: Watir::HTMLElement,
227
- vars: Watir::HTMLElementCollection,
228
- video: Watir::Video,
229
- videos: Watir::VideoCollection,
230
- wbr: Watir::HTMLElement,
231
- wbrs: Watir::HTMLElementCollection,
232
-
233
- # SVG
234
- circle: Watir::Circle,
235
- circles: Watir::CircleCollection,
236
- defs: Watir::Defs,
237
- defss: Watir::DefsCollection,
238
- desc: Watir::Desc,
239
- descs: Watir::DescCollection,
240
- ellipse: Watir::Ellipse,
241
- ellipses: Watir::EllipseCollection,
242
- foreign_object: Watir::ForeignObject,
243
- foreign_objects: Watir::ForeignObjectCollection,
244
- g: Watir::G,
245
- gs: Watir::GCollection,
246
- line: Watir::Line,
247
- lines: Watir::LineCollection,
248
- linear_gradient: Watir::LinearGradient,
249
- linear_gradients: Watir::LinearGradientCollection,
250
- marker: Watir::Marker,
251
- markers: Watir::MarkerCollection,
252
- metadata: Watir::Metadata,
253
- metadatas: Watir::MetadataCollection,
254
- path: Watir::Path,
255
- paths: Watir::PathCollection,
256
- pattern: Watir::Pattern,
257
- patterns: Watir::PatternCollection,
258
- polygon: Watir::Polygon,
259
- polygons: Watir::PolygonCollection,
260
- polyline: Watir::Polyline,
261
- polylines: Watir::PolylineCollection,
262
- radial_gradient: Watir::RadialGradient,
263
- radial_gradients: Watir::RadialGradientCollection,
264
- rect: Watir::Rect,
265
- rects: Watir::RectCollection,
266
- stop: Watir::Stop,
267
- stops: Watir::StopCollection,
268
- svg: Watir::SVG,
269
- svgs: Watir::SVGCollection,
270
- switch: Watir::Switch,
271
- switches: Watir::SwitchCollection,
272
- symbol: Watir::Symbol,
273
- symbols: Watir::SymbolCollection,
274
- text_path: Watir::TextPath,
275
- text_paths: Watir::TextPathCollection,
276
- tspan: Watir::TSpan,
277
- tspans: Watir::TSpanCollection,
278
- use: Watir::Use,
279
- uses: Watir::UseCollection,
280
- view: Watir::View,
281
- views: Watir::ViewCollection,
282
-
283
- # others
284
- radio: Watir::Radio,
285
- radios: Watir::RadioCollection,
286
- frame: Watir::Frame,
287
- frames: Watir::FrameCollection,
288
- file_field: Watir::FileField,
289
- file_fields: Watir::FileFieldCollection,
290
- hidden: Watir::Hidden,
291
- hiddens: Watir::HiddenCollection,
292
- checkbox: Watir::CheckBox,
293
- checkboxes: Watir::CheckBoxCollection,
294
- font: Watir::Font,
295
- fonts: Watir::FontCollection,
296
- text_field: Watir::TextField,
297
- text_fields: Watir::TextFieldCollection
298
- }
299
- if defined? Watir::DateTimeField
300
- watir_6_10_elems = {
301
- date_time_field: Watir::DateTimeField,
302
- date_time_fields: Watir::DateTimeFieldCollection,
303
- date_field: Watir::DateField,
304
- date_fields: Watir::DateFieldCollection
305
- }
306
- WATIR_METHOD_MAPPING.merge! watir_6_10_elems
6
+ WATIR_METHOD_MAPPING = Watir.tag_to_class.dup
7
+ Watir.tag_to_class.each do |tag, klass|
8
+ tags = tag.to_s.pluralize.to_sym
9
+ klasses = "#{klass}Collection".safe_constantize
10
+ WATIR_METHOD_MAPPING[tags] = klasses if klasses
307
11
  end
12
+ WATIR_METHOD_MAPPING[:image] = Watir::Image
13
+ WATIR_METHOD_MAPPING[:images] = Watir::ImageCollection
14
+ WATIR_METHOD_MAPPING[:link] = Watir::Anchor
15
+ WATIR_METHOD_MAPPING[:links] = Watir::AnchorCollection
16
+ WATIR_METHOD_MAPPING[:text_field] = Watir::TextField
17
+ WATIR_METHOD_MAPPING[:text_fields] = Watir::TextFieldCollection
18
+ WATIR_METHOD_MAPPING[:select_list] = Watir::Select
19
+ WATIR_METHOD_MAPPING[:select_lists] = Watir::SelectCollection
20
+ WATIR_METHOD_MAPPING[:field_set] = Watir::FieldSet
21
+ WATIR_METHOD_MAPPING[:field_sets] = Watir::FieldSetCollection
22
+ WATIR_METHOD_MAPPING[:radio] = Watir::Radio
23
+ WATIR_METHOD_MAPPING[:radios] = Watir::RadioCollection
24
+ WATIR_METHOD_MAPPING[:checkbox] = Watir::CheckBox
25
+ WATIR_METHOD_MAPPING[:checkboxes] = Watir::CheckBoxCollection
26
+ WATIR_METHOD_MAPPING[:frame] = Watir::Frame
27
+ WATIR_METHOD_MAPPING[:frames] = Watir::FrameCollection
28
+ WATIR_METHOD_MAPPING[:file_field] = Watir::FileField
29
+ WATIR_METHOD_MAPPING[:file_fields] = Watir::FileFieldCollection
30
+ WATIR_METHOD_MAPPING[:hidden] = Watir::Hidden
31
+ WATIR_METHOD_MAPPING[:hiddens] = Watir::HiddenCollection
32
+ WATIR_METHOD_MAPPING[:font] = Watir::Font
33
+ WATIR_METHOD_MAPPING[:fonts] = Watir::FontCollection
34
+
308
35
  WATIR_METHOD_MAPPING.freeze
309
36
  end
310
-
311
- # rubocop:enable Style/MutableConstant
312
- # rubocop:enable Metrics/ModuleLength
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir_pump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartek Wilczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-14 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -134,6 +134,7 @@ executables: []
134
134
  extensions: []
135
135
  extra_rdoc_files: []
136
136
  files:
137
+ - README.md
137
138
  - lib/watir_pump.rb
138
139
  - lib/watir_pump/component.rb
139
140
  - lib/watir_pump/component_collection.rb
@@ -166,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  version: '0'
167
168
  requirements: []
168
169
  rubyforge_project:
169
- rubygems_version: 2.6.14.1
170
+ rubygems_version: 2.7.6
170
171
  signing_key:
171
172
  specification_version: 4
172
173
  summary: Page Object pattern for Watir. Hacker friendly and enterprise ready.