watir 6.13.0 → 6.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +141 -0
  3. data/.travis.yml +6 -0
  4. data/CHANGES.md +12 -0
  5. data/Gemfile +4 -10
  6. data/README.md +64 -49
  7. data/Rakefile +28 -16
  8. data/lib/watir.rb +13 -15
  9. data/lib/watir/adjacent.rb +15 -13
  10. data/lib/watir/after_hooks.rb +8 -10
  11. data/lib/watir/alert.rb +7 -8
  12. data/lib/watir/aliases.rb +2 -2
  13. data/lib/watir/attribute_helper.rb +18 -20
  14. data/lib/watir/browser.rb +42 -75
  15. data/lib/watir/capabilities.rb +19 -10
  16. data/lib/watir/cell_container.rb +0 -2
  17. data/lib/watir/container.rb +4 -4
  18. data/lib/watir/cookies.rb +7 -8
  19. data/lib/watir/element_collection.rb +37 -22
  20. data/lib/watir/elements/area.rb +0 -2
  21. data/lib/watir/elements/button.rb +1 -3
  22. data/lib/watir/elements/cell.rb +0 -1
  23. data/lib/watir/elements/checkbox.rb +5 -7
  24. data/lib/watir/elements/date_field.rb +5 -9
  25. data/lib/watir/elements/date_time_field.rb +6 -10
  26. data/lib/watir/elements/dlist.rb +2 -4
  27. data/lib/watir/elements/element.rb +201 -99
  28. data/lib/watir/elements/file_field.rb +3 -4
  29. data/lib/watir/elements/font.rb +2 -4
  30. data/lib/watir/elements/form.rb +0 -2
  31. data/lib/watir/elements/hidden.rb +3 -4
  32. data/lib/watir/elements/html_elements.rb +24 -76
  33. data/lib/watir/elements/iframe.rb +57 -71
  34. data/lib/watir/elements/image.rb +3 -4
  35. data/lib/watir/elements/input.rb +0 -2
  36. data/lib/watir/elements/link.rb +2 -5
  37. data/lib/watir/elements/list.rb +4 -4
  38. data/lib/watir/elements/option.rb +3 -6
  39. data/lib/watir/elements/radio.rb +4 -6
  40. data/lib/watir/elements/row.rb +0 -1
  41. data/lib/watir/elements/select.rb +41 -43
  42. data/lib/watir/elements/svg_elements.rb +0 -116
  43. data/lib/watir/elements/table.rb +1 -2
  44. data/lib/watir/elements/table_cell.rb +2 -3
  45. data/lib/watir/elements/text_field.rb +4 -6
  46. data/lib/watir/exception.rb +0 -1
  47. data/lib/watir/extensions/nokogiri.rb +2 -4
  48. data/lib/watir/generator.rb +3 -3
  49. data/lib/watir/generator/base.rb +10 -10
  50. data/lib/watir/generator/base/generator.rb +26 -29
  51. data/lib/watir/generator/base/idl_sorter.rb +34 -32
  52. data/lib/watir/generator/base/spec_extractor.rb +132 -114
  53. data/lib/watir/generator/base/util.rb +1 -3
  54. data/lib/watir/generator/base/visitor.rb +140 -140
  55. data/lib/watir/generator/html.rb +4 -4
  56. data/lib/watir/generator/html/generator.rb +2 -4
  57. data/lib/watir/generator/html/spec_extractor.rb +33 -33
  58. data/lib/watir/generator/html/visitor.rb +14 -14
  59. data/lib/watir/generator/svg.rb +3 -3
  60. data/lib/watir/generator/svg/generator.rb +1 -3
  61. data/lib/watir/generator/svg/spec_extractor.rb +35 -35
  62. data/lib/watir/generator/svg/visitor.rb +14 -14
  63. data/lib/watir/has_window.rb +2 -4
  64. data/lib/watir/js_execution.rb +7 -9
  65. data/lib/watir/js_snippets.rb +3 -3
  66. data/lib/watir/js_snippets/attributeValues.js +11 -0
  67. data/lib/watir/legacy_wait.rb +7 -12
  68. data/lib/watir/locators.rb +9 -11
  69. data/lib/watir/locators/button/locator.rb +2 -3
  70. data/lib/watir/locators/button/selector_builder.rb +9 -9
  71. data/lib/watir/locators/button/selector_builder/xpath.rb +1 -1
  72. data/lib/watir/locators/button/validator.rb +2 -2
  73. data/lib/watir/locators/cell/locator.rb +0 -2
  74. data/lib/watir/locators/cell/selector_builder.rb +3 -5
  75. data/lib/watir/locators/element/locator.rb +85 -64
  76. data/lib/watir/locators/element/selector_builder.rb +40 -38
  77. data/lib/watir/locators/element/selector_builder/xpath.rb +20 -18
  78. data/lib/watir/locators/element/validator.rb +1 -1
  79. data/lib/watir/locators/row/locator.rb +0 -2
  80. data/lib/watir/locators/row/selector_builder.rb +6 -9
  81. data/lib/watir/locators/text_area/selector_builder.rb +1 -1
  82. data/lib/watir/locators/text_field/locator.rb +1 -3
  83. data/lib/watir/locators/text_field/selector_builder.rb +5 -5
  84. data/lib/watir/locators/text_field/selector_builder/xpath.rb +1 -1
  85. data/lib/watir/locators/text_field/validator.rb +3 -2
  86. data/lib/watir/logger.rb +11 -21
  87. data/lib/watir/navigation.rb +49 -0
  88. data/lib/watir/radio_set.rb +17 -18
  89. data/lib/watir/row_container.rb +3 -5
  90. data/lib/watir/screenshot.rb +2 -4
  91. data/lib/watir/user_editable.rb +13 -8
  92. data/lib/watir/version.rb +3 -0
  93. data/lib/watir/wait.rb +56 -55
  94. data/lib/watir/wait/timer.rb +1 -3
  95. data/lib/watir/window.rb +36 -45
  96. data/lib/watir/xpath_support.rb +1 -3
  97. data/lib/watirspec.rb +11 -11
  98. data/lib/watirspec/guards.rb +10 -7
  99. data/lib/watirspec/implementation.rb +3 -4
  100. data/lib/watirspec/rake_tasks.rb +30 -29
  101. data/lib/watirspec/remote_server.rb +3 -3
  102. data/lib/watirspec/runner.rb +1 -2
  103. data/lib/watirspec/server.rb +3 -0
  104. data/lib/watirspec/server/app.rb +14 -6
  105. data/spec/implementation_spec.rb +9 -9
  106. data/spec/locator_spec_helper.rb +3 -4
  107. data/spec/spec_helper.rb +3 -7
  108. data/spec/unit/container_spec.rb +9 -10
  109. data/spec/unit/element_locator_spec.rb +224 -219
  110. data/spec/unit/logger_spec.rb +4 -4
  111. data/spec/unit/unit_helper.rb +0 -2
  112. data/spec/unit/wait_spec.rb +26 -28
  113. data/spec/watirspec/adjacent_spec.rb +130 -130
  114. data/spec/watirspec/after_hooks_spec.rb +63 -63
  115. data/spec/watirspec/alert_spec.rb +6 -6
  116. data/spec/watirspec/attributes_spec.rb +6 -6
  117. data/spec/watirspec/browser_spec.rb +161 -162
  118. data/spec/watirspec/click_spec.rb +9 -9
  119. data/spec/watirspec/cookies_spec.rb +15 -14
  120. data/spec/watirspec/drag_and_drop_spec.rb +15 -16
  121. data/spec/watirspec/element_hidden_spec.rb +19 -21
  122. data/spec/watirspec/elements/area_spec.rb +18 -21
  123. data/spec/watirspec/elements/areas_spec.rb +13 -15
  124. data/spec/watirspec/elements/button_spec.rb +96 -99
  125. data/spec/watirspec/elements/buttons_spec.rb +17 -19
  126. data/spec/watirspec/elements/checkbox_spec.rb +102 -100
  127. data/spec/watirspec/elements/checkboxes_spec.rb +13 -15
  128. data/spec/watirspec/elements/collections_spec.rb +35 -37
  129. data/spec/watirspec/elements/date_field_spec.rb +46 -47
  130. data/spec/watirspec/elements/date_fields_spec.rb +13 -15
  131. data/spec/watirspec/elements/date_time_field_spec.rb +62 -57
  132. data/spec/watirspec/elements/date_time_fields_spec.rb +14 -15
  133. data/spec/watirspec/elements/dd_spec.rb +46 -48
  134. data/spec/watirspec/elements/dds_spec.rb +13 -15
  135. data/spec/watirspec/elements/del_spec.rb +27 -28
  136. data/spec/watirspec/elements/dels_spec.rb +13 -15
  137. data/spec/watirspec/elements/div_spec.rb +89 -91
  138. data/spec/watirspec/elements/divs_spec.rb +17 -19
  139. data/spec/watirspec/elements/dl_spec.rb +52 -54
  140. data/spec/watirspec/elements/dls_spec.rb +13 -15
  141. data/spec/watirspec/elements/dt_spec.rb +46 -48
  142. data/spec/watirspec/elements/dts_spec.rb +13 -15
  143. data/spec/watirspec/elements/element_spec.rb +240 -189
  144. data/spec/watirspec/elements/elements_spec.rb +16 -16
  145. data/spec/watirspec/elements/em_spec.rb +38 -40
  146. data/spec/watirspec/elements/ems_spec.rb +13 -15
  147. data/spec/watirspec/elements/filefield_spec.rb +45 -46
  148. data/spec/watirspec/elements/filefields_spec.rb +13 -15
  149. data/spec/watirspec/elements/font_spec.rb +11 -13
  150. data/spec/watirspec/elements/form_spec.rb +13 -15
  151. data/spec/watirspec/elements/forms_spec.rb +13 -15
  152. data/spec/watirspec/elements/frame_spec.rb +48 -50
  153. data/spec/watirspec/elements/frames_spec.rb +13 -15
  154. data/spec/watirspec/elements/hidden_spec.rb +23 -25
  155. data/spec/watirspec/elements/hiddens_spec.rb +13 -15
  156. data/spec/watirspec/elements/hn_spec.rb +22 -24
  157. data/spec/watirspec/elements/hns_spec.rb +13 -13
  158. data/spec/watirspec/elements/iframe_spec.rb +106 -74
  159. data/spec/watirspec/elements/iframes_spec.rb +16 -18
  160. data/spec/watirspec/elements/image_spec.rb +30 -32
  161. data/spec/watirspec/elements/images_spec.rb +13 -15
  162. data/spec/watirspec/elements/input_spec.rb +4 -5
  163. data/spec/watirspec/elements/ins_spec.rb +27 -29
  164. data/spec/watirspec/elements/inses_spec.rb +13 -15
  165. data/spec/watirspec/elements/label_spec.rb +17 -19
  166. data/spec/watirspec/elements/labels_spec.rb +13 -15
  167. data/spec/watirspec/elements/li_spec.rb +23 -25
  168. data/spec/watirspec/elements/link_spec.rb +45 -48
  169. data/spec/watirspec/elements/links_spec.rb +14 -16
  170. data/spec/watirspec/elements/lis_spec.rb +13 -15
  171. data/spec/watirspec/elements/list_spec.rb +14 -15
  172. data/spec/watirspec/elements/map_spec.rb +19 -20
  173. data/spec/watirspec/elements/maps_spec.rb +13 -15
  174. data/spec/watirspec/elements/meta_spec.rb +10 -10
  175. data/spec/watirspec/elements/metas_spec.rb +13 -15
  176. data/spec/watirspec/elements/ol_spec.rb +20 -21
  177. data/spec/watirspec/elements/ols_spec.rb +13 -15
  178. data/spec/watirspec/elements/option_spec.rb +63 -63
  179. data/spec/watirspec/elements/p_spec.rb +27 -26
  180. data/spec/watirspec/elements/pre_spec.rb +24 -25
  181. data/spec/watirspec/elements/pres_spec.rb +13 -15
  182. data/spec/watirspec/elements/ps_spec.rb +13 -15
  183. data/spec/watirspec/elements/radio_spec.rb +96 -97
  184. data/spec/watirspec/elements/radios_spec.rb +13 -15
  185. data/spec/watirspec/elements/select_list_spec.rb +244 -237
  186. data/spec/watirspec/elements/select_lists_spec.rb +15 -16
  187. data/spec/watirspec/elements/span_spec.rb +32 -31
  188. data/spec/watirspec/elements/spans_spec.rb +13 -15
  189. data/spec/watirspec/elements/strong_spec.rb +23 -24
  190. data/spec/watirspec/elements/strongs_spec.rb +13 -15
  191. data/spec/watirspec/elements/table_nesting_spec.rb +15 -14
  192. data/spec/watirspec/elements/table_spec.rb +61 -62
  193. data/spec/watirspec/elements/tables_spec.rb +15 -17
  194. data/spec/watirspec/elements/tbody_spec.rb +25 -26
  195. data/spec/watirspec/elements/tbodys_spec.rb +17 -19
  196. data/spec/watirspec/elements/td_spec.rb +20 -22
  197. data/spec/watirspec/elements/tds_spec.rb +9 -11
  198. data/spec/watirspec/elements/text_field_spec.rb +55 -56
  199. data/spec/watirspec/elements/text_fields_spec.rb +15 -16
  200. data/spec/watirspec/elements/textarea_spec.rb +2 -2
  201. data/spec/watirspec/elements/textareas_spec.rb +1 -1
  202. data/spec/watirspec/elements/tfoot_spec.rb +22 -23
  203. data/spec/watirspec/elements/tfoots_spec.rb +19 -19
  204. data/spec/watirspec/elements/thead_spec.rb +21 -23
  205. data/spec/watirspec/elements/theads_spec.rb +19 -19
  206. data/spec/watirspec/elements/tr_spec.rb +20 -22
  207. data/spec/watirspec/elements/trs_spec.rb +17 -19
  208. data/spec/watirspec/elements/ul_spec.rb +17 -19
  209. data/spec/watirspec/elements/uls_spec.rb +13 -14
  210. data/spec/watirspec/html/data_attributes.html +1 -0
  211. data/spec/watirspec/radio_set_spec.rb +100 -99
  212. data/spec/watirspec/relaxed_locate_spec.rb +19 -43
  213. data/spec/watirspec/screenshot_spec.rb +4 -4
  214. data/spec/watirspec/special_chars_spec.rb +2 -4
  215. data/spec/watirspec/support/rspec_matchers.rb +85 -22
  216. data/spec/watirspec/user_editable_spec.rb +84 -85
  217. data/spec/watirspec/wait_spec.rb +74 -95
  218. data/spec/watirspec/window_switching_spec.rb +131 -132
  219. data/spec/watirspec_helper.rb +12 -9
  220. data/support/travis.sh +4 -0
  221. data/support/version_differ.rb +12 -13
  222. data/watir.gemspec +29 -22
  223. metadata +76 -50
@@ -1,31 +1,31 @@
1
- require "watirspec_helper"
2
-
3
- describe "DateTimeFields" do
1
+ require 'watirspec_helper'
4
2
 
3
+ describe 'DateTimeFields' do
5
4
  before :each do
6
- browser.goto(WatirSpec.url_for("forms_with_input_elements.html"))
5
+ browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
7
6
  end
8
7
 
9
- describe "with selectors" do
10
- it "returns the matching elements" do
11
- expect(browser.date_time_fields(name: "html5_datetime-local").to_a).to eq [browser.date_time_field(name: "html5_datetime-local")]
8
+ describe 'with selectors' do
9
+ it 'returns the matching elements' do
10
+ list = [browser.date_time_field(name: 'html5_datetime-local')]
11
+ expect(browser.date_time_fields(name: 'html5_datetime-local').to_a).to eq list
12
12
  end
13
13
  end
14
14
 
15
- describe "#length" do
16
- it "returns the number of date_time_fields" do
15
+ describe '#length' do
16
+ it 'returns the number of date_time_fields' do
17
17
  expect(browser.date_time_fields.length).to eq 1
18
18
  end
19
19
  end
20
20
 
21
- describe "#[]" do
22
- it "returns the date_time_field at the given index" do
23
- expect(browser.date_time_fields[0].id).to eq "html5_datetime-local"
21
+ describe '#[]' do
22
+ it 'returns the date_time_field at the given index' do
23
+ expect(browser.date_time_fields[0].id).to eq 'html5_datetime-local'
24
24
  end
25
25
  end
26
26
 
27
- describe "#each" do
28
- it "iterates through date_time_fields correctly" do
27
+ describe '#each' do
28
+ it 'iterates through date_time_fields correctly' do
29
29
  count = 0
30
30
 
31
31
  browser.date_time_fields.each_with_index do |c, index|
@@ -40,5 +40,4 @@ describe "DateTimeFields" do
40
40
  expect(count).to be > 0
41
41
  end
42
42
  end
43
-
44
43
  end
@@ -1,26 +1,25 @@
1
- require "watirspec_helper"
2
-
3
- describe "Dd" do
1
+ require 'watirspec_helper'
4
2
 
3
+ describe 'Dd' do
5
4
  before :each do
6
- browser.goto(WatirSpec.url_for("definition_lists.html"))
5
+ browser.goto(WatirSpec.url_for('definition_lists.html'))
7
6
  end
8
7
 
9
8
  # Exists method
10
- describe "#exists?" do
11
- it "returns true if the element exists" do
12
- expect(browser.dd(id: "someone")).to exist
13
- expect(browser.dd(class: "name")).to exist
9
+ describe '#exists?' do
10
+ it 'returns true if the element exists' do
11
+ expect(browser.dd(id: 'someone')).to exist
12
+ expect(browser.dd(class: 'name')).to exist
14
13
  expect(browser.dd(xpath: "//dd[@id='someone']")).to exist
15
14
  expect(browser.dd(index: 0)).to exist
16
15
  end
17
16
 
18
- it "returns the first dd if given no args" do
17
+ it 'returns the first dd if given no args' do
19
18
  expect(browser.dd).to exist
20
19
  end
21
20
 
22
- it "returns false if the element does not exist" do
23
- expect(browser.dd(id: "no_such_id")).to_not exist
21
+ it 'returns false if the element does not exist' do
22
+ expect(browser.dd(id: 'no_such_id')).to_not exist
24
23
  end
25
24
 
26
25
  it "raises TypeError when 'what' argument is invalid" do
@@ -29,66 +28,66 @@ describe "Dd" do
29
28
  end
30
29
 
31
30
  # Attribute methods
32
- describe "#class_name" do
33
- it "returns the class attribute if the element exists" do
34
- expect(browser.dd(id: "someone").class_name).to eq "name"
31
+ describe '#class_name' do
32
+ it 'returns the class attribute if the element exists' do
33
+ expect(browser.dd(id: 'someone').class_name).to eq 'name'
35
34
  end
36
35
 
37
36
  it "returns an empty string if the element exists but the attribute doesn't" do
38
- expect(browser.dd(id: "city").class_name).to eq ""
37
+ expect(browser.dd(id: 'city').class_name).to eq ''
39
38
  end
40
39
 
41
- it "raises UnknownObjectException if the element does not exist" do
42
- expect { browser.dd(id: "no_such_id").class_name }.to raise_unknown_object_exception
43
- expect { browser.dd(title: "no_such_title").class_name }.to raise_unknown_object_exception
40
+ it 'raises UnknownObjectException if the element does not exist' do
41
+ expect { browser.dd(id: 'no_such_id').class_name }.to raise_unknown_object_exception
42
+ expect { browser.dd(title: 'no_such_title').class_name }.to raise_unknown_object_exception
44
43
  expect { browser.dd(index: 1337).class_name }.to raise_unknown_object_exception
45
44
  expect { browser.dd(xpath: "//dd[@id='no_such_id']").class_name }.to raise_unknown_object_exception
46
45
  end
47
46
  end
48
47
 
49
- describe "#id" do
50
- it "returns the id attribute if the element exists" do
51
- expect(browser.dd(class: 'name').id).to eq "someone"
48
+ describe '#id' do
49
+ it 'returns the id attribute if the element exists' do
50
+ expect(browser.dd(class: 'name').id).to eq 'someone'
52
51
  end
53
52
 
54
53
  it "returns an empty string if the element exists, but the attribute doesn't" do
55
- expect(browser.dd(class: 'address').id).to eq ""
54
+ expect(browser.dd(class: 'address').id).to eq ''
56
55
  end
57
56
 
58
- it "raises UnknownObjectException if the element does not exist" do
59
- expect {browser.dd(id: "no_such_id").id }.to raise_unknown_object_exception
60
- expect {browser.dd(title: "no_such_id").id }.to raise_unknown_object_exception
61
- expect {browser.dd(index: 1337).id }.to raise_unknown_object_exception
57
+ it 'raises UnknownObjectException if the element does not exist' do
58
+ expect { browser.dd(id: 'no_such_id').id }.to raise_unknown_object_exception
59
+ expect { browser.dd(title: 'no_such_id').id }.to raise_unknown_object_exception
60
+ expect { browser.dd(index: 1337).id }.to raise_unknown_object_exception
62
61
  end
63
62
  end
64
63
 
65
- describe "#title" do
66
- it "returns the title of the element" do
67
- expect(browser.dd(class: "name").title).to eq "someone"
64
+ describe '#title' do
65
+ it 'returns the title of the element' do
66
+ expect(browser.dd(class: 'name').title).to eq 'someone'
68
67
  end
69
68
  end
70
69
 
71
- describe "#text" do
72
- it "returns the text of the element" do
73
- expect(browser.dd(id: "someone").text).to eq "John Doe"
70
+ describe '#text' do
71
+ it 'returns the text of the element' do
72
+ expect(browser.dd(id: 'someone').text).to eq 'John Doe'
74
73
  end
75
74
 
76
- bug "Safari does not strip text", :safari do
77
- it "returns an empty string if the element exists but contains no text" do
78
- expect(browser.dd(class: 'noop').text).to eq ""
75
+ bug 'Safari does not strip text', :safari do
76
+ it 'returns an empty string if the element exists but contains no text' do
77
+ expect(browser.dd(class: 'noop').text).to eq ''
79
78
  end
80
79
  end
81
80
 
82
- it "raises UnknownObjectException if the element does not exist" do
83
- expect { browser.dd(id: "no_such_id").text }.to raise_unknown_object_exception
84
- expect { browser.dd(title: "no_such_title").text }.to raise_unknown_object_exception
81
+ it 'raises UnknownObjectException if the element does not exist' do
82
+ expect { browser.dd(id: 'no_such_id').text }.to raise_unknown_object_exception
83
+ expect { browser.dd(title: 'no_such_title').text }.to raise_unknown_object_exception
85
84
  expect { browser.dd(index: 1337).text }.to raise_unknown_object_exception
86
85
  expect { browser.dd(xpath: "//dd[@id='no_such_id']").text }.to raise_unknown_object_exception
87
86
  end
88
87
  end
89
88
 
90
- describe "#respond_to?" do
91
- it "returns true for all attribute methods" do
89
+ describe '#respond_to?' do
90
+ it 'returns true for all attribute methods' do
92
91
  expect(browser.dd(index: 0)).to respond_to(:id)
93
92
  expect(browser.dd(index: 0)).to respond_to(:class_name)
94
93
  expect(browser.dd(index: 0)).to respond_to(:style)
@@ -98,27 +97,26 @@ describe "Dd" do
98
97
  end
99
98
 
100
99
  # Manipulation methods
101
- describe "#click" do
102
- it "fires events when clicked" do
100
+ describe '#click' do
101
+ it 'fires events when clicked' do
103
102
  expect(browser.dd(title: 'education').text).to_not eq 'changed'
104
103
  browser.dd(title: 'education').click
105
104
  expect(browser.dd(title: 'education').text).to eq 'changed'
106
105
  end
107
106
 
108
- it "raises UnknownObjectException if the element does not exist" do
109
- expect { browser.dd(id: "no_such_id").click }.to raise_unknown_object_exception
110
- expect { browser.dd(title: "no_such_title").click }.to raise_unknown_object_exception
107
+ it 'raises UnknownObjectException if the element does not exist' do
108
+ expect { browser.dd(id: 'no_such_id').click }.to raise_unknown_object_exception
109
+ expect { browser.dd(title: 'no_such_title').click }.to raise_unknown_object_exception
111
110
  expect { browser.dd(index: 1337).click }.to raise_unknown_object_exception
112
111
  expect { browser.dd(xpath: "//dd[@id='no_such_id']").click }.to raise_unknown_object_exception
113
112
  end
114
113
  end
115
114
 
116
- describe "#html" do
117
- it "returns the HTML of the element" do
115
+ describe '#html' do
116
+ it 'returns the HTML of the element' do
118
117
  html = browser.dd(id: 'someone').html
119
118
  expect(html).to match(/John Doe/m)
120
119
  expect(html).to_not include('</body>')
121
120
  end
122
121
  end
123
-
124
122
  end
@@ -1,31 +1,30 @@
1
- require "watirspec_helper"
2
-
3
- describe "Dds" do
1
+ require 'watirspec_helper'
4
2
 
3
+ describe 'Dds' do
5
4
  before :each do
6
- browser.goto(WatirSpec.url_for("definition_lists.html"))
5
+ browser.goto(WatirSpec.url_for('definition_lists.html'))
7
6
  end
8
7
 
9
- describe "with selectors" do
10
- it "returns the matching elements" do
11
- expect(browser.dds(text: "11 years").to_a).to eq [browser.dd(text: "11 years")]
8
+ describe 'with selectors' do
9
+ it 'returns the matching elements' do
10
+ expect(browser.dds(text: '11 years').to_a).to eq [browser.dd(text: '11 years')]
12
11
  end
13
12
  end
14
13
 
15
- describe "#length" do
16
- it "returns the number of dds" do
14
+ describe '#length' do
15
+ it 'returns the number of dds' do
17
16
  expect(browser.dds.length).to eq 11
18
17
  end
19
18
  end
20
19
 
21
- describe "#[]" do
22
- it "returns the dd at the given index" do
23
- expect(browser.dds[1].title).to eq "education"
20
+ describe '#[]' do
21
+ it 'returns the dd at the given index' do
22
+ expect(browser.dds[1].title).to eq 'education'
24
23
  end
25
24
  end
26
25
 
27
- describe "#each" do
28
- it "iterates through dds correctly" do
26
+ describe '#each' do
27
+ it 'iterates through dds correctly' do
29
28
  count = 0
30
29
 
31
30
  browser.dds.each_with_index do |d, index|
@@ -38,5 +37,4 @@ describe "Dds" do
38
37
  expect(count).to be > 0
39
38
  end
40
39
  end
41
-
42
40
  end
@@ -1,34 +1,33 @@
1
- require "watirspec_helper"
2
-
3
- describe "Del" do
1
+ require 'watirspec_helper'
4
2
 
3
+ describe 'Del' do
5
4
  before :each do
6
- browser.goto(WatirSpec.url_for("non_control_elements.html"))
5
+ browser.goto(WatirSpec.url_for('non_control_elements.html'))
7
6
  end
8
7
 
9
8
  # Exists method
10
- describe "#exist?" do
9
+ describe '#exist?' do
11
10
  it "returns true if the 'del' exists" do
12
- expect(browser.del(id: "lead")).to exist
11
+ expect(browser.del(id: 'lead')).to exist
13
12
  expect(browser.del(id: /lead/)).to exist
14
- expect(browser.del(text: "This is a deleted text tag 1")).to exist
13
+ expect(browser.del(text: 'This is a deleted text tag 1')).to exist
15
14
  expect(browser.del(text: /This is a deleted text tag 1/)).to exist
16
- expect(browser.del(class: "lead")).to exist
15
+ expect(browser.del(class: 'lead')).to exist
17
16
  expect(browser.del(class: /lead/)).to exist
18
17
  expect(browser.del(index: 0)).to exist
19
18
  expect(browser.del(xpath: "//del[@id='lead']")).to exist
20
19
  end
21
20
 
22
- it "returns the first del if given no args" do
21
+ it 'returns the first del if given no args' do
23
22
  expect(browser.del).to exist
24
23
  end
25
24
 
26
25
  it "returns false if the element doesn't exist" do
27
- expect(browser.del(id: "no_such_id")).to_not exist
26
+ expect(browser.del(id: 'no_such_id')).to_not exist
28
27
  expect(browser.del(id: /no_such_id/)).to_not exist
29
- expect(browser.del(text: "no_such_text")).to_not exist
28
+ expect(browser.del(text: 'no_such_text')).to_not exist
30
29
  expect(browser.del(text: /no_such_text/)).to_not exist
31
- expect(browser.del(class: "no_such_class")).to_not exist
30
+ expect(browser.del(class: 'no_such_class')).to_not exist
32
31
  expect(browser.del(class: /no_such_class/)).to_not exist
33
32
  expect(browser.del(index: 1337)).to_not exist
34
33
  expect(browser.del(xpath: "//del[@id='no_such_id']")).to_not exist
@@ -40,8 +39,8 @@ describe "Del" do
40
39
  end
41
40
 
42
41
  # Attribute methods
43
- describe "#class_name" do
44
- it "returns the class attribute" do
42
+ describe '#class_name' do
43
+ it 'returns the class attribute' do
45
44
  expect(browser.del(index: 0).class_name).to eq 'lead'
46
45
  end
47
46
 
@@ -54,9 +53,9 @@ describe "Del" do
54
53
  end
55
54
  end
56
55
 
57
- describe "#id" do
58
- it "returns the id attribute" do
59
- expect(browser.del(index: 0).id).to eq "lead"
56
+ describe '#id' do
57
+ it 'returns the id attribute' do
58
+ expect(browser.del(index: 0).id).to eq 'lead'
60
59
  end
61
60
 
62
61
  it "returns an empty string if the element exists and the attribute doesn't" do
@@ -64,13 +63,13 @@ describe "Del" do
64
63
  end
65
64
 
66
65
  it "raises UnknownObjectException if the del doesn't exist" do
67
- expect { browser.del(id: "no_such_id").id }.to raise_unknown_object_exception
66
+ expect { browser.del(id: 'no_such_id').id }.to raise_unknown_object_exception
68
67
  expect { browser.del(index: 1337).id }.to raise_unknown_object_exception
69
68
  end
70
69
  end
71
70
 
72
- describe "#title" do
73
- it "returns the title attribute" do
71
+ describe '#title' do
72
+ it 'returns the title attribute' do
74
73
  expect(browser.del(index: 0).title).to eq 'Lorem ipsum'
75
74
  end
76
75
 
@@ -84,8 +83,8 @@ describe "Del" do
84
83
  end
85
84
  end
86
85
 
87
- describe "#text" do
88
- it "returns the text of the del" do
86
+ describe '#text' do
87
+ it 'returns the text of the del' do
89
88
  expect(browser.del(index: 1).text).to eq 'This is a deleted text tag 2'
90
89
  end
91
90
 
@@ -99,8 +98,8 @@ describe "Del" do
99
98
  end
100
99
  end
101
100
 
102
- describe "#respond_to?" do
103
- it "returns true for all attribute methods" do
101
+ describe '#respond_to?' do
102
+ it 'returns true for all attribute methods' do
104
103
  expect(browser.del(index: 0)).to respond_to(:class_name)
105
104
  expect(browser.del(index: 0)).to respond_to(:id)
106
105
  expect(browser.del(index: 0)).to respond_to(:title)
@@ -110,16 +109,16 @@ describe "Del" do
110
109
 
111
110
  # Other
112
111
  not_compliant_on :headless do
113
- describe "#click" do
114
- it "fires events" do
112
+ describe '#click' do
113
+ it 'fires events' do
115
114
  expect(browser.del(class: 'footer').text).to_not include('Javascript')
116
115
  browser.del(class: 'footer').click
117
116
  expect(browser.del(class: 'footer').text).to include('Javascript')
118
117
  end
119
118
 
120
119
  it "raises UnknownObjectException if the del doesn't exist" do
121
- expect { browser.del(id: "no_such_id").click }.to raise_unknown_object_exception
122
- expect { browser.del(title: "no_such_title").click }.to raise_unknown_object_exception
120
+ expect { browser.del(id: 'no_such_id').click }.to raise_unknown_object_exception
121
+ expect { browser.del(title: 'no_such_title').click }.to raise_unknown_object_exception
123
122
  end
124
123
  end
125
124
  end
@@ -1,31 +1,30 @@
1
- require "watirspec_helper"
2
-
3
- describe "Dels" do
1
+ require 'watirspec_helper'
4
2
 
3
+ describe 'Dels' do
5
4
  before :each do
6
- browser.goto(WatirSpec.url_for("non_control_elements.html"))
5
+ browser.goto(WatirSpec.url_for('non_control_elements.html'))
7
6
  end
8
7
 
9
- describe "with selectors" do
10
- it "returns the matching elements" do
11
- expect(browser.dels(class: "lead").to_a).to eq [browser.del(class: "lead")]
8
+ describe 'with selectors' do
9
+ it 'returns the matching elements' do
10
+ expect(browser.dels(class: 'lead').to_a).to eq [browser.del(class: 'lead')]
12
11
  end
13
12
  end
14
13
 
15
- describe "#length" do
16
- it "returns the number of dels" do
14
+ describe '#length' do
15
+ it 'returns the number of dels' do
17
16
  expect(browser.dels.length).to eq 5
18
17
  end
19
18
  end
20
19
 
21
- describe "#[]" do
22
- it "returns the del at the given index" do
23
- expect(browser.dels[0].id).to eq "lead"
20
+ describe '#[]' do
21
+ it 'returns the del at the given index' do
22
+ expect(browser.dels[0].id).to eq 'lead'
24
23
  end
25
24
  end
26
25
 
27
- describe "#each" do
28
- it "iterates through dels correctly" do
26
+ describe '#each' do
27
+ it 'iterates through dels correctly' do
29
28
  count = 0
30
29
 
31
30
  browser.dels.each_with_index do |s, index|
@@ -36,5 +35,4 @@ describe "Dels" do
36
35
  expect(count).to be > 0
37
36
  end
38
37
  end
39
-
40
38
  end
@@ -1,40 +1,39 @@
1
- require "watirspec_helper"
2
-
3
- describe "Div" do
1
+ require 'watirspec_helper'
4
2
 
3
+ describe 'Div' do
5
4
  before :each do
6
- browser.goto(WatirSpec.url_for("non_control_elements.html"))
5
+ browser.goto(WatirSpec.url_for('non_control_elements.html'))
7
6
  end
8
7
 
9
8
  # Exists method
10
- describe "#exists?" do
11
- it "returns true if the element exists" do
12
- expect(browser.div(id: "header")).to exist
9
+ describe '#exists?' do
10
+ it 'returns true if the element exists' do
11
+ expect(browser.div(id: 'header')).to exist
13
12
  expect(browser.div(id: /header/)).to exist
14
- expect(browser.div(title: "Header and primary navigation")).to exist
13
+ expect(browser.div(title: 'Header and primary navigation')).to exist
15
14
  expect(browser.div(title: /Header and primary navigation/)).to exist
16
- expect(browser.div(text: "Not shownNot hidden")).to exist
15
+ expect(browser.div(text: 'Not shownNot hidden')).to exist
17
16
  expect(browser.div(text: /Not hidden/)).to exist
18
- expect(browser.div(class: "profile")).to exist
17
+ expect(browser.div(class: 'profile')).to exist
19
18
  expect(browser.div(class: /profile/)).to exist
20
19
  expect(browser.div(index: 0)).to exist
21
20
  expect(browser.div(xpath: "//div[@id='header']")).to exist
22
- expect(browser.div(custom_attribute: "custom")).to exist
21
+ expect(browser.div(custom_attribute: 'custom')).to exist
23
22
  expect(browser.div(custom_attribute: /custom/)).to exist
24
23
  end
25
24
 
26
- it "returns the first div if given no args" do
25
+ it 'returns the first div if given no args' do
27
26
  expect(browser.div).to exist
28
27
  end
29
28
 
30
- it "returns false if the element does not exist" do
31
- expect(browser.div(id: "no_such_id")).to_not exist
29
+ it 'returns false if the element does not exist' do
30
+ expect(browser.div(id: 'no_such_id')).to_not exist
32
31
  expect(browser.div(id: /no_such_id/)).to_not exist
33
- expect(browser.div(title: "no_such_title")).to_not exist
32
+ expect(browser.div(title: 'no_such_title')).to_not exist
34
33
  expect(browser.div(title: /no_such_title/)).to_not exist
35
- expect(browser.div(text: "no_such_text")).to_not exist
34
+ expect(browser.div(text: 'no_such_text')).to_not exist
36
35
  expect(browser.div(text: /no_such_text/)).to_not exist
37
- expect(browser.div(class: "no_such_class")).to_not exist
36
+ expect(browser.div(class: 'no_such_class')).to_not exist
38
37
  expect(browser.div(class: /no_such_class/)).to_not exist
39
38
  expect(browser.div(index: 1337)).to_not exist
40
39
  expect(browser.div(xpath: "//div[@id='no_such_id']")).to_not exist
@@ -46,98 +45,98 @@ describe "Div" do
46
45
  end
47
46
 
48
47
  # Attribute methods
49
- describe "#class_name" do
50
- it "returns the class attribute if the element exists" do
51
- expect(browser.div(id: "footer").class_name).to eq "profile"
48
+ describe '#class_name' do
49
+ it 'returns the class attribute if the element exists' do
50
+ expect(browser.div(id: 'footer').class_name).to eq 'profile'
52
51
  end
53
52
 
54
53
  it "returns an empty string if the element exists but the attribute doesn't" do
55
- expect(browser.div(id: "content").class_name).to eq ""
54
+ expect(browser.div(id: 'content').class_name).to eq ''
56
55
  end
57
56
 
58
- it "raises UnknownObjectException if the element does not exist" do
59
- expect { browser.div(id: "no_such_id").class_name }.to raise_unknown_object_exception
60
- expect { browser.div(title: "no_such_title").class_name }.to raise_unknown_object_exception
57
+ it 'raises UnknownObjectException if the element does not exist' do
58
+ expect { browser.div(id: 'no_such_id').class_name }.to raise_unknown_object_exception
59
+ expect { browser.div(title: 'no_such_title').class_name }.to raise_unknown_object_exception
61
60
  expect { browser.div(index: 1337).class_name }.to raise_unknown_object_exception
62
61
  expect { browser.div(xpath: "//div[@id='no_such_id']").class_name }.to raise_unknown_object_exception
63
62
  end
64
63
  end
65
64
 
66
- describe "#id" do
67
- it "returns the id attribute if the element exists" do
68
- expect(browser.div(index: 1).id).to eq "outer_container"
65
+ describe '#id' do
66
+ it 'returns the id attribute if the element exists' do
67
+ expect(browser.div(index: 1).id).to eq 'outer_container'
69
68
  end
70
69
 
71
70
  it "returns an empty string if the element exists, but the attribute doesn't" do
72
- expect(browser.div(index: 0).id).to eq ""
71
+ expect(browser.div(index: 0).id).to eq ''
73
72
  end
74
73
 
75
- it "raises UnknownObjectException if the element does not exist" do
76
- expect { browser.div(id: "no_such_id").id }.to raise_unknown_object_exception
77
- expect { browser.div(title: "no_such_id").id }.to raise_unknown_object_exception
74
+ it 'raises UnknownObjectException if the element does not exist' do
75
+ expect { browser.div(id: 'no_such_id').id }.to raise_unknown_object_exception
76
+ expect { browser.div(title: 'no_such_id').id }.to raise_unknown_object_exception
78
77
  expect { browser.div(index: 1337).id }.to raise_unknown_object_exception
79
78
  end
80
79
 
81
- it "should take all conditions into account when locating by id" do
82
- browser.goto WatirSpec.url_for "multiple_ids.html"
83
- expect(browser.div(id: "multiple", class: "bar").class_name).to eq "bar"
80
+ it 'should take all conditions into account when locating by id' do
81
+ browser.goto WatirSpec.url_for 'multiple_ids.html'
82
+ expect(browser.div(id: 'multiple', class: 'bar').class_name).to eq 'bar'
84
83
  end
85
84
 
86
- it "should find the id with the correct tag name" do
87
- browser.goto WatirSpec.url_for "multiple_ids.html"
88
- expect(browser.span(id: "multiple").class_name).to eq "foobar"
85
+ it 'should find the id with the correct tag name' do
86
+ browser.goto WatirSpec.url_for 'multiple_ids.html'
87
+ expect(browser.span(id: 'multiple').class_name).to eq 'foobar'
89
88
  end
90
89
  end
91
90
 
92
- describe "#style" do
91
+ describe '#style' do
93
92
  not_compliant_on :internet_explorer do
94
- it "returns the style attribute if the element exists" do
95
- expect(browser.div(id: 'best_language').style).to eq "color: red; text-decoration: underline; cursor: pointer;"
93
+ it 'returns the style attribute if the element exists' do
94
+ expect(browser.div(id: 'best_language').style).to eq 'color: red; text-decoration: underline; cursor: pointer;'
96
95
  end
97
96
  end
98
97
 
99
98
  it "returns an empty string if the element exists but the attribute doesn't" do
100
- expect(browser.div(id: 'promo').style).to eq ""
99
+ expect(browser.div(id: 'promo').style).to eq ''
101
100
  end
102
101
 
103
- it "raises UnknownObjectException if the element does not exist" do
104
- expect {browser.div(id: "no_such_id").style }.to raise_unknown_object_exception
102
+ it 'raises UnknownObjectException if the element does not exist' do
103
+ expect { browser.div(id: 'no_such_id').style }.to raise_unknown_object_exception
105
104
  end
106
105
  end
107
106
 
108
- describe "#text" do
109
- it "returns the text of the div" do
110
- expect(browser.div(id: "footer").text.strip).to eq "This is a footer."
111
- expect(browser.div(title: "Closing remarks").text.strip).to eq "This is a footer."
112
- expect(browser.div(xpath: "//div[@id='footer']").text.strip).to eq "This is a footer."
107
+ describe '#text' do
108
+ it 'returns the text of the div' do
109
+ expect(browser.div(id: 'footer').text.strip).to eq 'This is a footer.'
110
+ expect(browser.div(title: 'Closing remarks').text.strip).to eq 'This is a footer.'
111
+ expect(browser.div(xpath: "//div[@id='footer']").text.strip).to eq 'This is a footer.'
113
112
  end
114
113
 
115
- it "returns an empty string if the element exists but contains no text" do
116
- expect(browser.div(index: 0).text.strip).to eq ""
114
+ it 'returns an empty string if the element exists but contains no text' do
115
+ expect(browser.div(index: 0).text.strip).to eq ''
117
116
  end
118
117
 
119
118
  not_compliant_on :safari do
120
- it "returns an empty string if the div is hidden" do
121
- expect(browser.div(id: 'hidden').text).to eq ""
119
+ it 'returns an empty string if the div is hidden' do
120
+ expect(browser.div(id: 'hidden').text).to eq ''
122
121
  end
123
122
  end
124
123
 
125
- it "raises UnknownObjectException if the element does not exist" do
126
- expect { browser.div(id: "no_such_id").text }.to raise_unknown_object_exception
127
- expect { browser.div(title: "no_such_title").text }.to raise_unknown_object_exception
124
+ it 'raises UnknownObjectException if the element does not exist' do
125
+ expect { browser.div(id: 'no_such_id').text }.to raise_unknown_object_exception
126
+ expect { browser.div(title: 'no_such_title').text }.to raise_unknown_object_exception
128
127
  expect { browser.div(index: 1337).text }.to raise_unknown_object_exception
129
128
  expect { browser.div(xpath: "//div[@id='no_such_id']").text }.to raise_unknown_object_exception
130
129
  end
131
130
  end
132
131
 
133
- describe "custom methods" do
134
- it "returns the custom attribute if the element exists" do
135
- expect(browser.div(custom_attribute: "custom").attribute_value("custom-attribute")).to eq "custom"
132
+ describe 'custom methods' do
133
+ it 'returns the custom attribute if the element exists' do
134
+ expect(browser.div(custom_attribute: 'custom').attribute_value('custom-attribute')).to eq 'custom'
136
135
  end
137
136
  end
138
137
 
139
- describe "#respond_to?" do
140
- it "returns true for all attribute methods" do
138
+ describe '#respond_to?' do
139
+ it 'returns true for all attribute methods' do
141
140
  expect(browser.div(index: 0)).to respond_to(:class_name)
142
141
  expect(browser.div(index: 0)).to respond_to(:id)
143
142
  expect(browser.div(index: 0)).to respond_to(:style)
@@ -145,25 +144,25 @@ describe "Div" do
145
144
  end
146
145
  end
147
146
 
148
- describe "Deprecation Warnings" do
149
- describe "text locator with RegExp values" do
150
- it "does not throw deprecation when still matched by text content" do
147
+ describe 'Deprecation Warnings' do
148
+ describe 'text locator with RegExp values' do
149
+ it 'does not throw deprecation when still matched by text content' do
151
150
  expect { browser.div(text: /some visible/).exists? }.not_to have_deprecated_text_regexp
152
151
  end
153
152
 
154
153
  not_compliant_on :watigiri do
155
- it "throws deprecation when no longer matched by text content" do
154
+ it 'throws deprecation when no longer matched by text content' do
156
155
  expect { browser.div(text: /some visible$/).exists? }.to have_deprecated_text_regexp
157
156
  end
158
157
  end
159
158
 
160
159
  not_compliant_on :watigiri do
161
- it "throws deprecation when begins to be matched by text content" do
160
+ it 'throws deprecation when begins to be matched by text content' do
162
161
  expect { browser.div(text: /some hidden/).exists? }.to have_deprecated_text_regexp
163
162
  end
164
163
  end
165
164
 
166
- it "does not throw deprecation when still not matched by text content" do
165
+ it 'does not throw deprecation when still not matched by text content' do
167
166
  expect { browser.div(text: /does not exist/).exists? }.not_to have_deprecated_text_regexp
168
167
  end
169
168
  end
@@ -171,36 +170,36 @@ describe "Div" do
171
170
 
172
171
  # Manipulation methods
173
172
  not_compliant_on :headless do
174
- describe "#click" do
175
- it "fires events when clicked" do
173
+ describe '#click' do
174
+ it 'fires events when clicked' do
176
175
  expect(browser.div(id: 'best_language').text).to_not eq 'Ruby!'
177
176
  browser.div(id: 'best_language').click
178
177
  expect(browser.div(id: 'best_language').text).to eq 'Ruby!'
179
178
  end
180
179
 
181
- it "raises UnknownObjectException if the element does not exist" do
182
- expect { browser.div(id: "no_such_id").click }.to raise_unknown_object_exception
183
- expect { browser.div(title: "no_such_title").click }.to raise_unknown_object_exception
180
+ it 'raises UnknownObjectException if the element does not exist' do
181
+ expect { browser.div(id: 'no_such_id').click }.to raise_unknown_object_exception
182
+ expect { browser.div(title: 'no_such_title').click }.to raise_unknown_object_exception
184
183
  expect { browser.div(index: 1337).click }.to raise_unknown_object_exception
185
184
  expect { browser.div(xpath: "//div[@id='no_such_id']").click }.to raise_unknown_object_exception
186
185
  end
187
186
 
188
- it "includes custom message if element with a custom attribute does not exist" do
187
+ it 'includes custom message if element with a custom attribute does not exist' do
189
188
  message = /Watir treated \[\"custom_attribute\"\] as a non-HTML compliant attribute, ensure that was intended/
190
- expect { browser.div(custom_attribute: "not_there").click }.to raise_unknown_object_exception(message)
189
+ expect { browser.div(custom_attribute: 'not_there').click }.to raise_unknown_object_exception(message)
191
190
  end
192
191
  end
193
192
 
194
- describe "#click!" do
195
- it "fires events when clicked" do
193
+ describe '#click!' do
194
+ it 'fires events when clicked' do
196
195
  expect(browser.div(id: 'best_language').text).to_not eq 'Ruby!'
197
196
  browser.div(id: 'best_language').click!
198
197
  expect(browser.div(id: 'best_language').text).to eq 'Ruby!'
199
198
  end
200
199
 
201
- it "raises UnknownObjectException if the element does not exist" do
202
- expect { browser.div(id: "no_such_id").click! }.to raise_unknown_object_exception
203
- expect { browser.div(title: "no_such_title").click! }.to raise_unknown_object_exception
200
+ it 'raises UnknownObjectException if the element does not exist' do
201
+ expect { browser.div(id: 'no_such_id').click! }.to raise_unknown_object_exception
202
+ expect { browser.div(title: 'no_such_title').click! }.to raise_unknown_object_exception
204
203
  expect { browser.div(index: 1337).click! }.to raise_unknown_object_exception
205
204
  expect { browser.div(xpath: "//div[@id='no_such_id']").click! }.to raise_unknown_object_exception
206
205
  end
@@ -208,16 +207,16 @@ describe "Div" do
208
207
  end
209
208
 
210
209
  not_compliant_on :safari do
211
- bug "MoveTargetOutOfBoundsError", :firefox do
212
- describe "#double_click" do
213
- it "fires the ondblclick event" do
210
+ bug 'MoveTargetOutOfBoundsError', :firefox do
211
+ describe '#double_click' do
212
+ it 'fires the ondblclick event' do
214
213
  browser.div(id: 'html_test').double_click
215
214
  expect(messages).to include('double clicked')
216
215
  end
217
216
  end
218
217
 
219
- describe "#double_click!" do
220
- it "fires the ondblclick event" do
218
+ describe '#double_click!' do
219
+ it 'fires the ondblclick event' do
221
220
  browser.div(id: 'html_test').double_click!
222
221
  expect(messages).to include('double clicked')
223
222
  end
@@ -225,19 +224,19 @@ describe "Div" do
225
224
  end
226
225
 
227
226
  not_compliant_on :firefox do
228
- describe "#right_click" do
229
- it "fires the oncontextmenu event" do
230
- browser.goto(WatirSpec.url_for("right_click.html"))
231
- browser.div(id: "click").right_click
227
+ describe '#right_click' do
228
+ it 'fires the oncontextmenu event' do
229
+ browser.goto(WatirSpec.url_for('right_click.html'))
230
+ browser.div(id: 'click').right_click
232
231
  expect(messages.first).to eq 'right-clicked'
233
232
  end
234
233
  end
235
234
  end
236
235
  end
237
236
 
238
- describe "#html" do
237
+ describe '#html' do
239
238
  not_compliant_on :internet_explorer do
240
- it "returns the HTML of the element" do
239
+ it 'returns the HTML of the element' do
241
240
  html = browser.div(id: 'footer').html.downcase
242
241
  expect(html).to include('id="footer"')
243
242
  expect(html).to include('title="closing remarks"')
@@ -249,12 +248,11 @@ describe "Div" do
249
248
  end
250
249
 
251
250
  deviates_on :internet_explorer do
252
- it "returns the HTML of the element" do
251
+ it 'returns the HTML of the element' do
253
252
  html = browser.div(id: 'footer').html.downcase
254
253
  expect(html).to include('title="closing remarks"')
255
254
  expect(html).to_not include('</body>')
256
255
  end
257
256
  end
258
257
  end
259
-
260
258
  end