watir 6.6.2 → 6.6.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f821e322222ce615fe8e9c02b6a5fcbf783c22e8
4
- data.tar.gz: b822b4d6fb0de96a76ffcb7c61f33640ef24c724
3
+ metadata.gz: 972d136a4af0abe48641cb7703820f8d15dc82a2
4
+ data.tar.gz: 41014e0e2977544fa86468ee3c91bb38e58f4f1c
5
5
  SHA512:
6
- metadata.gz: 933376823cd73c75e48a570972058dc32653ea54460fff9683073b42a19f242270f2eb6917bc108a9e8ddf84deabb390df6fb6e626f31b6fae55d4544e1da563
7
- data.tar.gz: 8132f6f936389fa572d981581c4c8ab893ea76e796a042d1ee32c6516a58241df2c4091d3c795b0ec6eeb36ec0e8d69c17d61b9beae598eb1e1feec055ac0238
6
+ metadata.gz: ba15ccf0f48236f3ab0df7523f562c1b19698c46a87b441229b0ff6fe24ab4749d145bce682ba166bfb5fa67d28f5177ffce6c0c5110d88e2f698be35db4cd1b
7
+ data.tar.gz: 54f53d8896b34ae1e6462b03347686e2fb16affc6e8e9f58bae598649a7f45b7f7de6186bc62aa1abf7881eb8ce0912b19adaf81c4bace186eabe01cbf89482e
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 6.6.3 (2017-08-09)
2
+
3
+ * Fix bug preventing usage of remote driver (#614)
4
+ * HTML Element attribute support updated to HTML 5.1
5
+
1
6
  ### 6.6.2 (2017-08-08)
2
7
 
3
8
  * Fix bug preventing headless operation (#611)
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ namespace :spec do
17
17
  end
18
18
 
19
19
  {
20
- html: 'https://www.whatwg.org/specs/web-apps/current-work/',
20
+ html: 'https://www.w3.org/TR/html/single-page.html',
21
21
  svg: 'http://www.w3.org/TR/SVG2/single-page.html'
22
22
  }.each do |type, spec_uri|
23
23
  namespace type do
@@ -4,10 +4,16 @@ module Watir
4
4
  attr_reader :options
5
5
 
6
6
  def initialize(browser, options = {})
7
- @browser = browser == :remote ? @options.delete(:browser).to_sym : browser.to_sym
7
+ @options = options.dup
8
+ @browser = if browser == :remote && @options.key?(:browser)
9
+ @options.delete(:browser)
10
+ elsif browser == :remote && @options.key?(:desired_capabilities)
11
+ @options[:desired_capabilities].browser_name.to_sym
12
+ else
13
+ browser.to_sym
14
+ end
8
15
  @selenium_browser = browser == :remote || options[:url] ? :remote : browser
9
16
 
10
- @options = options.dup
11
17
  @selenium_opts = {}
12
18
  end
13
19
 
@@ -6,30 +6,14 @@ module Watir
6
6
  attribute("Boolean", :translate?, :translate)
7
7
  attribute(String, :dir, :dir)
8
8
  attribute(String, :dataset, :dataset)
9
- attribute("Boolean", :item_scope?, :itemScope)
10
- attribute(String, :item_type, :itemType)
11
- attribute(String, :item_id, :itemId)
12
- attribute(String, :item_ref, :itemRef)
13
- attribute(String, :item_prop, :itemProp)
14
- attribute(String, :properties, :properties)
15
- attribute(String, :item_value, :itemValue)
16
9
  attribute("Boolean", :hidden?, :hidden)
17
10
  attribute(Integer, :tab_index, :tabIndex)
18
11
  attribute(String, :access_key, :accessKey)
19
- attribute(String, :access_key_label, :accessKeyLabel)
20
12
  attribute("Boolean", :draggable?, :draggable)
21
13
  attribute(String, :dropzone, :dropzone)
22
14
  attribute(String, :context_menu, :contextMenu)
23
15
  attribute("Boolean", :spellcheck?, :spellcheck)
24
- attribute(String, :command_type, :commandType)
25
- attribute(String, :command_label, :commandLabel)
26
- attribute(String, :command_icon, :commandIcon)
27
- attribute("Boolean", :command_hidden?, :commandHidden)
28
- attribute("Boolean", :command_disabled?, :commandDisabled)
29
- attribute("Boolean", :command_checked?, :commandChecked)
30
16
  attribute(String, :onabort, :onabort)
31
- attribute(String, :onautocomplete, :onautocomplete)
32
- attribute(String, :onautocompleteerror, :onautocompleteerror)
33
17
  attribute(String, :onblur, :onblur)
34
18
  attribute(String, :oncancel, :oncancel)
35
19
  attribute(String, :oncanplay, :oncanplay)
@@ -69,7 +53,7 @@ module Watir
69
53
  attribute(String, :onmouseout, :onmouseout)
70
54
  attribute(String, :onmouseover, :onmouseover)
71
55
  attribute(String, :onmouseup, :onmouseup)
72
- attribute(String, :onmousewheel, :onmousewheel)
56
+ attribute(String, :onwheel, :onwheel)
73
57
  attribute(String, :onpause, :onpause)
74
58
  attribute(String, :onplay, :onplay)
75
59
  attribute(String, :onplaying, :onplaying)
@@ -82,7 +66,6 @@ module Watir
82
66
  attribute(String, :onseeking, :onseeking)
83
67
  attribute(String, :onselect, :onselect)
84
68
  attribute(String, :onshow, :onshow)
85
- attribute(String, :onsort, :onsort)
86
69
  attribute(String, :onstalled, :onstalled)
87
70
  attribute(String, :onsubmit, :onsubmit)
88
71
  attribute(String, :onsuspend, :onsuspend)
@@ -90,6 +73,9 @@ module Watir
90
73
  attribute(String, :ontoggle, :ontoggle)
91
74
  attribute(String, :onvolumechange, :onvolumechange)
92
75
  attribute(String, :onwaiting, :onwaiting)
76
+ attribute(String, :oncopy, :oncopy)
77
+ attribute(String, :oncut, :oncut)
78
+ attribute(String, :onpaste, :onpaste)
93
79
  attribute(String, :content_editable, :contentEditable)
94
80
  attribute("Boolean", :content_editable?, :isContentEditable)
95
81
  end
@@ -122,8 +108,10 @@ module Watir
122
108
  attribute(String, :ononline, :ononline)
123
109
  attribute(String, :onpagehide, :onpagehide)
124
110
  attribute(String, :onpageshow, :onpageshow)
111
+ attribute(String, :onrejectionhandled, :onrejectionhandled)
125
112
  attribute(String, :onpopstate, :onpopstate)
126
113
  attribute(String, :onstorage, :onstorage)
114
+ attribute(String, :onunhandledrejection, :onunhandledrejection)
127
115
  attribute(String, :onunload, :onunload)
128
116
  end
129
117
  class FrameSetCollection < ElementCollection
@@ -184,19 +172,13 @@ module Watir
184
172
  attribute("Boolean", :async?, :async)
185
173
  attribute("Boolean", :defer?, :defer)
186
174
  attribute(String, :cross_origin, :crossOrigin)
175
+ attribute(String, :nonce, :nonce)
187
176
  attribute(String, :event, :event)
188
177
  attribute(String, :for, :htmlFor)
189
178
  end
190
179
  class ScriptCollection < ElementCollection
191
180
  end
192
181
 
193
- class Dialog < HTMLElement
194
- attribute("Boolean", :open?, :open)
195
- attribute(String, :return_value, :returnValue)
196
- end
197
- class DialogCollection < ElementCollection
198
- end
199
-
200
182
  class MenuItem < HTMLElement
201
183
  attribute(String, :type, :type)
202
184
  attribute(String, :label, :label)
@@ -205,7 +187,6 @@ module Watir
205
187
  attribute("Boolean", :checked?, :checked)
206
188
  attribute(String, :radiogroup, :radiogroup)
207
189
  attribute("Boolean", :default?, :default)
208
- attribute(String, :command, :command)
209
190
  end
210
191
  class MenuItemCollection < ElementCollection
211
192
  end
@@ -432,8 +413,6 @@ module Watir
432
413
  attribute(String, :value, :value)
433
414
  attribute(String, :value_as_date, :valueAsDate)
434
415
  attribute(Float, :value_as_number, :valueAsNumber)
435
- attribute(Float, :value_low, :valueLow)
436
- attribute(Float, :value_high, :valueHigh)
437
416
  attribute(Integer, :width, :width)
438
417
  attribute("Boolean", :will_validate?, :willValidate)
439
418
  attribute(String, :validity, :validity)
@@ -492,7 +471,6 @@ module Watir
492
471
  class TableHeaderCell < TableCell
493
472
  attribute(String, :scope, :scope)
494
473
  attribute(String, :abbr, :abbr)
495
- attribute(String, :sorted, :sorted)
496
474
  end
497
475
  class TableHeaderCellCollection < ElementCollection
498
476
  end
@@ -545,7 +523,6 @@ module Watir
545
523
  attribute(String, :t_head, :tHead)
546
524
  attribute(String, :t_foot, :tFoot)
547
525
  attribute(String, :t_bodies, :tBodies)
548
- attribute("Boolean", :sortable?, :sortable)
549
526
  attribute(String, :align, :align)
550
527
  attribute(String, :border, :border)
551
528
  attribute(String, :frame, :frame)
@@ -565,12 +542,21 @@ module Watir
565
542
  attribute(String, :shape, :shape)
566
543
  attribute(String, :target, :target)
567
544
  attribute(String, :download, :download)
568
- attribute(String, :ping, :ping)
569
545
  attribute(String, :rel, :rel)
570
546
  attribute(String, :rel_list, :relList)
571
547
  attribute(String, :hreflang, :hreflang)
572
548
  attribute(String, :type, :type)
573
549
  attribute("Boolean", :no_href?, :noHref)
550
+ attribute(String, :href, :href)
551
+ attribute(String, :origin, :origin)
552
+ attribute(String, :protocol, :protocol)
553
+ attribute(String, :username, :username)
554
+ attribute(String, :password, :password)
555
+ attribute(String, :host, :host)
556
+ attribute(String, :hostname, :hostname)
557
+ attribute(String, :port, :port)
558
+ attribute(String, :pathname, :pathname)
559
+ attribute(String, :search, :search)
574
560
  end
575
561
  class AreaCollection < ElementCollection
576
562
  end
@@ -604,8 +590,6 @@ module Watir
604
590
  attribute("Boolean", :ended?, :ended)
605
591
  attribute("Boolean", :autoplay?, :autoplay)
606
592
  attribute("Boolean", :loop?, :loop)
607
- attribute(String, :media_group, :mediaGroup)
608
- attribute(String, :controller, :controller)
609
593
  attribute("Boolean", :controls?, :controls)
610
594
  attribute(Float, :volume, :volume)
611
595
  attribute("Boolean", :muted?, :muted)
@@ -658,7 +642,6 @@ module Watir
658
642
  attribute(String, :type, :type)
659
643
  attribute("Boolean", :type_must_match?, :typeMustMatch)
660
644
  attribute(String, :name, :name)
661
- attribute(String, :use_map, :useMap)
662
645
  attribute(String, :form, :form)
663
646
  attribute(String, :width, :width)
664
647
  attribute(String, :height, :height)
@@ -676,6 +659,7 @@ module Watir
676
659
  attribute(Integer, :vspace, :vspace)
677
660
  attribute(String, :code_base, :codeBase)
678
661
  attribute(String, :code_type, :codeType)
662
+ attribute(String, :use_map, :useMap)
679
663
  attribute(String, :border, :border)
680
664
  end
681
665
  class ObjectCollection < ElementCollection
@@ -697,7 +681,6 @@ module Watir
697
681
  attribute(String, :srcdoc, :srcdoc)
698
682
  attribute(String, :name, :name)
699
683
  attribute(String, :sandbox, :sandbox)
700
- attribute("Boolean", :seamless?, :seamless)
701
684
  attribute("Boolean", :allow_fullscreen?, :allowFullscreen)
702
685
  attribute(String, :width, :width)
703
686
  attribute(String, :height, :height)
@@ -706,7 +689,6 @@ module Watir
706
689
  attribute(String, :align, :align)
707
690
  attribute(String, :scrolling, :scrolling)
708
691
  attribute(String, :frame_border, :frameBorder)
709
- attribute(String, :long_desc, :longDesc)
710
692
  attribute(String, :margin_height, :marginHeight)
711
693
  attribute(String, :margin_width, :marginWidth)
712
694
  end
@@ -732,7 +714,6 @@ module Watir
732
714
  attribute(String, :align, :align)
733
715
  attribute(Integer, :hspace, :hspace)
734
716
  attribute(Integer, :vspace, :vspace)
735
- attribute(String, :long_desc, :longDesc)
736
717
  attribute(String, :border, :border)
737
718
  end
738
719
  class ImageCollection < ElementCollection
@@ -786,16 +767,25 @@ module Watir
786
767
  class Anchor < HTMLElement
787
768
  attribute(String, :target, :target)
788
769
  attribute(String, :download, :download)
789
- attribute(String, :ping, :ping)
790
770
  attribute(String, :rel, :rel)
771
+ attribute(String, :rev, :rev)
791
772
  attribute(String, :rel_list, :relList)
792
773
  attribute(String, :hreflang, :hreflang)
793
774
  attribute(String, :type, :type)
794
775
  attribute(String, :coords, :coords)
795
776
  attribute(String, :charset, :charset)
796
777
  attribute(String, :name, :name)
797
- attribute(String, :rev, :rev)
798
778
  attribute(String, :shape, :shape)
779
+ attribute(String, :href, :href)
780
+ attribute(String, :origin, :origin)
781
+ attribute(String, :protocol, :protocol)
782
+ attribute(String, :username, :username)
783
+ attribute(String, :password, :password)
784
+ attribute(String, :host, :host)
785
+ attribute(String, :hostname, :hostname)
786
+ attribute(String, :port, :port)
787
+ attribute(String, :pathname, :pathname)
788
+ attribute(String, :search, :search)
799
789
  end
800
790
  class AnchorCollection < ElementCollection
801
791
  end
@@ -885,8 +875,10 @@ module Watir
885
875
  attribute(String, :ononline, :ononline)
886
876
  attribute(String, :onpagehide, :onpagehide)
887
877
  attribute(String, :onpageshow, :onpageshow)
878
+ attribute(String, :onrejectionhandled, :onrejectionhandled)
888
879
  attribute(String, :onpopstate, :onpopstate)
889
880
  attribute(String, :onstorage, :onstorage)
881
+ attribute(String, :onunhandledrejection, :onunhandledrejection)
890
882
  attribute(String, :onunload, :onunload)
891
883
  end
892
884
  class BodyCollection < ElementCollection
@@ -894,8 +886,8 @@ module Watir
894
886
 
895
887
  class Style < HTMLElement
896
888
  attribute(String, :media, :media)
889
+ attribute(String, :nonce, :nonce)
897
890
  attribute(String, :type, :type)
898
- attribute("Boolean", :scoped?, :scoped)
899
891
  end
900
892
  class StyleCollection < ElementCollection
901
893
  end
@@ -1210,16 +1202,6 @@ module Watir
1210
1202
  end
1211
1203
  Watir.tag_to_class[:dfn] = HTMLElement
1212
1204
 
1213
- # @return [Dialog]
1214
- def dialog(*args)
1215
- Dialog.new(self, extract_selector(args).merge(tag_name: "dialog"))
1216
- end
1217
- # @return [DialogCollection]
1218
- def dialogs(*args)
1219
- DialogCollection.new(self, extract_selector(args).merge(tag_name: "dialog"))
1220
- end
1221
- Watir.tag_to_class[:dialog] = Dialog
1222
-
1223
1205
  # @return [Div]
1224
1206
  def div(*args)
1225
1207
  Div.new(self, extract_selector(args).merge(tag_name: "div"))
@@ -1410,16 +1392,6 @@ module Watir
1410
1392
  end
1411
1393
  Watir.tag_to_class[:header] = HTMLElement
1412
1394
 
1413
- # @return [HTMLElement]
1414
- def hgroup(*args)
1415
- HTMLElement.new(self, extract_selector(args).merge(tag_name: "hgroup"))
1416
- end
1417
- # @return [HTMLElementCollection]
1418
- def hgroups(*args)
1419
- HTMLElementCollection.new(self, extract_selector(args).merge(tag_name: "hgroup"))
1420
- end
1421
- Watir.tag_to_class[:hgroup] = HTMLElement
1422
-
1423
1395
  # @return [HR]
1424
1396
  def hr(*args)
1425
1397
  HR.new(self, extract_selector(args).merge(tag_name: "hr"))
@@ -1700,6 +1672,16 @@ module Watir
1700
1672
  end
1701
1673
  Watir.tag_to_class[:param] = Param
1702
1674
 
1675
+ # @return [Picture]
1676
+ def picture(*args)
1677
+ Picture.new(self, extract_selector(args).merge(tag_name: "picture"))
1678
+ end
1679
+ # @return [PictureCollection]
1680
+ def pictures(*args)
1681
+ PictureCollection.new(self, extract_selector(args).merge(tag_name: "picture"))
1682
+ end
1683
+ Watir.tag_to_class[:picture] = Picture
1684
+
1703
1685
  # @return [Pre]
1704
1686
  def pre(*args)
1705
1687
  Pre.new(self, extract_selector(args).merge(tag_name: "pre"))
@@ -1730,6 +1712,16 @@ module Watir
1730
1712
  end
1731
1713
  Watir.tag_to_class[:q] = Quote
1732
1714
 
1715
+ # @return [HTMLElement]
1716
+ def rb(*args)
1717
+ HTMLElement.new(self, extract_selector(args).merge(tag_name: "rb"))
1718
+ end
1719
+ # @return [HTMLElementCollection]
1720
+ def rbs(*args)
1721
+ HTMLElementCollection.new(self, extract_selector(args).merge(tag_name: "rb"))
1722
+ end
1723
+ Watir.tag_to_class[:rb] = HTMLElement
1724
+
1733
1725
  # @return [HTMLElement]
1734
1726
  def rp(*args)
1735
1727
  HTMLElement.new(self, extract_selector(args).merge(tag_name: "rp"))
@@ -1750,6 +1742,16 @@ module Watir
1750
1742
  end
1751
1743
  Watir.tag_to_class[:rt] = HTMLElement
1752
1744
 
1745
+ # @return [HTMLElement]
1746
+ def rtc(*args)
1747
+ HTMLElement.new(self, extract_selector(args).merge(tag_name: "rtc"))
1748
+ end
1749
+ # @return [HTMLElementCollection]
1750
+ def rtcs(*args)
1751
+ HTMLElementCollection.new(self, extract_selector(args).merge(tag_name: "rtc"))
1752
+ end
1753
+ Watir.tag_to_class[:rtc] = HTMLElement
1754
+
1753
1755
  # @return [HTMLElement]
1754
1756
  def ruby(*args)
1755
1757
  HTMLElement.new(self, extract_selector(args).merge(tag_name: "ruby"))
@@ -2,7 +2,7 @@ module Watir
2
2
  module Generator
3
3
  class Base::SpecExtractor
4
4
 
5
- IDL_SELECTOR = "//pre[@class='idl']"
5
+ IDL_SELECTOR = "//pre[contains(@class, 'idl')]".freeze
6
6
 
7
7
  class InterfaceNotFound < StandardError; end
8
8
 
@@ -89,7 +89,7 @@ module Watir
89
89
  members = interface.members
90
90
  members += interface.implements.flat_map(&:members)
91
91
 
92
- members.select { |e| e.kind_of?(WebIDL::Ast::Attribute) }
92
+ members.select { |e| e.kind_of?(WebIDL::Ast::Attribute) }.uniq(&:name)
93
93
  end
94
94
 
95
95
  def collection_class(name)
@@ -144,7 +144,8 @@ module Watir
144
144
  'Document', 'DocumentFragment', 'DOMTokenList', 'DOMSettableTokenList',
145
145
  'DOMStringMap', 'HTMLPropertiesCollection', /HTML.*Element/, /HTML.*Collection/,
146
146
  'CSSStyleDeclaration', /.+List$/, 'Date', 'Element', /DOM.+ReadOnly/,
147
- /SVGAnimated.+/, /SVG.*Element/, /SVG.*Collection/, 'SVGViewSpec'
147
+ /SVGAnimated.+/, /SVG.*Element/, /SVG.*Collection/, 'SVGViewSpec',
148
+ 'Object', 'USVString'
148
149
  # probably completely wrong.
149
150
  String
150
151
  else
@@ -6,8 +6,8 @@ module Watir
6
6
 
7
7
  def extract_interface_map
8
8
  # http://www.whatwg.org/specs/web-apps/current-work/#elements-1
9
- table = @doc.search("//h3[@id='elements-3']/following-sibling::table[1]").first
10
- table or raise "could not find elements-3 table"
9
+ table = @doc.search("//h3[@id='index-elements']/following-sibling::table[1]").first
10
+ table or raise "could not find index-elements table"
11
11
 
12
12
  @interface_map = {}
13
13
 
@@ -89,6 +89,17 @@ describe Watir::Browser do
89
89
  new_browser.close
90
90
  end
91
91
 
92
+ it "uses remote client when specifying remote" do
93
+ opts = {desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome,
94
+ url: url}
95
+ WatirSpec.implementation.browser_args = [:remote, opts]
96
+ new_browser = WatirSpec.new_browser
97
+ server_url = new_browser.driver.instance_variable_get('@bridge').http.instance_variable_get('@server_url')
98
+ expect(server_url).to eq URI.parse(url)
99
+
100
+ new_browser.close
101
+ end
102
+
92
103
  not_compliant_on :headless do
93
104
  it "accepts Chrome::Options instance as :options" do
94
105
  chrome_opts = Selenium::WebDriver::Chrome::Options.new(emulation: {userAgent: 'foo;bar'})
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'watir'
5
- s.version = '6.6.2'
5
+ s.version = '6.6.3'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ['Alex Rodionov', 'Titus Fortner']
8
8
  s.email = ['p0deje@gmail.com', 'titusfortner@gmail.com']
@@ -25,7 +25,7 @@ It facilitates the writing of automated tests by mimicing the behavior of a user
25
25
 
26
26
  s.add_development_dependency 'rspec', '~> 3.0'
27
27
  s.add_development_dependency 'yard', '> 0.8.2.1'
28
- s.add_development_dependency 'webidl', '>= 0.1.5'
28
+ s.add_development_dependency 'webidl', '>= 0.2.0'
29
29
  s.add_development_dependency 'rake', '~> 0.9.2'
30
30
  s.add_development_dependency 'fuubar'
31
31
  s.add_development_dependency 'nokogiri'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.2
4
+ version: 6.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-08-08 00:00:00.000000000 Z
12
+ date: 2017-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
@@ -65,14 +65,14 @@ dependencies:
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.5
68
+ version: 0.2.0
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.5
75
+ version: 0.2.0
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rake
78
78
  requirement: !ruby/object:Gem::Requirement