ferrum
ferrum copied to clipboard
Enable mobile emulation
There is a request on Cuprite to support mobile emulation: https://github.com/rubycdp/cuprite/issues/216
A prerequisite for this is for Ferrum to support mobile: true in Page#resize. This PR adds that support.
Note that passing mobile: true also sets the screen resolution to that of an iPhone 14; see this comment. Perhaps there's a nicer way of doing this?
Merging this should let us close #94.
Moving this back to draft, for now, while I clean up following a move of the mobile specific stuff into Cuprite.
Okay I think this is good for review again :)
Note the new, improved, and not-hard-coded API. In Cuprite you'd do:
Capybara.register_driver :custom_cuprite_mobile do |app|
mobile_cuprite_options = cuprite_options.merge(Capybara::Cuprite::Devices::IPHONE_14)
Capybara::Cuprite::Driver.new(app, mobile_cuprite_options)
end