watir 7.0.0.beta1 → 7.0.0.beta5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/tests.yml +7 -3
  3. data/.rubocop.yml +2 -7
  4. data/CHANGES.md +32 -0
  5. data/lib/watir/browser.rb +21 -7
  6. data/lib/watir/capabilities.rb +52 -7
  7. data/lib/watir/elements/date_field.rb +4 -1
  8. data/lib/watir/elements/date_time_field.rb +4 -1
  9. data/lib/watir/elements/element.rb +32 -3
  10. data/lib/watir/elements/font.rb +1 -0
  11. data/lib/watir/elements/iframe.rb +0 -1
  12. data/lib/watir/elements/radio.rb +2 -2
  13. data/lib/watir/elements/select.rb +63 -40
  14. data/lib/watir/has_window.rb +2 -0
  15. data/lib/watir/locators.rb +4 -0
  16. data/lib/watir/locators/element/matcher.rb +1 -1
  17. data/lib/watir/locators/element/selector_builder.rb +0 -3
  18. data/lib/watir/locators/element/selector_builder/xpath.rb +2 -1
  19. data/lib/watir/locators/option/matcher.rb +24 -0
  20. data/lib/watir/locators/option/selector_builder.rb +8 -0
  21. data/lib/watir/locators/option/selector_builder/xpath.rb +37 -0
  22. data/lib/watir/logger.rb +3 -74
  23. data/lib/watir/radio_set.rb +1 -0
  24. data/lib/watir/screenshot.rb +2 -8
  25. data/lib/watir/user_editable.rb +10 -3
  26. data/lib/watir/version.rb +1 -1
  27. data/lib/watir/window.rb +15 -4
  28. data/lib/watir/window_collection.rb +9 -0
  29. data/lib/watirspec.rb +4 -2
  30. data/lib/watirspec/guards.rb +1 -1
  31. data/lib/watirspec/remote_server.rb +2 -6
  32. data/lib/watirspec/server.rb +1 -1
  33. data/spec/spec_helper.rb +0 -10
  34. data/spec/unit/capabilities_spec.rb +198 -48
  35. data/spec/unit/match_elements/element_spec.rb +11 -0
  36. data/spec/watirspec/after_hooks_spec.rb +22 -45
  37. data/spec/watirspec/browser_spec.rb +185 -206
  38. data/spec/watirspec/cookies_spec.rb +47 -52
  39. data/spec/watirspec/drag_and_drop_spec.rb +5 -7
  40. data/spec/watirspec/elements/area_spec.rb +1 -5
  41. data/spec/watirspec/elements/button_spec.rb +4 -8
  42. data/spec/watirspec/elements/checkbox_spec.rb +2 -4
  43. data/spec/watirspec/elements/date_field_spec.rb +13 -16
  44. data/spec/watirspec/elements/date_time_field_spec.rb +14 -13
  45. data/spec/watirspec/elements/dd_spec.rb +3 -4
  46. data/spec/watirspec/elements/del_spec.rb +10 -12
  47. data/spec/watirspec/elements/div_spec.rb +41 -50
  48. data/spec/watirspec/elements/dl_spec.rb +4 -12
  49. data/spec/watirspec/elements/element_spec.rb +155 -89
  50. data/spec/watirspec/elements/elements_spec.rb +8 -9
  51. data/spec/watirspec/elements/filefield_spec.rb +5 -7
  52. data/spec/watirspec/elements/form_spec.rb +1 -1
  53. data/spec/watirspec/elements/forms_spec.rb +3 -5
  54. data/spec/watirspec/elements/frame_spec.rb +17 -22
  55. data/spec/watirspec/elements/iframe_spec.rb +21 -27
  56. data/spec/watirspec/elements/ins_spec.rb +10 -12
  57. data/spec/watirspec/elements/link_spec.rb +24 -26
  58. data/spec/watirspec/elements/links_spec.rb +8 -9
  59. data/spec/watirspec/elements/radio_spec.rb +11 -14
  60. data/spec/watirspec/elements/select_list_spec.rb +248 -117
  61. data/spec/watirspec/elements/span_spec.rb +10 -12
  62. data/spec/watirspec/elements/table_nesting_spec.rb +31 -34
  63. data/spec/watirspec/elements/table_spec.rb +11 -13
  64. data/spec/watirspec/elements/tbody_spec.rb +10 -12
  65. data/spec/watirspec/elements/td_spec.rb +4 -6
  66. data/spec/watirspec/elements/text_field_spec.rb +10 -12
  67. data/spec/watirspec/elements/tr_spec.rb +5 -7
  68. data/spec/watirspec/support/rspec_matchers.rb +1 -1
  69. data/spec/watirspec/user_editable_spec.rb +26 -28
  70. data/spec/watirspec/wait_spec.rb +255 -258
  71. data/spec/watirspec/window_switching_spec.rb +199 -200
  72. data/spec/watirspec_helper.rb +34 -31
  73. data/watir.gemspec +1 -1
  74. metadata +7 -8
  75. data/spec/implementation_spec.rb +0 -24
  76. data/spec/unit/logger_spec.rb +0 -81
@@ -4,7 +4,7 @@ describe 'Browser#cookies' do
4
4
  after { browser.cookies.clear }
5
5
 
6
6
  it 'gets an empty list of cookies' do
7
- browser.goto WatirSpec.url_for 'collections.html' # no cookie set.
7
+ browser.goto WatirSpec.url_for 'index.html'
8
8
  expect(browser.cookies.to_a).to eq []
9
9
  end
10
10
 
@@ -41,94 +41,89 @@ describe 'Browser#cookies' do
41
41
  end
42
42
  end
43
43
 
44
- not_compliant_on :internet_explorer do
45
- it 'adds a cookie without options' do
46
- browser.goto set_cookie_url
47
- verify_cookies_count 1
44
+ it 'adds a cookie without options' do
45
+ browser.goto WatirSpec.url_for 'index.html'
46
+ verify_cookies_count 0
48
47
 
49
- browser.cookies.add 'foo', 'bar'
50
- verify_cookies_count 2
51
- end
48
+ browser.cookies.add 'foo', 'bar'
49
+ verify_cookies_count 1
50
+ end
52
51
 
53
- it 'adds a cookie with a string expires value' do
54
- browser.goto set_cookie_url
55
- verify_cookies_count 1
52
+ it 'adds a cookie with a string expires value' do
53
+ browser.goto WatirSpec.url_for 'index.html'
56
54
 
57
- expire_time = Time.now + 10_000
55
+ expire_time = Time.now + 10_000
58
56
 
59
- browser.cookies.add 'foo', 'bar', expires: expire_time.to_s
57
+ browser.cookies.add 'foo', 'bar', expires: expire_time.to_s
60
58
 
61
- cookie = browser.cookies[:foo]
62
- expect(cookie[:expires]).to be_kind_of(Time)
63
- end
59
+ cookie = browser.cookies[:foo]
60
+ expect(cookie[:expires]).to be_kind_of(Time)
64
61
  end
65
62
 
66
- it 'adds a cookie with path' do
67
- browser.goto set_cookie_url
63
+ it 'adds a cookie with path',
64
+ except: {browser: :ie, reason: 'path contains two slashes'} do
65
+ browser.goto WatirSpec.url_for 'index.html'
68
66
 
69
67
  options = {path: '/set_cookie'}
70
-
71
68
  browser.cookies.add 'path', 'b', options
69
+
70
+ expect(browser.cookies.to_a).to be_empty
71
+
72
+ browser.goto set_cookie_url
72
73
  cookie = browser.cookies.to_a.find { |e| e[:name] == 'path' }
73
74
 
74
- expect(cookie).to_not be_nil
75
75
  expect(cookie[:name]).to eq 'path'
76
76
  expect(cookie[:value]).to eq 'b'
77
77
  expect(cookie[:path]).to eq '/set_cookie'
78
78
  end
79
79
 
80
80
  it 'adds a cookie with expiration' do
81
- browser.goto set_cookie_url
81
+ browser.goto WatirSpec.url_for 'index.html'
82
82
 
83
83
  expires = Time.now + 10_000
84
84
  options = {expires: expires}
85
85
 
86
86
  browser.cookies.add 'expiration', 'b', options
87
- cookie = browser.cookies.to_a.find { |e| e[:name] == 'expiration' }
87
+ cookie = browser.cookies.to_a.first
88
88
 
89
- expect(cookie).to_not be_nil
90
89
  expect(cookie[:name]).to eq 'expiration'
91
90
  expect(cookie[:value]).to eq 'b'
92
- # a few ms slack
91
+
93
92
  expect((cookie[:expires]).to_i).to be_within(2).of(expires.to_i)
94
93
  end
95
94
 
96
- bug 'https://bugs.chromium.org/p/chromedriver/issues/detail?id=2727', :chrome, :safari, :edge do
97
- it 'adds a cookie with security' do
98
- browser.goto set_cookie_url
99
-
100
- options = {secure: true}
95
+ # Pending resolution of https://github.com/w3c/webdriver/issues/1571
96
+ it 'adding cookie with security does not raise exception but can not be retrieved',
97
+ except: [{browser: :firefox,
98
+ reason: 'https://github.com/mozilla/geckodriver/issues/1840'},
99
+ {browser: %i[chrome edge], platform: :windows}] do
100
+ browser.goto WatirSpec.url_for 'index.html'
101
101
 
102
- browser.cookies.add 'secure', 'b', options
103
- cookie = browser.cookies.to_a.find { |e| e[:name] == 'secure' }
104
- expect(cookie).to_not be_nil
102
+ options = {secure: true}
105
103
 
106
- expect(cookie[:name]).to eq 'secure'
107
- expect(cookie[:value]).to eq 'b'
108
- expect(cookie[:secure]).to be true
109
- end
104
+ browser.cookies.add 'secure', 'b', options
105
+ cookie = browser.cookies.to_a.find { |e| e[:name] == 'secure' }
106
+ expect(cookie).to be_nil
110
107
  end
111
108
 
112
- not_compliant_on :internet_explorer do
113
- it 'removes a cookie' do
114
- browser.goto set_cookie_url
115
- verify_cookies_count 1
109
+ it 'removes a cookie' do
110
+ browser.goto set_cookie_url
111
+ verify_cookies_count 1
116
112
 
117
- browser.cookies.delete 'monster'
118
- verify_cookies_count 0
119
- end
113
+ browser.cookies.delete 'monster'
114
+ verify_cookies_count 0
115
+ end
120
116
 
121
- it 'clears all cookies' do
122
- browser.goto set_cookie_url
123
- browser.cookies.add 'foo', 'bar'
124
- verify_cookies_count 2
117
+ it 'clears all cookies' do
118
+ browser.goto set_cookie_url
119
+ browser.cookies.add 'foo', 'bar'
120
+ verify_cookies_count 2
125
121
 
126
- browser.cookies.clear
127
- verify_cookies_count 0
128
- end
122
+ browser.cookies.clear
123
+ verify_cookies_count 0
129
124
  end
130
125
 
131
- not_compliant_on :internet_explorer do
126
+ context 'cookie file' do
132
127
  let(:file) { "#{Dir.tmpdir}/cookies" }
133
128
 
134
129
  before do
@@ -142,7 +137,7 @@ describe 'Browser#cookies' do
142
137
  end
143
138
  end
144
139
 
145
- describe '#load' do
140
+ describe '#load', except: {browser: :ie} do
146
141
  it 'loads cookies from file' do
147
142
  browser.cookies.clear
148
143
  browser.cookies.load file
@@ -1,7 +1,7 @@
1
1
  require 'watirspec_helper'
2
2
 
3
3
  describe 'Element' do
4
- context 'drag and drop' do
4
+ context 'drag and drop', except: {browser: :ie} do
5
5
  before { browser.goto WatirSpec.url_for('drag_and_drop.html') }
6
6
 
7
7
  let(:draggable) { browser.div id: 'draggable' }
@@ -13,12 +13,10 @@ describe 'Element' do
13
13
  expect(droppable.text).to include 'Dropped!'
14
14
  end
15
15
 
16
- bug 'Element is getting moved to the wrong spot', :w3c do
17
- it 'can drag an element by the given offset' do
18
- expect(droppable.text).to include 'Drop here'
19
- draggable.drag_and_drop_by 200, 50
20
- expect(droppable.text).to include 'Dropped!'
21
- end
16
+ it 'can drag an element by the given offset' do
17
+ expect(droppable.text).to include 'Drop here'
18
+ draggable.drag_and_drop_by 200, 50
19
+ expect(droppable.text).to include 'Dropped!'
22
20
  end
23
21
  end
24
22
  end
@@ -12,11 +12,7 @@ describe 'Area' do
12
12
  expect(browser.area(id: /NCE/)).to exist
13
13
  expect(browser.area(title: 'Tables')).to exist
14
14
  expect(browser.area(title: /Tables/)).to exist
15
-
16
- not_compliant_on :internet_explorer do
17
- expect(browser.area(href: 'tables.html')).to exist
18
- end
19
-
15
+ expect(browser.area(href: 'tables.html')).to exist
20
16
  expect(browser.area(href: /tables/)).to exist
21
17
 
22
18
  expect(browser.area(index: 0)).to exist
@@ -14,9 +14,7 @@ describe 'Button' do
14
14
  expect(browser.button(name: /new_user_reset/)).to exist
15
15
  expect(browser.button(value: 'Button')).to exist
16
16
  expect(browser.button(value: /Button/)).to exist
17
- not_compliant_on :internet_explorer do
18
- expect(browser.button(src: 'images/button.png')).to exist
19
- end
17
+ expect(browser.button(src: 'images/button.png')).to exist
20
18
  expect(browser.button(src: /button\.png/)).to exist
21
19
  expect(browser.button(text: 'Button 2')).to exist
22
20
  expect(browser.button(text: /Button 2/)).to exist
@@ -127,10 +125,8 @@ describe 'Button' do
127
125
  end
128
126
 
129
127
  describe '#style' do
130
- not_compliant_on :internet_explorer do
131
- it 'returns the style attribute if the button exists' do
132
- expect(browser.button(id: 'delete_user_submit').style).to eq 'border: 4px solid red;'
133
- end
128
+ it 'returns the style attribute if the button exists' do
129
+ expect(browser.button(id: 'delete_user_submit').style).to include 'border: 4px solid red;'
134
130
  end
135
131
 
136
132
  it "returns an empty string if the element exists and the attribute doesn't exist" do
@@ -244,7 +240,7 @@ describe 'Button' do
244
240
  it 'clicks the button if it exists' do
245
241
  browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
246
242
  browser.button(id: 'delete_user_submit').click
247
- Watir::Wait.until { !browser.url.include? 'forms_with_input_elements.html' }
243
+ browser.wait_while(url: /forms_with_input_elements\.html$/)
248
244
  expect(browser.text).to include('Semantic table')
249
245
  end
250
246
 
@@ -34,10 +34,8 @@ describe 'CheckBox' do
34
34
  expect(browser.checkbox(label: /this will not match/)).to_not exist
35
35
  end
36
36
 
37
- bug 'Safari is not filtering out hidden text', :safari do
38
- it 'handles text_regexp deprecation in spite of hidden text' do
39
- expect(browser.checkbox(label: /some visible some hidden/)).to exist
40
- end
37
+ it 'handles text_regexp deprecation in spite of hidden text' do
38
+ expect(browser.checkbox(label: /some visible some hidden/)).to exist
41
39
  end
42
40
 
43
41
  it 'returns true if the checkbox button exists (search by name and value)' do
@@ -19,20 +19,18 @@ describe 'DateField' do
19
19
  expect(browser.date_field(label: /Date$/)).to exist
20
20
  end
21
21
 
22
- bug 'Safari does not recognize date type', :safari do
23
- it 'returns true when using xpath' do
24
- expect(browser.date_field(xpath: "//input[@id='html5_date']")).to exist
25
- end
22
+ it 'returns true when using xpath',
23
+ except: {browser: :ie, reason: 'Date type not recognized'} do
24
+ expect(browser.date_field(xpath: "//input[@id='html5_date']")).to exist
26
25
  end
27
26
 
28
27
  it 'returns the date field if given no args' do
29
28
  expect(browser.date_field).to exist
30
29
  end
31
30
 
32
- bug 'Safari does not recognize date type', :safari do
33
- it 'respects date fields types' do
34
- expect(browser.date_field.type).to eq('date')
35
- end
31
+ it 'respects date fields types',
32
+ except: {browser: :ie, reason: 'Date type not recognized'} do
33
+ expect(browser.date_field.type).to eq('date')
36
34
  end
37
35
 
38
36
  it 'returns false if the element does not exist' do
@@ -78,15 +76,14 @@ describe 'DateField' do
78
76
  end
79
77
  end
80
78
 
81
- bug 'Safari does not recognize date type', :safari do
82
- describe '#type' do
83
- it 'returns the type attribute if the date field exists' do
84
- expect(browser.date_field(id: 'html5_date').type).to eq 'date'
85
- end
79
+ describe '#type' do
80
+ it 'returns the type attribute if the date field exists',
81
+ except: {browser: :ie, reason: 'Date type not recognized'} do
82
+ expect(browser.date_field(id: 'html5_date').type).to eq 'date'
83
+ end
86
84
 
87
- it "raises UnknownObjectException if the date field doesn't exist" do
88
- expect { browser.date_field(index: 1337).type }.to raise_unknown_object_exception
89
- end
85
+ it "raises UnknownObjectException if the date field doesn't exist" do
86
+ expect { browser.date_field(index: 1337).type }.to raise_unknown_object_exception
90
87
  end
91
88
  end
92
89
 
@@ -15,23 +15,24 @@ describe 'DateTimeField' do
15
15
  expect(browser.date_time_field(text: '')).to exist
16
16
  expect(browser.date_time_field(text: //)).to exist
17
17
  expect(browser.date_time_field(index: 0)).to exist
18
-
19
- bug 'https://github.com/mozilla/geckodriver/issues/1469', :firefox, :safari do
20
- expect(browser.date_time_field(xpath: "//input[@id='html5_datetime-local']")).to exist
21
- end
22
-
23
18
  expect(browser.date_time_field(label: 'HTML5 Datetime Local')).to exist
24
19
  expect(browser.date_time_field(label: /Local$/)).to exist
25
20
  end
26
21
 
22
+ it 'returns true if the datetime-local element exists',
23
+ except: [{browser: :firefox, reason: 'https://github.com/mozilla/geckodriver/issues/1469'},
24
+ {browser: :ie, reason: 'Date type not recognized'}] do
25
+ expect(browser.date_time_field(xpath: "//input[@id='html5_datetime-local']")).to exist
26
+ end
27
+
27
28
  it 'returns the date-time field if given no args' do
28
29
  expect(browser.date_time_field).to exist
29
30
  end
30
31
 
31
- bug 'https://github.com/mozilla/geckodriver/issues/1469', :firefox, :safari do
32
- it 'respects date-time fields types' do
33
- expect(browser.date_time_field.type).to eq('datetime-local')
34
- end
32
+ it 'respects date-time fields types',
33
+ except: [{browser: :firefox, reason: 'https://github.com/mozilla/geckodriver/issues/1469'},
34
+ {browser: :ie, reason: 'Date type not recognized'}] do
35
+ expect(browser.date_time_field.type).to eq('datetime-local')
35
36
  end
36
37
 
37
38
  it 'returns false if the element does not exist' do
@@ -78,10 +79,10 @@ describe 'DateTimeField' do
78
79
  end
79
80
 
80
81
  describe '#type' do
81
- bug 'https://github.com/mozilla/geckodriver/issues/1469', :firefox, :safari do
82
- it 'returns the type attribute if the date-time field exists' do
83
- expect(browser.date_time_field(id: 'html5_datetime-local').type).to eq 'datetime-local'
84
- end
82
+ it 'returns the type attribute if the date-time field exists',
83
+ except: [{browser: :firefox, reason: 'https://github.com/mozilla/geckodriver/issues/1469'},
84
+ {browser: :ie, reason: 'Date type not recognized'}] do
85
+ expect(browser.date_time_field(id: 'html5_datetime-local').type).to eq 'datetime-local'
85
86
  end
86
87
 
87
88
  it "raises UnknownObjectException if the date-time field doesn't exist" do
@@ -55,10 +55,9 @@ describe 'Dd' do
55
55
  expect(browser.dd(id: 'someone').text).to eq 'John Doe'
56
56
  end
57
57
 
58
- bug 'Safari does not strip text', :safari do
59
- it 'returns an empty string if the element exists but contains no text' do
60
- expect(browser.dd(class: 'noop').text).to eq ''
61
- end
58
+ it 'returns an empty string if the element exists but contains no text',
59
+ except: {browser: :safari, reason: 'Safari does not strip text'} do
60
+ expect(browser.dd(class: 'noop').text).to eq ''
62
61
  end
63
62
 
64
63
  it 'raises UnknownObjectException if the element does not exist' do
@@ -94,18 +94,16 @@ describe 'Del' do
94
94
  end
95
95
 
96
96
  # Other
97
- not_compliant_on :headless do
98
- describe '#click' do
99
- it 'fires events' do
100
- expect(browser.del(class: 'footer').text).to_not include('Javascript')
101
- browser.del(class: 'footer').click
102
- expect(browser.del(class: 'footer').text).to include('Javascript')
103
- end
104
-
105
- it "raises UnknownObjectException if the del doesn't exist" do
106
- expect { browser.del(id: 'no_such_id').click }.to raise_unknown_object_exception
107
- expect { browser.del(title: 'no_such_title').click }.to raise_unknown_object_exception
108
- end
97
+ describe '#click', except: {headless: true} do
98
+ it 'fires events' do
99
+ expect(browser.del(class: 'footer').text).to_not include('Javascript')
100
+ browser.del(class: 'footer').click
101
+ expect(browser.del(class: 'footer').text).to include('Javascript')
102
+ end
103
+
104
+ it "raises UnknownObjectException if the del doesn't exist" do
105
+ expect { browser.del(id: 'no_such_id').click }.to raise_unknown_object_exception
106
+ expect { browser.del(title: 'no_such_title').click }.to raise_unknown_object_exception
109
107
  end
110
108
  end
111
109
  end
@@ -75,10 +75,8 @@ describe 'Div' do
75
75
  end
76
76
 
77
77
  describe '#style' do
78
- not_compliant_on :internet_explorer do
79
- it 'returns the style attribute if the element exists' do
80
- expect(browser.div(id: 'best_language').style).to eq 'color: red; text-decoration: underline; cursor: pointer;'
81
- end
78
+ it 'returns the style attribute if the element exists' do
79
+ expect(browser.div(id: 'best_language').style).to eq 'color: red; text-decoration: underline; cursor: pointer;'
82
80
  end
83
81
 
84
82
  it "returns an empty string if the element exists but the attribute doesn't" do
@@ -101,10 +99,9 @@ describe 'Div' do
101
99
  expect(browser.div(index: 0).text.strip).to eq ''
102
100
  end
103
101
 
104
- bug 'Safari is not filtering out hidden text', :safari do
105
- it 'returns an empty string if the div is hidden' do
106
- expect(browser.div(id: 'hidden').text).to eq ''
107
- end
102
+ it 'returns an empty string if the div is hidden',
103
+ except: {browser: :safari, reason: 'Safari is not filtering out hidden text'} do
104
+ expect(browser.div(id: 'hidden').text).to eq ''
108
105
  end
109
106
 
110
107
  it 'raises UnknownObjectException if the element does not exist' do
@@ -169,57 +166,51 @@ describe 'Div' do
169
166
  end
170
167
  end
171
168
 
172
- bug 'command correctly received, but action not taken', :safari, :w3c do
173
- describe '#double_click' do
174
- it 'fires the ondblclick event' do
175
- div = browser.div(id: 'html_test')
176
- div.scroll.to
177
- div.double_click
178
- expect(messages).to include('double clicked')
179
- end
169
+ describe '#double_click',
170
+ except: {browser: :safari, reason: 'command correctly received, but action not taken'} do
171
+ it 'fires the ondblclick event' do
172
+ div = browser.div(id: 'html_test')
173
+ div.scroll.to
174
+ div.double_click
175
+ expect(messages).to include('double clicked')
176
+ end
177
+ end
178
+
179
+ describe '#double_click!' do
180
+ it 'fires the ondblclick event' do
181
+ browser.div(id: 'html_test').double_click!
182
+ expect(messages).to include('double clicked')
180
183
  end
184
+ end
181
185
 
182
- describe '#double_click!' do
183
- it 'fires the ondblclick event' do
184
- browser.div(id: 'html_test').double_click!
185
- expect(messages).to include('double clicked')
186
- end
186
+ describe '#right_click' do
187
+ it 'fires the oncontextmenu event' do
188
+ browser.goto(WatirSpec.url_for('right_click.html'))
189
+ browser.div(id: 'click').right_click
190
+ expect(messages.first).to eq 'right-clicked'
187
191
  end
188
192
 
189
- describe '#right_click' do
190
- it 'fires the oncontextmenu event' do
191
- browser.goto(WatirSpec.url_for('right_click.html'))
192
- browser.div(id: 'click').right_click
193
- expect(messages.first).to eq 'right-clicked'
194
- end
193
+ it 'accepts modifiers', except: {browser: :ie} do
194
+ browser.goto(WatirSpec.url_for('right_click.html'))
195
+ browser.div(id: 'click-logger').right_click(:control, :alt)
196
+ expect(event_log.first).to eq('control=true alt=true')
197
+ end
195
198
 
196
- it 'accepts modifiers' do
197
- browser.goto(WatirSpec.url_for('right_click.html'))
198
- browser.div(id: 'click-logger').right_click(:control, :alt)
199
- expect(event_log.first).to eq('control=true alt=true')
200
- end
199
+ it 'scrolls' do
200
+ browser.del(class: 'footer').double_click
201
+ puts 'yes?'
201
202
  end
202
203
  end
203
204
 
204
205
  describe '#html' do
205
- not_compliant_on :internet_explorer do
206
- it 'returns the HTML of the element' do
207
- html = browser.div(id: 'footer').html.downcase
208
- expect(html).to include('id="footer"')
209
- expect(html).to include('title="closing remarks"')
210
- expect(html).to include('class="profile"')
211
-
212
- expect(html).to_not include('<div id="content">')
213
- expect(html).to_not include('</body>')
214
- end
215
- end
216
-
217
- deviates_on :internet_explorer do
218
- it 'returns the HTML of the element' do
219
- html = browser.div(id: 'footer').html.downcase
220
- expect(html).to include('title="closing remarks"')
221
- expect(html).to_not include('</body>')
222
- end
206
+ it 'returns the HTML of the element' do
207
+ html = browser.div(id: 'footer').html.downcase
208
+ expect(html).to include('id="footer"')
209
+ expect(html).to include('title="closing remarks"')
210
+ expect(html).to include('class="profile"')
211
+
212
+ expect(html).to_not include('<div id="content">')
213
+ expect(html).to_not include('</body>')
223
214
  end
224
215
  end
225
216
  end