diff --git a/doc/conf.py b/doc/conf.py index 87fc2bdaa1..4ed164b3be 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -317,4 +317,6 @@ linkcheck_ignore = [ r'https://www.yubico.com/.*', # 500 Server Error: Internal Server Error r'http://www.scriptalicious.com/.*', + # Some timeouts and SSL issues: https://github.com/sektioneins/suhosin/issues/119 + r'https://suhosin.org/.*', ] diff --git a/test/selenium/ExportTest.php b/test/selenium/ExportTest.php index d0c602b5e9..42a7f766f5 100644 --- a/test/selenium/ExportTest.php +++ b/test/selenium/ExportTest.php @@ -161,7 +161,7 @@ class ExportTest extends TestBase $this->scrollIntoView('databases_and_tables', 200); $this->byPartialLinkText('Unselect all')->click(); - $this->byCssSelector("option[value=" . $this->database_name . "]")->click(); + $this->byCssSelector('option[value="' . $this->database_name . '"]')->click(); } if ($type === 'table') { diff --git a/test/selenium/ImportTest.php b/test/selenium/ImportTest.php index 20513814c2..17f1c2da7c 100644 --- a/test/selenium/ImportTest.php +++ b/test/selenium/ImportTest.php @@ -27,6 +27,7 @@ class ImportTest extends TestBase protected function setUp(): void { parent::setUp(); + $this->maximize(); $this->login(); } diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index 94b9fc14d9..d5af4397b4 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -250,6 +250,14 @@ abstract class TestBase extends TestCase $buildLocal = true; $buildId = 'Manual'; $projectName = 'phpMyAdmin'; + /** + * Usefull for browserstack + * + * @see https://github.com/phpmyadmin/phpmyadmin/pull/14595#issuecomment-418541475 + * Reports the name of the test to browserstack + */ + $className = substr(static::class, strlen('PhpMyAdmin\Tests\Selenium\\')); + $testName = $className . ': ' . $this->getName(); if (getenv('BUILD_TAG')) { $buildId = getenv('BUILD_TAG'); @@ -261,41 +269,22 @@ abstract class TestBase extends TestCase $projectName = 'phpMyAdmin (Travis)'; } - $capabilities->setCapability('project', $projectName); - $capabilities->setCapability('build', $buildId); - $capabilities->setCapability('browserstack.debug', false); - - /** - * Usefull for browserstack - * @see https://github.com/phpmyadmin/phpmyadmin/pull/14595#issuecomment-418541475 - * Reports the name of the test to browserstack - */ - $capabilities->setCapability( - 'name', - static::class . '__' . $this->getName() - ); - if ($buildLocal) { $capabilities->setCapability( - 'browserstack.local', - $buildLocal - ); - $capabilities->setCapability( - 'browserstack.localIdentifier', - $buildId - ); - $capabilities->setCapability( - 'browserstack.debug', - true - ); - $capabilities->setCapability( - 'browserstack.console', - 'verbose' - ); - - $capabilities->setCapability( - 'browserstack.networkLogs', - true + 'bstack:options', + [ + 'os' => 'Windows', + 'osVersion' => '10', + 'resolution' => '1920x1080', + 'projectName' => $projectName, + 'sessionName' => $testName, + 'buildName' => $buildId, + 'localIdentifier' => $buildId, + 'local' => $buildLocal, + 'debug' => false, + 'consoleLogs' => 'verbose', + 'networkLogs' => true, + ] ); } } @@ -336,7 +325,11 @@ abstract class TestBase extends TestCase ); $capabilities->setCapability( 'browser_version', - '69.0' // Force chrome 69.0 + '80.0' // Force chrome 80.0 + ); + $capabilities->setCapability( + 'resolution', + '1920x1080' ); } @@ -1020,17 +1013,22 @@ abstract class TestBase extends TestCase /** * Wait for AJAX completion - * * @return void */ - public function waitAjax() + public function waitAjax(): void { /* Wait while code is loading */ - while ($this->webDriver->executeScript( - 'return AJAX.active;' - )) { - usleep(5000); - } + $this->webDriver->executeAsyncScript( + 'var callback = arguments[arguments.length - 1];' + . 'function startWaitingForAjax() {' + . ' if (! AJAX.active) {' + . ' callback();' + . ' } else {' + . ' setTimeout(startWaitingForAjax, 200);' + . ' }' + . '}' + . 'startWaitingForAjax();' + ); } /**