Skip to content

Commit

Permalink
feat: allow selenium server with internal webserver
Browse files Browse the repository at this point in the history
  • Loading branch information
daFish committed Jan 18, 2024
1 parent ef9a6f2 commit db389e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/PantherTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down
4 changes: 3 additions & 1 deletion src/PantherTestCaseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit db389e2

Please sign in to comment.