watir 7.0.0.beta1 → 7.0.0.beta5
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 +4 -4
- data/.github/workflows/tests.yml +7 -3
- data/.rubocop.yml +2 -7
- data/CHANGES.md +32 -0
- data/lib/watir/browser.rb +21 -7
- data/lib/watir/capabilities.rb +52 -7
- data/lib/watir/elements/date_field.rb +4 -1
- data/lib/watir/elements/date_time_field.rb +4 -1
- data/lib/watir/elements/element.rb +32 -3
- data/lib/watir/elements/font.rb +1 -0
- data/lib/watir/elements/iframe.rb +0 -1
- data/lib/watir/elements/radio.rb +2 -2
- data/lib/watir/elements/select.rb +63 -40
- data/lib/watir/has_window.rb +2 -0
- data/lib/watir/locators.rb +4 -0
- data/lib/watir/locators/element/matcher.rb +1 -1
- data/lib/watir/locators/element/selector_builder.rb +0 -3
- data/lib/watir/locators/element/selector_builder/xpath.rb +2 -1
- data/lib/watir/locators/option/matcher.rb +24 -0
- data/lib/watir/locators/option/selector_builder.rb +8 -0
- data/lib/watir/locators/option/selector_builder/xpath.rb +37 -0
- data/lib/watir/logger.rb +3 -74
- data/lib/watir/radio_set.rb +1 -0
- data/lib/watir/screenshot.rb +2 -8
- data/lib/watir/user_editable.rb +10 -3
- data/lib/watir/version.rb +1 -1
- data/lib/watir/window.rb +15 -4
- data/lib/watir/window_collection.rb +9 -0
- data/lib/watirspec.rb +4 -2
- data/lib/watirspec/guards.rb +1 -1
- data/lib/watirspec/remote_server.rb +2 -6
- data/lib/watirspec/server.rb +1 -1
- data/spec/spec_helper.rb +0 -10
- data/spec/unit/capabilities_spec.rb +198 -48
- data/spec/unit/match_elements/element_spec.rb +11 -0
- data/spec/watirspec/after_hooks_spec.rb +22 -45
- data/spec/watirspec/browser_spec.rb +185 -206
- data/spec/watirspec/cookies_spec.rb +47 -52
- data/spec/watirspec/drag_and_drop_spec.rb +5 -7
- data/spec/watirspec/elements/area_spec.rb +1 -5
- data/spec/watirspec/elements/button_spec.rb +4 -8
- data/spec/watirspec/elements/checkbox_spec.rb +2 -4
- data/spec/watirspec/elements/date_field_spec.rb +13 -16
- data/spec/watirspec/elements/date_time_field_spec.rb +14 -13
- data/spec/watirspec/elements/dd_spec.rb +3 -4
- data/spec/watirspec/elements/del_spec.rb +10 -12
- data/spec/watirspec/elements/div_spec.rb +41 -50
- data/spec/watirspec/elements/dl_spec.rb +4 -12
- data/spec/watirspec/elements/element_spec.rb +155 -89
- data/spec/watirspec/elements/elements_spec.rb +8 -9
- data/spec/watirspec/elements/filefield_spec.rb +5 -7
- data/spec/watirspec/elements/form_spec.rb +1 -1
- data/spec/watirspec/elements/forms_spec.rb +3 -5
- data/spec/watirspec/elements/frame_spec.rb +17 -22
- data/spec/watirspec/elements/iframe_spec.rb +21 -27
- data/spec/watirspec/elements/ins_spec.rb +10 -12
- data/spec/watirspec/elements/link_spec.rb +24 -26
- data/spec/watirspec/elements/links_spec.rb +8 -9
- data/spec/watirspec/elements/radio_spec.rb +11 -14
- data/spec/watirspec/elements/select_list_spec.rb +248 -117
- data/spec/watirspec/elements/span_spec.rb +10 -12
- data/spec/watirspec/elements/table_nesting_spec.rb +31 -34
- data/spec/watirspec/elements/table_spec.rb +11 -13
- data/spec/watirspec/elements/tbody_spec.rb +10 -12
- data/spec/watirspec/elements/td_spec.rb +4 -6
- data/spec/watirspec/elements/text_field_spec.rb +10 -12
- data/spec/watirspec/elements/tr_spec.rb +5 -7
- data/spec/watirspec/support/rspec_matchers.rb +1 -1
- data/spec/watirspec/user_editable_spec.rb +26 -28
- data/spec/watirspec/wait_spec.rb +255 -258
- data/spec/watirspec/window_switching_spec.rb +199 -200
- data/spec/watirspec_helper.rb +34 -31
- data/watir.gemspec +1 -1
- metadata +7 -8
- data/spec/implementation_spec.rb +0 -24
- 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 '
|
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
|
-
|
45
|
-
|
46
|
-
|
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
|
-
|
50
|
-
|
51
|
-
|
48
|
+
browser.cookies.add 'foo', 'bar'
|
49
|
+
verify_cookies_count 1
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
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
|
-
|
55
|
+
expire_time = Time.now + 10_000
|
58
56
|
|
59
|
-
|
57
|
+
browser.cookies.add 'foo', 'bar', expires: expire_time.to_s
|
60
58
|
|
61
|
-
|
62
|
-
|
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'
|
67
|
-
|
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
|
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.
|
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
|
-
|
91
|
+
|
93
92
|
expect((cookie[:expires]).to_i).to be_within(2).of(expires.to_i)
|
94
93
|
end
|
95
94
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
-
|
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
|
-
|
107
|
-
|
108
|
-
|
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
|
-
|
113
|
-
|
114
|
-
|
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
|
-
|
118
|
-
|
119
|
-
|
113
|
+
browser.cookies.delete 'monster'
|
114
|
+
verify_cookies_count 0
|
115
|
+
end
|
120
116
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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
|
-
|
127
|
-
|
128
|
-
end
|
122
|
+
browser.cookies.clear
|
123
|
+
verify_cookies_count 0
|
129
124
|
end
|
130
125
|
|
131
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
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
|
-
|
131
|
-
|
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
|
-
|
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
|
-
|
38
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
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
|
-
|
88
|
-
|
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
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
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
|
-
|
59
|
-
|
60
|
-
|
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
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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
|
-
|
79
|
-
|
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
|
-
|
105
|
-
|
106
|
-
|
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
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
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
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
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
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
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
|
-
|
197
|
-
|
198
|
-
|
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
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
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
|