symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.94k stars 222 forks source link

Allow to configure Client options when call PantherTestCaseTrait::createPantherClient #289

Open alamirault opened 4 years ago

alamirault commented 4 years ago

Currently when we call Symfony\Component\Panther\PantherTestCaseTrait::createPantherClient(), Client::createChromeClient is called but is not possible to pass our own arguments (null is given), options and baseUri.

https://github.com/symfony/panther/blob/9282baa73b5c554f6179e8a08f6b079762b0eb76/src/PantherTestCaseTrait.php#L156

I think It could be a good improvement and allow to customize Client for tests (proxy, window-size, etc)

WDYT ?

shadowc commented 3 years ago

Getting a window size is paramount. Some tests fail where some page elements might appear out of bounds if the browser size is too small. Some other tests may want to test just that: If we shrink the browser size, are x and y elements of a page still reachable?

May be there's a way to do that but we don't know?

shadowc commented 3 years ago

Actually, no. Like I commented in another issue, I think createPantherClient is missing a way to easily configure whatever browser client it will end up spawning. :)