Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
<php>
<var name="driver_config_factory" value="Behat\Mink\Tests\Driver\Selenium2Config::getInstance" />

<!-- keep commented-out, so CI env vars can set it -->
<!--<server name="SELENIUM_VERSION" value="3"/>-->

<!--server name="WEB_FIXTURES_HOST" value="http://test.mink.dev" /-->
<!-- MacOS -->
<!--<server name="WEB_FIXTURES_HOST" value="http://docker.for.mac.localhost:8002"/>-->

<!-- keep commented-out, so CI env vars can set it -->
<!--<server name="WEB_FIXTURES_BROWSER" value="firefox"/>-->

<!-- where driver will connect to -->
Expand Down
9 changes: 7 additions & 2 deletions tests/Selenium2Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ public static function getInstance(): self

public function createDriver(): DriverInterface
{
$browser = getenv('WEB_FIXTURES_BROWSER') ?: 'firefox';
$browser = $this->getBrowserName();
$seleniumHost = $_SERVER['DRIVER_URL'];

return new Selenium2Driver($browser, null, $seleniumHost);
}

public function getBrowserName(): string
{
return $_SERVER['WEB_FIXTURES_BROWSER'] ?? 'firefox';
}

public function mapRemoteFilePath($file): string
{
if (!isset($_SERVER['TEST_MACHINE_BASE_PATH'])) {
Expand Down Expand Up @@ -81,7 +86,7 @@ public function skipMessage($testCase, $test): ?string
}

if (array(JavascriptTest::class, 'testDragDropOntoHiddenItself') === $testCallback) {
$browser = $_SERVER['WEB_FIXTURES_BROWSER'] ?? null;
$browser = $this->getBrowserName();

if ($browser === 'firefox' && $this->getSeleniumMajorVersion() === 2) {
return 'The Firefox browser compatible with Selenium 2.x does not fully implement drag-n-drop support.';
Expand Down
Loading