Skip to content

Commit a8038da

Browse files
committed
maybe using property for everything prevents whatever puts this test in a bad state
1 parent 0eb3cb3 commit a8038da

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

rb/spec/integration/selenium/webdriver/action_builder_spec.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ module WebDriver
4444
input = driver.find_element(css: '#working')
4545

4646
driver.action.send_keys(input, 'abcd').perform
47-
wait.until { input.attribute(:value).length == 4 }
48-
expect(input.attribute(:value)).to eq('abcd')
47+
wait.until { input.property(:value).length == 4 }
48+
expect(input.property(:value)).to eq('abcd')
4949
end
5050

5151
it 'sends keys with multiple arguments' do
@@ -55,8 +55,8 @@ module WebDriver
5555
input.click
5656

5757
driver.action.send_keys('abcd', 'dcba').perform
58-
wait.until { input.attribute(:value).length == 8 }
59-
expect(input.attribute(:value)).to eq('abcddcba')
58+
wait.until { input.property(:value).length == 8 }
59+
expect(input.property(:value)).to eq('abcddcba')
6060
end
6161

6262
it 'sends non-ASCII keys' do
@@ -66,8 +66,8 @@ module WebDriver
6666
input.click
6767

6868
driver.action.send_keys('abcd', :left, 'a').perform
69-
wait.until { input.attribute(:value).length == 5 }
70-
expect(input.attribute(:value)).to eq('abcad')
69+
wait.until { input.property(:value).length == 5 }
70+
expect(input.property(:value)).to eq('abcad')
7171
end
7272
end
7373

@@ -81,9 +81,9 @@ module WebDriver
8181
event_input.click
8282

8383
driver.action.key_down(:shift).send_keys('ab').key_up(:shift).perform
84-
wait.until { event_input.attribute(:value).length == 2 }
84+
wait.until { event_input.property(:value).length == 2 }
8585

86-
expect(event_input.attribute(:value)).to eq('AB')
86+
expect(event_input.property(:value)).to eq('AB')
8787
expected = keylogger.text.strip
8888
expect(expected).to match(/^(focus )?keydown keydown keypress keyup keydown keypress keyup keyup$/)
8989
end
@@ -131,10 +131,10 @@ module WebDriver
131131
event_input = driver.find_element(id: 'clickField')
132132

133133
driver.action.click_and_hold(event_input).perform
134-
expect(event_input.attribute(:value)).to eq('Hello')
134+
expect(event_input.property(:value)).to eq('Hello')
135135

136136
driver.action.release_actions
137-
expect(event_input.attribute(:value)).to eq('Clicked')
137+
expect(event_input.property(:value)).to eq('Clicked')
138138
end
139139
end
140140

@@ -143,14 +143,14 @@ module WebDriver
143143
driver.navigate.to url_for('javascriptPage.html')
144144
element = driver.find_element(id: 'clickField')
145145
driver.action.click(element).perform
146-
expect(element.attribute(:value)).to eq('Clicked')
146+
expect(element.property(:value)).to eq('Clicked')
147147
end
148148

149149
it 'executes with equivalent pointer methods' do
150150
driver.navigate.to url_for('javascriptPage.html')
151151
element = driver.find_element(id: 'clickField')
152152
driver.action.move_to(element).pointer_down(:left).pointer_up(:left).perform
153-
expect(element.attribute(:value)).to eq('Clicked')
153+
expect(element.property(:value)).to eq('Clicked')
154154
end
155155
end
156156

@@ -160,7 +160,7 @@ module WebDriver
160160
element = driver.find_element(id: 'doubleClickField')
161161

162162
driver.action.double_click(element).perform
163-
expect(element.attribute(:value)).to eq('DoubleClicked')
163+
expect(element.property(:value)).to eq('DoubleClicked')
164164
end
165165

166166
it 'executes with equivalent pointer methods', except: {browser: %i[safari safari_preview]} do
@@ -171,7 +171,7 @@ module WebDriver
171171
.pointer_down(:left).pointer_up(:left)
172172
.pointer_down(:left).pointer_up(:left)
173173
.perform
174-
expect(element.attribute(:value)).to eq('DoubleClicked')
174+
expect(element.property(:value)).to eq('DoubleClicked')
175175
ensure
176176
# https://issues.chromium.org/issues/400087471
177177
reset_driver! if GlobalTestEnv.browser == :chrome && GlobalTestEnv.rbe?
@@ -184,15 +184,15 @@ module WebDriver
184184
element = driver.find_element(id: 'doubleClickField')
185185

186186
driver.action.context_click(element).perform
187-
expect(element.attribute(:value)).to eq('ContextClicked')
187+
expect(element.property(:value)).to eq('ContextClicked')
188188
end
189189

190190
it 'executes with equivalent pointer methods' do
191191
driver.navigate.to url_for('javascriptPage.html')
192192
element = driver.find_element(id: 'doubleClickField')
193193

194194
driver.action.move_to(element).pointer_down(:right).pointer_up(:right).perform
195-
expect(element.attribute(:value)).to eq('ContextClicked')
195+
expect(element.property(:value)).to eq('ContextClicked')
196196
end
197197
end
198198

@@ -202,7 +202,7 @@ module WebDriver
202202
element = driver.find_element(id: 'clickField')
203203
driver.action.move_to(element).click.perform
204204

205-
expect(element.attribute(:value)).to eq('Clicked')
205+
expect(element.property(:value)).to eq('Clicked')
206206
end
207207

208208
it 'moves to element with offset' do
@@ -215,7 +215,7 @@ module WebDriver
215215
y_offset = (destination_rect.y - origin_rect.y).ceil
216216

217217
driver.action.move_to(origin, x_offset, y_offset).click.perform
218-
expect(destination.attribute(:value)).to eq('Clicked')
218+
expect(destination.property(:value)).to eq('Clicked')
219219
end
220220
end
221221

@@ -259,7 +259,7 @@ module WebDriver
259259
rect = element.rect
260260
driver.action.move_to_location(rect.x.ceil, rect.y.ceil).click.perform
261261

262-
expect(element.attribute(:value)).to eq('Clicked')
262+
expect(element.property(:value)).to eq('Clicked')
263263
end
264264
end
265265

0 commit comments

Comments
 (0)