From d5dc579421b04ad90d6077046ba622212fab103e Mon Sep 17 00:00:00 2001 From: minhaz Date: Thu, 13 Mar 2014 00:11:08 +0530 Subject: [PATCH] testing automated file uploading to remote server Signed-off-by: A V Minhaz --- test/selenium/PmaSeleniumImportTest.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/test/selenium/PmaSeleniumImportTest.php b/test/selenium/PmaSeleniumImportTest.php index 7f63c68e51..4af8ad73a4 100644 --- a/test/selenium/PmaSeleniumImportTest.php +++ b/test/selenium/PmaSeleniumImportTest.php @@ -25,6 +25,17 @@ class PMA_SeleniumImportTest extends PMA_SeleniumBase public function setUpPage() { $this->login(); + + /** + * testing file upload to remote server + */ + $this->fileDetector(function($filename) { + if(file_exists($filename)) { + return $filename; + } else { + return NULL; + } + }); } /** @@ -115,15 +126,12 @@ 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" - ); + + //to implement file upload to remote server + $ele = $this->byName('import_file'); + $this->sendKeys($ele, dirname(__FILE__) . "/../test_data/" . $type . "_import.sql"); + $this->byId("buttonGo")->click(); $this->waitForElement( "byXPath",