Skip to content

Commit 194545f

Browse files
authored
[rb] fix Safari test failures (#17922)
[rb] fix Safari set_viewport spec guard and update Homebrew before STP install
1 parent 7f32b68 commit 194545f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/bazel.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ jobs:
233233
- name: Setup Safari Technology Preview
234234
if: inputs.safari-preview && inputs.os == 'macos'
235235
run: |
236+
brew update --quiet
236237
brew install --cask safari-technology-preview
237238
sudo "/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver" --enable
238239
- name: Import GPG key

rb/spec/integration/selenium/webdriver/bidi/protocol/browsing_context_spec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,19 @@ def evaluate(expression, context = driver.window_handle)
317317
describe '#set_viewport' do
318318
it 'sets the viewport size and device pixel ratio',
319319
pending_if: {browser_family: :safari,
320-
exception: {class: RSpec::Expectations::ExpectationNotMetError},
321-
reason: 'Safari accepts browsingContext.setViewport but does not resize the window'} do
320+
reason: 'Safari accepts browsingContext.setViewport but returns undefined for the ' \
321+
'window size, so the resize cannot be verified'} do
322322
browsing_context.set_viewport(
323323
context: driver.window_handle,
324324
viewport: BrowsingContext::Viewport.new(width: 800, height: 600),
325325
device_pixel_ratio: 2.0
326326
)
327327

328-
expect(evaluate('[window.innerWidth, window.innerHeight]').result.value.map(&:value)).to eq([800, 600])
328+
expect(evaluate('[window.innerWidth, window.innerHeight]').result).to eq(
329+
Script::ArrayRemoteValue.new(
330+
value: [Script::NumberValue.new(value: 800), Script::NumberValue.new(value: 600)]
331+
)
332+
)
329333
end
330334

331335
it 'clears the viewport override' do

0 commit comments

Comments
 (0)