Closed techhemant closed 5 years ago
Hope this will be helpfully. This is for chrome
$this->setDesiredCapabilities([
"goog:chromeOptions" => [
"args" => [
"--headless",
"--disable-gpu",
],
// disable loading images
"prefs" => [
"profile" => [
"managed_default_content_settings" => [
"images" => 2,
],
],
],
],
]);
@pajon you have no idea how long I've just spent scouring the web and digging deep into selenium, chrome, chromedriver documentation, not to mention the source of PHPUnit and PHPUnit_Selenium, plus playing around with direct CURL requests to the Selenium endpoint to try to get this working.
Your solution worked great, thanks so much!
@czerwonyd See the above for how we can use headless chrome. Think about integrating it into your plugin as a part of the configuration that you'll be looking at.
Even simpler
$this->setDesiredCapabilities(['chromeOptions'=>['args'=>['headless']]]);
How can run Chrome in headless mode in PHPUnit_Extensions_Selenium2TestCase as there is no direct way to setting chromeoptions.