From f49b6bfe5a29a0fa70df583a7721fc923e260482 Mon Sep 17 00:00:00 2001 From: Ondrej Machulda Date: Sun, 29 Nov 2020 22:54:38 +0100 Subject: [PATCH] Remove PhantomJS support --- CHANGELOG.md | 1 + src-tests/Console/Command/RunCommandTest.php | 1 - src-tests/Selenium/CapabilitiesResolverTest.php | 1 - src/Console/Command/RunCommand.php | 5 +++-- src/Listener/WebDriverListener.php | 6 ------ 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43dc0e02..9e6bb52d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ - `UniqueValue` component. (You may use Faker or some other library for similar use-case.) - `AbstractTestCaseBase` class. It should probably not affect anything, as it was only used internally. - Workarounds for legacy Firefox (version 47 and older) which are no longer needed. +- PhantomJS support. ## 2.3.2 - 2017-12-02 ### Changed diff --git a/src-tests/Console/Command/RunCommandTest.php b/src-tests/Console/Command/RunCommandTest.php index f312e833..b9c04fbe 100644 --- a/src-tests/Console/Command/RunCommandTest.php +++ b/src-tests/Console/Command/RunCommandTest.php @@ -174,7 +174,6 @@ public function provideBrowserName(): array return [ 'firefox is supported' => ['firefox', false, 'firefox'], 'chrome is supported' => ['chrome', false, 'chrome'], - 'phantomjs is supported' => ['phantomjs', false, 'phantomjs'], 'MicrosoftEdge is supported' => ['MicrosoftEdge', false, 'MicrosoftEdge'], 'MicrosoftEdge is supported in lowercase' => ['microsoftedge', false, 'MicrosoftEdge'], 'browser name is case insensitive' => ['FIREFOX', false, 'firefox'], diff --git a/src-tests/Selenium/CapabilitiesResolverTest.php b/src-tests/Selenium/CapabilitiesResolverTest.php index f5d4a52f..5fb5d70f 100644 --- a/src-tests/Selenium/CapabilitiesResolverTest.php +++ b/src-tests/Selenium/CapabilitiesResolverTest.php @@ -60,7 +60,6 @@ function ($capabilitiesArray): void { }, ], [WebDriverBrowserType::SAFARI], - [WebDriverBrowserType::PHANTOMJS], ]; } diff --git a/src/Console/Command/RunCommand.php b/src/Console/Command/RunCommand.php index 52546493..e684ab1e 100644 --- a/src/Console/Command/RunCommand.php +++ b/src/Console/Command/RunCommand.php @@ -36,7 +36,6 @@ class RunCommand extends Command 'microsoftedge' => WebDriverBrowserType::MICROSOFT_EDGE, 'internet explorer' => WebDriverBrowserType::IE, 'safari' => WebDriverBrowserType::SAFARI, - 'phantomjs' => WebDriverBrowserType::PHANTOMJS, ]; public const ARGUMENT_ENVIRONMENT = 'environment'; @@ -159,7 +158,9 @@ protected function configure(): void ); $this->addUsage('staging firefox'); - $this->addUsage('--group=foo --group=bar --exclude-group=baz -vvv development phantomjs'); + $this->addUsage( + '--group=foo --group=bar --exclude-group=baz --server-url=http://localhost:4444/wd/hub -vv staging chrome' + ); $this->getDispatcher()->dispatch(CommandEvents::CONFIGURE, new BasicConsoleEvent($this)); } diff --git a/src/Listener/WebDriverListener.php b/src/Listener/WebDriverListener.php index b72430ef..9a8616b3 100644 --- a/src/Listener/WebDriverListener.php +++ b/src/Listener/WebDriverListener.php @@ -122,12 +122,6 @@ public function endTest(Test $test, float $time): void ob_start(); // Capture any output from commands bellow to make them appended to output of the test. try { - // Workaround for PhantomJS 1.x - see https://github.com/detro/ghostdriver/issues/343 - // Should be removed with PhantomJS 2 - if (ConfigProvider::getInstance()->browserName === WebDriverBrowserType::PHANTOMJS) { - $test->wd->execute('deleteAllCookies'); - } - $test->wd->close(); $test->wd->quit(); } catch (WebDriverException $e) {