From db389e2ae1e5bc6cdfab74a07f2fdccb6b73e53d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20St=C3=B6hr?= Date: Thu, 18 Jan 2024 10:38:37 +0100 Subject: [PATCH] feat: allow selenium server with internal webserver --- src/PantherTestCase.php | 2 ++ src/PantherTestCaseTrait.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PantherTestCase.php b/src/PantherTestCase.php index d92af2f8..7bf9d0ca 100644 --- a/src/PantherTestCase.php +++ b/src/PantherTestCase.php @@ -23,6 +23,7 @@ abstract class PantherTestCase extends WebTestCase public const CHROME = 'chrome'; public const FIREFOX = 'firefox'; + public const SELENIUM = 'selenium'; protected function tearDown(): void { @@ -44,6 +45,7 @@ abstract class PantherTestCase extends TestCase public const CHROME = 'chrome'; public const FIREFOX = 'firefox'; + public const SELENIUM = 'selenium'; protected function tearDown(): void { diff --git a/src/PantherTestCaseTrait.php b/src/PantherTestCaseTrait.php index 5c8ea2b1..b943a198 100644 --- a/src/PantherTestCaseTrait.php +++ b/src/PantherTestCaseTrait.php @@ -180,7 +180,9 @@ protected static function createPantherClient(array $options = [], array $kernel if (PantherTestCase::FIREFOX === $browser) { self::$pantherClients[0] = self::$pantherClient = Client::createFirefoxClient(null, null, $managerOptions, self::$baseUri); - } else { + } elseif (PantherTestCase::SELENIUM === $browser) { + self::$pantherClients[0] = self::$pantherClient = Client::createSeleniumClient($managerOptions['host'], $managerOptions['capabilities'], self::$baseUri, $options); + } else { try { self::$pantherClients[0] = self::$pantherClient = Client::createChromeClient(null, null, $managerOptions, self::$baseUri); } catch (\RuntimeException $e) {