From c28e2d42350a6121f738094e362eca24fbd77860 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Wed, 26 Jul 2017 20:24:22 +0530 Subject: [PATCH] Fix Import-related selenium tests * Use $cfg['uploadDir'] = "./test/test_data" while importing * Prevents use of FileDetectors in remote file detectors etc. Signed-off-by: Deven Bansod --- .travis.yml | 1 + test/ci-install-selenium | 2 ++ test/selenium/PmaSeleniumImportTest.php | 20 +++++++++++--------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 34d380034d..4b9ea1c495 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,7 @@ after_script: - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi - if [ -f php.log ] ; then cat php.log ; fi - if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi + - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/test/ci-install-selenium b/test/ci-install-selenium index 46d49932a9..7b8eca160a 100755 --- a/test/ci-install-selenium +++ b/test/ci-install-selenium @@ -2,3 +2,5 @@ ./test/install-browserstack composer install --no-interaction + +echo -e " config.inc.php \ No newline at end of file diff --git a/test/selenium/PmaSeleniumImportTest.php b/test/selenium/PmaSeleniumImportTest.php index 576d7850c0..090436ffd3 100644 --- a/test/selenium/PmaSeleniumImportTest.php +++ b/test/selenium/PmaSeleniumImportTest.php @@ -110,15 +110,17 @@ class PMA_SeleniumImportTest extends PMA_SeleniumBase */ private function _doImport($type) { - /* FIXME: Need to implement file upload compatible with remote Selenium */ - $this->markTestIncomplete( - 'File uploading not yet implemented in Selenium test' - ); - $this->waitForElement('byLinkText', "Import")->click(); - $ele = $this->waitForElement("byId", "input_import_file"); - $ele->value( - dirname(__FILE__) . "/../test_data/" . $type . "_import.sql" - ); + $this->waitForElement('byPartialLinkText', "Import")->click(); + $this->waitForElementNotPresent('byId', 'ajax_message_num_1'); + $this->waitForElement("byId", "input_import_file"); + + $this->waitForElement('byCssSelector', 'label[for=radio_local_import_file]')->click(); + $this->select($this->byName("local_import_file")) + ->selectOptionByLabel($type . "_import.sql"); + + usleep(1000000); + + $this->scrollToBottom(); $this->byId("buttonGo")->click(); $this->waitForElement( "byXPath",