Skip to content

Commit 78c3a21

Browse files
committed
[rb] fix tests and guards
1 parent 709611e commit 78c3a21

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ module WebDriver
321321

322322
describe '#scroll_by' do
323323
it 'scrolls by given amount',
324-
exclude: {driver: :firefox, reason: 'inconsistent behavior between versions'} do
324+
exclude: {browser: :firefox, reason: 'inconsistent behavior between versions'} do
325325
driver.navigate.to url_for('scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html')
326326
footer = driver.find_element(tag_name: 'footer')
327327
delta_y = footer.rect.y.round

rb/spec/integration/selenium/webdriver/devtools_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
module Selenium
2323
module WebDriver
24-
describe DevTools, exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'},
25-
{browser: %i[chrome edge]}] do
24+
describe DevTools, exclusive: {browser: %i[chrome edge]} do
2625
after { |example| reset_driver!(example: example) }
2726

2827
it 'sends commands' do
-1.26 KB
Binary file not shown.

rb/spec/integration/selenium/webdriver/remote/driver_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ module Remote
4242
wait.until { driver.find_element(id: 'upload_label').displayed? }
4343

4444
driver.switch_to.frame('upload_target')
45-
wait.until { driver.find_element(xpath: '//body') }
45+
wait(ignore: [Error::NoSuchElementError, Error::StaleElementReferenceError]).until do
46+
!driver.find_element(xpath: '//body').text.empty?
47+
end
4648

4749
body = driver.find_element(xpath: '//body')
4850
expect(body.text.scan('This is a dummy test file').count).to eq(1)
@@ -83,8 +85,7 @@ module Remote
8385
end
8486
end
8587

86-
it 'errors when not set', {except: {browser: :firefox, reason: 'grid always sets true and firefox returns it'},
87-
exclude: {browser: :safari, reason: 'grid hangs'}} do
88+
it 'errors when not set', {exclude: {browser: :safari, reason: 'grid hangs'}} do
8889
reset_driver!(enable_downloads: false) do |driver|
8990
expect {
9091
driver.downloadable_files

rb/spec/integration/selenium/webdriver/spec_support/helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def wait_for_new_url(old_url)
9797
end
9898
end
9999

100-
def wait(timeout = 10)
101-
Wait.new(timeout: timeout)
100+
def wait(timeout = 10, **opts)
101+
Wait.new(timeout: timeout, **opts)
102102
end
103103

104104
def png_size(path)

rb/spec/integration/selenium/webdriver/spec_support/rack_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def call(env)
107107
case env['PATH_INFO']
108108
when '/upload'
109109
req = Rack::Request.new(env)
110-
body = case req['upload']
110+
body = case req.params['upload']
111111
when Array
112112
req.params['upload'].map { |upload| upload[:tempfile].read }.join("\n")
113113
when Hash

0 commit comments

Comments
 (0)