evil_systems icon indicating copy to clipboard operation
evil_systems copied to clipboard

Ability to provide screen size to the browser as part of setup

Open mhenrixon opened this issue 3 years ago • 5 comments

I would have expected the following to work but it doesn't.

driven_by :evil_cuprite, screen_size: [2800, 2800]

Would you be open to allowing some way of customizing the custom cuprite driver's browser options with a configurable screensize?

mhenrixon avatar Jan 27 '22 16:01 mhenrixon

Yea of course, I need to dig into how driven_by is created. My best guess is theres some underlying API I can hook onto.

KonnorRogers avatar Jan 27 '22 21:01 KonnorRogers

@mhenrixon is this not already possible? I'm looking at the docs, it seems like it should just work.

https://api.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html#method-c-driven_by

What error are you getting? (I'll try to get around to investigating later today)

KonnorRogers avatar Apr 10 '22 21:04 KonnorRogers

Ruby on Rails has already defined a cuprite driver so your creation of the driver isn't picked up properly.

Perhaps you can use the existing driver and modify the settings but somehow I feel like that would be more work than simply just renaming the driver.

mhenrixon avatar Apr 11 '22 07:04 mhenrixon

Basically nothing works and it complains it can't find the binary (I was using browserless chrome and a chrome url).

mhenrixon avatar Apr 11 '22 07:04 mhenrixon

Can you tell I haven't slept in months? I answered the wrong question...

So, the screensize doesn't work for screenshots. The screenshots seems to have the same size as you defined in the initial driven_by in the gem.

mhenrixon avatar Apr 11 '22 11:04 mhenrixon