Skip to content

Commit

Permalink
Do not attempt to delete Firefox session after browser was already cl…
Browse files Browse the repository at this point in the history
…osed

This is workaround for Geckodriver bug mozilla/geckodriver#732
  • Loading branch information
OndraM committed Mar 4, 2021
1 parent 5d5895c commit 97d77fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Listener/WebDriverListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Facebook\WebDriver\Exception\SessionNotCreatedException;
use Facebook\WebDriver\Exception\WebDriverException;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\WebDriverBrowserType;
use Lmc\Steward\ConfigProvider;
use Lmc\Steward\Selenium\CapabilitiesResolver;
use Lmc\Steward\Test\AbstractTestCase;
Expand Down Expand Up @@ -122,7 +123,11 @@ public function endTest(Test $test, float $time): void

try {
$test->wd->close();
$test->wd->quit();
// Do not attempt to delete session after browser was closed. Workaround for Geckodriver bug:
// https://github.com/mozilla/geckodriver/issues/732, https://bugzilla.mozilla.org/show_bug.cgi?id=1403510
if (ConfigProvider::getInstance()->browserName !== WebDriverBrowserType::FIREFOX) {
$test->wd->quit();
}
} catch (WebDriverException $e) {
$test->warn('Error closing the session, browser may died.');
} finally {
Expand Down

0 comments on commit 97d77fa

Please sign in to comment.