diff --git a/src/Selenium/CapabilitiesResolver.php b/src/Selenium/CapabilitiesResolver.php index 0c83118..5b36547 100644 --- a/src/Selenium/CapabilitiesResolver.php +++ b/src/Selenium/CapabilitiesResolver.php @@ -2,6 +2,7 @@ namespace Lmc\Steward\Selenium; +use Facebook\WebDriver\Chrome\ChromeOptions; use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\WebDriverBrowserType; use Facebook\WebDriver\Remote\WebDriverCapabilityType; @@ -101,6 +102,9 @@ protected function setupBrowserSpecificCapabilities( case WebDriverBrowserType::IE: $capabilities = $this->setupInternetExplorerCapabilities($capabilities); break; + case WebDriverBrowserType::CHROME: + $capabilities = $this->setupChromeCapabilities($capabilities); + break; } return $capabilities; @@ -113,4 +117,14 @@ protected function setupInternetExplorerCapabilities(DesiredCapabilities $capabi return $capabilities; } + + private function setupChromeCapabilities(DesiredCapabilities $capabilities): DesiredCapabilities + { + $chromeOptions = new ChromeOptions(); + // Disable search engine choice pop-up which appears in Chrome 127+ + $chromeOptions->addArguments(['--disable-search-engine-choice-screen']); + $capabilities->setCapability(ChromeOptions::CAPABILITY, $chromeOptions); + + return $capabilities; + } }