rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.7k stars 122 forks source link

Limit emulation to enabling slowmoable #331

Closed aaronjensen closed 1 year ago

aaronjensen commented 1 year ago

Fixes #330

If the line cannot be removed (because slowmoable needs to stay enabled) then this will disable the override of everything else.

aaronjensen commented 1 year ago

@route would you be able to take a look at this please?

route commented 1 year ago

@aaronjensen could you please rebase it with master? I don't see how to run tests for this PR

aaronjensen commented 1 year ago

Rebased. When you say you don't see how to run tests, are you saying that you don't see any tests or you this PR somehow breaks the normal means of running tests? The emulation device metric overrides were not previously tested afaict, so I wasn't sure how to add a test for them.

aaronjensen commented 1 year ago

I do see a test failure actually in browser_spec.rb, specifically:

include_examples "resize viewport by fullscreen" do
  let(:path) { "/ferrum/custom_html_size_100%" }
  let(:viewport_size) { [1272, 1008] }
end
route commented 1 year ago

@aaronjensen I was talking about a button to "Approve and Run tests" for this PR. Now it appeared. We need to investigate this failure. Cannot merge it with a breaking test ;)

aaronjensen commented 1 year ago

Updated to only disable overriding the device scale factor. Setting the height and width still work and are necessary to allow controlling height and width when using full screen.

route commented 1 year ago

Looks good now! Sorry that it took me so long! ❤️

aaronjensen commented 1 year ago

Thank you!

aaronjensen commented 1 year ago

@route sorry to bother you again, but do you have an idea when you plan to release a new gem version with this change? Thank you!

route commented 1 year ago

I don’t know, when it’s time :) use master

aaronjensen commented 1 year ago

Understood, thanks for the response.