From 5dd722d4c3334da2ce4b9ff8360a439ba76b3c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 27 Mar 2014 09:47:08 +0100 Subject: [PATCH 1/2] Revert "Try to open page in setUp." This reverts commit 37e58a89612e2b845813ca953a7beaeb0552455b. It needs to be done with existing session. --- test/selenium/TestBase.php | 1 - 1 file changed, 1 deletion(-) diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index 8750bc2597..b82176c979 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -159,7 +159,6 @@ abstract class PMA_SeleniumBase extends PHPUnit_Extensions_Selenium2TestCase parent::setUp(); $this->setBrowserUrl($GLOBALS['TESTSUITE_URL']); - $this->url(''); $this->_mysqli = new mysqli( $GLOBALS['TESTSUITE_SERVER'], $GLOBALS['TESTSUITE_USER'], From b53dd865b714f76b139763066d1cea528f0c9894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 27 Mar 2014 09:49:08 +0100 Subject: [PATCH 2/2] Workaround for Selenium tests with coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The phpunit-selenium tries to set cookie just after opening Selenium session, what fails (at least with Chrome) as the browser is currently pointing to data: URL and not our application one. So we need to set URL just as the Selenium session is opened. Signed-off-by: Michal Čihař --- test/selenium/TestBase.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index b82176c979..f7055640dd 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -138,6 +138,19 @@ abstract class PMA_SeleniumBase extends PHPUnit_Extensions_Selenium2TestCase } } + /** + * Sets session with setting URL to workaround phpunit-selenium issue + * https://github.com/sebastianbergmann/phpunit-selenium/issues/295 + * + * @return session object + */ + public function prepareSession() + { + $result = parent::prerareSession(); + $this->url(''); + return $result; + } + /** * Configures the selenium and database link. *