From 9b0254a191e3d0b815e4f9b27aa447dbfa5eed1f Mon Sep 17 00:00:00 2001 From: Soufiane Ghzal Date: Thu, 20 Feb 2020 20:43:44 +0100 Subject: [PATCH 1/3] fixed browser close --- src/Browser.php | 10 +++++++++- src/Browser/BrowserProcess.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Browser.php b/src/Browser.php index faaff391..491429ea 100644 --- a/src/Browser.php +++ b/src/Browser.php @@ -99,7 +99,15 @@ public function setPagePreScript(string $script = null) */ public function close() { - // TODO check browser.close on chrome 63 + $this->sendCloseMessage(); + } + + /** + * Send close message to the browser + * @throws OperationTimedOut + */ + final public function sendCloseMessage() + { $r = $this->connection->sendMessageSync(new Message('Browser.close')); if (!$r->isSuccessful()) { // log diff --git a/src/Browser/BrowserProcess.php b/src/Browser/BrowserProcess.php index 24e62b28..e1120de4 100644 --- a/src/Browser/BrowserProcess.php +++ b/src/Browser/BrowserProcess.php @@ -190,7 +190,7 @@ public function kill() try { // log $this->logger->debug('process: trying to close chrome gracefully'); - $this->browser->close(); + $this->browser->sendCloseMessage(); } catch (\Exception $e) { //log $this->logger->debug('process: closing chrome gracefully - compatibility'); From 6f1aeadbff9b15da1ebc5fdad34d0eee1e7225ae Mon Sep 17 00:00:00 2001 From: Soufiane Ghzal Date: Thu, 20 Feb 2020 21:34:32 +0100 Subject: [PATCH 2/3] fixed http enabled tests --- test/suites/HttpEnabledTestCase.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/suites/HttpEnabledTestCase.php b/test/suites/HttpEnabledTestCase.php index e862cdce..202d54d6 100644 --- a/test/suites/HttpEnabledTestCase.php +++ b/test/suites/HttpEnabledTestCase.php @@ -19,11 +19,19 @@ public static function setUpBeforeClass() self::$process = new Process([ 'php', - '-S localhost:8083', - '-t ' . __DIR__ . '/../resources/static-web' + '-S', + 'localhost:8083', + '-t', + __DIR__ . '/../resources/static-web' ]); self::$process->start(); - usleep(10000); //wait for server to get going + usleep(80000); //wait for server to get going + + // ensure it started + if (!self::$process->isRunning()) { + $message = self::$process->getErrorOutput(); + throw new \Exception('Cannot start webserver for tests: ' . $message); + } } public static function tearDownAfterClass() From 81d4df7f22c3b1dc916a05885a8fa03c83fc0532 Mon Sep 17 00:00:00 2001 From: Soufiane Ghzal Date: Thu, 20 Feb 2020 21:35:44 +0100 Subject: [PATCH 3/3] fixed http enabled tests --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b78743e9..4429e0a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,9 +12,21 @@ * none +## 0.8.1 + +> *2020-02-20* + +> Description + +* Bug fixes: + * fixed browser close + * fixed unit tests + * testing php 7.3 and 7.4 + + ## 0.8.0 -> *2020-02-20* (not released) +> *2020-02-20* * Features: * Added Page::pdf (thanks @tanasecosminromeo)