Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ jobs:
- name: Setup Safari Technology Preview
if: inputs.safari-preview && inputs.os == 'macos'
run: |
brew update --quiet
brew install --cask safari-technology-preview
sudo "/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver" --enable
- name: Import GPG key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,19 @@ def evaluate(expression, context = driver.window_handle)
describe '#set_viewport' do
it 'sets the viewport size and device pixel ratio',
pending_if: {browser_family: :safari,
exception: {class: RSpec::Expectations::ExpectationNotMetError},
reason: 'Safari accepts browsingContext.setViewport but does not resize the window'} do
reason: 'Safari accepts browsingContext.setViewport but returns undefined for the ' \
'window size, so the resize cannot be verified'} do
browsing_context.set_viewport(
context: driver.window_handle,
viewport: BrowsingContext::Viewport.new(width: 800, height: 600),
device_pixel_ratio: 2.0
)

expect(evaluate('[window.innerWidth, window.innerHeight]').result.value.map(&:value)).to eq([800, 600])
expect(evaluate('[window.innerWidth, window.innerHeight]').result).to eq(
Script::ArrayRemoteValue.new(
value: [Script::NumberValue.new(value: 800), Script::NumberValue.new(value: 600)]
)
)
end

it 'clears the viewport override' do
Expand Down
Loading