commit
20deff067f
@ -205,6 +205,14 @@ class Helper
|
||||
return $browserString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for an element to be present on the page
|
||||
*
|
||||
* @param string $func Locate using - byCss, byXPath, etc
|
||||
* @param string $arg Selector
|
||||
*
|
||||
* @return PHPUnit_Extensions_Selenium2TestCase_Element Element waited for
|
||||
*/
|
||||
public function waitForElement($func, $arg)
|
||||
{
|
||||
$this->_selenium->timeouts()->implicitWait(10000);
|
||||
@ -215,10 +223,17 @@ class Helper
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for an element to disappear
|
||||
*
|
||||
* @param string $func Locate using - byCss, byXPath, etc
|
||||
* @param string $arg Selector
|
||||
*
|
||||
* @return bool Whether or not the element disappeared
|
||||
*/
|
||||
public function waitForElementNotPresent($func, $arg)
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
while (true) {
|
||||
if (!$this->isElementPresent($func, $arg)) {
|
||||
return true;
|
||||
}
|
||||
@ -226,6 +241,14 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if element is present or not
|
||||
*
|
||||
* @param string $func Locate using - byCss, byXPath, etc
|
||||
* @param string $arg Selector
|
||||
*
|
||||
* @return bool Whether or not the element is present
|
||||
*/
|
||||
public function isElementPresent($func, $arg)
|
||||
{
|
||||
try {
|
||||
@ -240,16 +263,30 @@ class Helper
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get table cell data
|
||||
*
|
||||
* @param string $identifier Identifier: tableId.row.column
|
||||
*
|
||||
* @return text Data from the particular table cell
|
||||
*/
|
||||
public function getTable($identifier)
|
||||
{
|
||||
list($tableID, $row, $column) = explode(".", $identifier);
|
||||
$selector = "table#{$tableID} tbody tr:nth-child({$row}) td:nth-child({$column})";
|
||||
$sel = "table#{$tableID} tbody tr:nth-child({$row}) td:nth-child({$column})";
|
||||
$element = $this->_selenium->byCssSelector(
|
||||
$selector
|
||||
$sel
|
||||
);
|
||||
return $element->text();
|
||||
}
|
||||
|
||||
/**
|
||||
* Type text in textarea (CodeMirror enabled)
|
||||
*
|
||||
* @param string $text Text to type
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function typeInTextArea($text)
|
||||
{
|
||||
$text = str_replace(
|
||||
|
||||
@ -125,7 +125,8 @@ class PmaSeleniumDbEventsTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$ele = $this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Event `test_event` has been created')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Event `test_event` has been created')]"
|
||||
);
|
||||
|
||||
$this->assertTrue(
|
||||
@ -177,7 +178,8 @@ class PmaSeleniumDbEventsTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$ele = $this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Event `test_event` has been modified')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Event `test_event` has been modified')]"
|
||||
);
|
||||
|
||||
usleep(2000000);
|
||||
@ -209,7 +211,7 @@ class PmaSeleniumDbEventsTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
$this->byLinkText("Drop")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath", "//button[contains(., 'OK')]"
|
||||
)->click();
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElement("byId", "nothing2display");
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ class PmaSeleniumDbOperationsTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath", "//button[contains(., 'OK')]"
|
||||
)->click();
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
|
||||
@ -102,14 +102,14 @@ class PmaSeleniumDbProceduresTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
$this->byName("item_param_name[0]")->value("inp");
|
||||
$this->select(
|
||||
$this->byName("item_param_type[0]")
|
||||
)->selectOptionByLabel("VARCHAR");
|
||||
)->selectOptionByLabel("VARCHAR");
|
||||
$this->byName("item_param_length[0]")->value("10");
|
||||
|
||||
$this->byCssSelector("input[value='Add parameter']")->click();
|
||||
|
||||
$this->select(
|
||||
$this->byName("item_param_dir[1]")
|
||||
)->selectOptionByLabel("OUT");
|
||||
)->selectOptionByLabel("OUT");
|
||||
$ele = $this->_helper->waitForElement("byName", "item_param_name[1]");
|
||||
$ele->value("outp");
|
||||
|
||||
@ -118,13 +118,14 @@ class PmaSeleniumDbProceduresTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$this->select(
|
||||
$this->byName("item_sqldataaccess")
|
||||
)->selectOptionByLabel("READS SQL DATA");
|
||||
)->selectOptionByLabel("READS SQL DATA");
|
||||
|
||||
$this->byXPath("//button[contains(., 'Go')]")->click();
|
||||
|
||||
$ele = $this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Routine `test_procedure` has been created')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Routine `test_procedure` has been created')]"
|
||||
);
|
||||
|
||||
$result = $this->_helper->dbQuery(
|
||||
@ -162,7 +163,8 @@ class PmaSeleniumDbProceduresTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$ele = $this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Routine `test_procedure` has been modified')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Routine `test_procedure` has been modified')]"
|
||||
);
|
||||
|
||||
$this->_executeProcedure("abcabcabcabcabcabcabc", 12);
|
||||
@ -189,7 +191,7 @@ class PmaSeleniumDbProceduresTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
$this->byLinkText("Drop")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath", "//button[contains(., 'OK')]"
|
||||
)->click();
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElement("byId", "nothing2display");
|
||||
|
||||
@ -203,6 +205,9 @@ class PmaSeleniumDbProceduresTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
/**
|
||||
* Execute procedure
|
||||
*
|
||||
* @param string $text String to pass as inp param
|
||||
* @param int $length Expected output length
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _executeProcedure($text, $length)
|
||||
|
||||
@ -89,12 +89,13 @@ class PmaSeleniumDbStructureTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//button[contains(., 'OK')]"
|
||||
)->click();
|
||||
)->click();
|
||||
|
||||
$this->assertNotNull(
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'MySQL returned an empty result')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'MySQL returned an empty result')]"
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -51,7 +51,8 @@ class PmaSeleniumDbTriggersTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
. " PRIMARY KEY (`id`)"
|
||||
. ")"
|
||||
);
|
||||
$this->_helper->dbQuery(
|
||||
|
||||
$this->_helper->dbQuery(
|
||||
"CREATE TABLE `test_table2` ("
|
||||
. " `id` int(11) NOT NULL AUTO_INCREMENT,"
|
||||
. " `val` int(11) NOT NULL,"
|
||||
@ -123,7 +124,8 @@ class PmaSeleniumDbTriggersTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$ele = $this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Trigger `test_trigger` has been created')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Trigger `test_trigger` has been created')]"
|
||||
);
|
||||
|
||||
$this->assertTrue(
|
||||
@ -172,7 +174,8 @@ class PmaSeleniumDbTriggersTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$ele = $this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Trigger `test_trigger` has been modified')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Trigger `test_trigger` has been modified')]"
|
||||
);
|
||||
|
||||
// test trigger
|
||||
@ -203,7 +206,7 @@ class PmaSeleniumDbTriggersTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
$this->byLinkText("Drop")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath", "//button[contains(., 'OK')]"
|
||||
)->click();
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElement("byId", "nothing2display");
|
||||
|
||||
|
||||
227
test/selenium/PmaSeleniumExportTest.php
Normal file
227
test/selenium/PmaSeleniumExportTest.php
Normal file
@ -0,0 +1,227 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Selenium TestCase for export related tests
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
* @subpackage Selenium
|
||||
*/
|
||||
require_once 'Helper.php';
|
||||
|
||||
/**
|
||||
* PmaSeleniumExportTest class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
* @subpackage Selenium
|
||||
*/
|
||||
class PmaSeleniumExportTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
{
|
||||
/**
|
||||
* Name of database for the test
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_dbname;
|
||||
|
||||
/**
|
||||
* Helper Object
|
||||
*
|
||||
* @var obj
|
||||
*/
|
||||
private $_helper;
|
||||
|
||||
/**
|
||||
* Setup the browser environment to run the selenium test case
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->_helper = new Helper($this);
|
||||
$this->setBrowser($this->_helper->getBrowserString());
|
||||
$this->setBrowserUrl(TESTSUITE_PHPMYADMIN_HOST . TESTSUITE_PHPMYADMIN_URL);
|
||||
$this->_helper->dbConnect();
|
||||
$this->_dbname = 'pma_db_' . time();
|
||||
$this->_helper->dbQuery('CREATE DATABASE ' . $this->_dbname);
|
||||
$this->_helper->dbQuery('USE ' . $this->_dbname);
|
||||
$this->_helper->dbQuery(
|
||||
"CREATE TABLE `test_table` ("
|
||||
. " `id` int(11) NOT NULL AUTO_INCREMENT,"
|
||||
. " `val` int(11) NOT NULL,"
|
||||
. " PRIMARY KEY (`id`)"
|
||||
. ")"
|
||||
);
|
||||
$this->_helper->dbQuery(
|
||||
"INSERT INTO `test_table` (val) VALUES (2);"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* setUp function that can use the selenium session (called before each test)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUpPage()
|
||||
{
|
||||
$this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for server level export
|
||||
*
|
||||
* @param string $plugin Export format
|
||||
* @param array $expected Array of expected strings
|
||||
*
|
||||
* @return void
|
||||
* @dataProvider exportDataProvider
|
||||
*/
|
||||
public function testServerImport($plugin, $expected)
|
||||
{
|
||||
$text = $this->_doExport('server', $plugin);
|
||||
|
||||
foreach ($expected as $str) {
|
||||
$this->assertContains($str, $text);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for db level export
|
||||
*
|
||||
* @param string $plugin Export format
|
||||
* @param array $expected Array of expected strings
|
||||
*
|
||||
* @return void
|
||||
* @dataProvider exportDataProvider
|
||||
*/
|
||||
public function testDbExport($plugin, $expected)
|
||||
{
|
||||
$this->_helper->waitForElement("byLinkText", $this->_dbname)->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//a[@class='item' and contains(., 'Database: ". $this->_dbname ."')]"
|
||||
);
|
||||
|
||||
$text = $this->_doExport('db', $plugin);
|
||||
|
||||
foreach ($expected as $str) {
|
||||
$this->assertContains($str, $text);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for table level export
|
||||
*
|
||||
* @param string $plugin Export format
|
||||
* @param array $expected Array of expected strings
|
||||
*
|
||||
* @return void
|
||||
* @dataProvider exportDataProvider
|
||||
*/
|
||||
public function testTableExport($plugin, $expected)
|
||||
{
|
||||
$this->_helper->dbQuery("INSERT INTO `test_table` (val) VALUES (3);");
|
||||
|
||||
// go to database page
|
||||
$this->_helper->waitForElement("byLinkText", $this->_dbname)->click();
|
||||
|
||||
// got to table page
|
||||
$this->_helper->waitForElement("byLinkText", "test_table")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//a[@class='tabactive' and contains(., 'Browse')]"
|
||||
);
|
||||
|
||||
$text = $this->_doExport('table', $plugin);
|
||||
|
||||
foreach ($expected as $str) {
|
||||
$this->assertContains($str, $text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Data provider for testServerExport
|
||||
*
|
||||
* @return array Test cases data
|
||||
*/
|
||||
public function exportDataProvider()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
'CSV',
|
||||
array('"1","2"')
|
||||
),
|
||||
array(
|
||||
'SQL',
|
||||
array(
|
||||
"CREATE TABLE IF NOT EXISTS `test_table`",
|
||||
"INSERT INTO `test_table` (`id`, `val`) VALUES (1, 2);"
|
||||
)
|
||||
),
|
||||
array(
|
||||
'JSON',
|
||||
array('[{"id":"1","val":"2"}]')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that goes to the import page, uploads a file and submit form
|
||||
*
|
||||
* @param string $type level: server, db or import
|
||||
* @param string $plugin format: csv, json, etc
|
||||
*
|
||||
* @return string export string
|
||||
*/
|
||||
private function _doExport($type, $plugin)
|
||||
{
|
||||
$this->byLinkText("Export")->click();
|
||||
|
||||
$this->_helper->waitForElement("byName", "dump");
|
||||
$this->byCssSelector("label[for=radio_custom_export]")->click();
|
||||
|
||||
if ($type == 'server') {
|
||||
$this->byLinkText('Unselect All')->click();
|
||||
$this->byCssSelector("option[value=" . $this->_dbname . "]")->click();
|
||||
}
|
||||
|
||||
if ($type == 'table') {
|
||||
$this->byCssSelector("label[for=radio_allrows_0]")->click();
|
||||
$this->byName("limit_to")->clear();
|
||||
$this->byName("limit_to")->value("1");
|
||||
}
|
||||
|
||||
$this->select($this->byId("plugins"))->selectOptionByLabel($plugin);
|
||||
$this->byCssSelector("label[for=radio_view_as_text]")->click();
|
||||
|
||||
if ($plugin == "SQL") {
|
||||
$this->byCssSelector(
|
||||
"label[for=radio_sql_structure_or_data_structure_and_data]"
|
||||
)->click();
|
||||
|
||||
if ($type != "table") {
|
||||
$this->byCssSelector(
|
||||
"label[for=checkbox_sql_create_database]"
|
||||
)->click();
|
||||
}
|
||||
}
|
||||
|
||||
$this->byId("buttonGo")->click();
|
||||
|
||||
$text = $this->_helper->waitForElement("byId", "textSQLDUMP")->text();
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tear Down function for test cases
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
$this->_helper->dbQuery('DROP DATABASE IF EXISTS ' . $this->_dbname);
|
||||
}
|
||||
|
||||
}
|
||||
164
test/selenium/PmaSeleniumServerSettingsTest.php
Normal file
164
test/selenium/PmaSeleniumServerSettingsTest.php
Normal file
@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Selenium TestCase for settings related tests
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
* @subpackage Selenium
|
||||
*/
|
||||
require_once 'Helper.php';
|
||||
|
||||
/**
|
||||
* PmaSeleniumServerSettingsTest class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
* @subpackage Selenium
|
||||
*/
|
||||
class PmaSeleniumSettingsTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
{
|
||||
/**
|
||||
* Name of database for the test
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_dbname;
|
||||
|
||||
/**
|
||||
* Helper Object
|
||||
*
|
||||
* @var Helper
|
||||
*/
|
||||
private $_helper;
|
||||
|
||||
/**
|
||||
* Setup the browser environment to run the selenium test case
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->_helper = new Helper($this);
|
||||
$this->setBrowser($this->_helper->getBrowserString());
|
||||
$this->setBrowserUrl(TESTSUITE_PHPMYADMIN_HOST . TESTSUITE_PHPMYADMIN_URL);
|
||||
$this->_helper->dbConnect();
|
||||
$this->_dbname = 'pma_db_' . time();
|
||||
$this->_helper->dbQuery('CREATE DATABASE ' . $this->_dbname);
|
||||
$this->_helper->dbQuery('USE ' . $this->_dbname);
|
||||
}
|
||||
|
||||
/**
|
||||
* setUp function that can use the selenium session (called before each test)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUpPage()
|
||||
{
|
||||
$this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD);
|
||||
$more = $this->byLinkText("More");
|
||||
$this->moveto($more);
|
||||
$this->_helper->waitForElement("byLinkText", "Settings")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath", "//a[@class='tabactive' and contains(., 'Settings')]"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether hiding a database works or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testHideDatabase()
|
||||
{
|
||||
$this->byLinkText("Features")->click();
|
||||
|
||||
$this->_helper->waitForElement("byId", "Servers-1-hide_db")
|
||||
->value($this->_dbname);
|
||||
$this->byName("submit_save")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Configuration has been saved')]"
|
||||
);
|
||||
$this->assertFalse(
|
||||
$this->_helper->isElementPresent("byLinkText", $this->_dbname)
|
||||
);
|
||||
|
||||
$this->byCssSelector("a[href='#Servers-1-hide_db']")->click();
|
||||
$this->byName("submit_save")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Configuration has been saved')]"
|
||||
);
|
||||
$this->assertTrue(
|
||||
$this->_helper->isElementPresent("byLinkText", $this->_dbname)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether the various settings tabs are displayed when clicked
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testSettingsTabsAreDisplayed()
|
||||
{
|
||||
$this->byLinkText("SQL queries")->click();
|
||||
$this->_helper->waitForElement('byClassName', 'tabs');
|
||||
|
||||
$this->byLinkText("SQL Query box")->click();
|
||||
$this->assertTrue(
|
||||
$this->byId("Sql_box")->displayed()
|
||||
);
|
||||
$this->assertFalse(
|
||||
$this->byId("Sql_queries")->displayed()
|
||||
);
|
||||
|
||||
$this->byCssSelector("a[href='#Sql_queries']")->click();
|
||||
$this->assertFalse(
|
||||
$this->byId("Sql_box")->displayed()
|
||||
);
|
||||
$this->assertTrue(
|
||||
$this->byId("Sql_queries")->displayed()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if hiding the logo works or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testHideLogo()
|
||||
{
|
||||
$this->byLinkText("Navigation panel")->click();
|
||||
|
||||
$this->_helper->waitForElement("byName", "NavigationDisplayLogo")
|
||||
->click();
|
||||
$this->byName("submit_save")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Configuration has been saved')]"
|
||||
);
|
||||
$this->assertFalse(
|
||||
$this->_helper->isElementPresent("byId", "imgpmalogo")
|
||||
);
|
||||
|
||||
$this->byCssSelector("a[href='#NavigationDisplayLogo']")->click();
|
||||
$this->byName("submit_save")->click();
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Configuration has been saved')]"
|
||||
);
|
||||
$this->assertTrue(
|
||||
$this->_helper->isElementPresent("byId", "imgpmalogo")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tear Down function for test cases
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
$this->_helper->dbQuery('DROP DATABASE IF EXISTS ' . $this->_dbname);
|
||||
}
|
||||
|
||||
}
|
||||
@ -171,7 +171,7 @@ class PmaSeleniumTableBrowseTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
{
|
||||
$this->byCssSelector(
|
||||
"table#table_results tbody tr:nth-child(2) td:nth-child(2) a"
|
||||
)->click();
|
||||
)->click();
|
||||
$this->_helper->waitForElement("byId", "insertForm");
|
||||
|
||||
$this->assertEquals(
|
||||
@ -253,7 +253,7 @@ class PmaSeleniumTableBrowseTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
{
|
||||
$this->byCssSelector(
|
||||
"table#table_results tbody tr:nth-child(3) td:nth-child(3) a"
|
||||
)->click();
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElement("byId", "insertForm");
|
||||
|
||||
|
||||
@ -146,7 +146,8 @@ class PmaSeleniumTableCreateTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
$this->assertFalse(
|
||||
$this->_helper->isElementPresent(
|
||||
'byCssSelector',
|
||||
'table#tablestructure tbody tr:nth-child(1) ul.table-structure-actions li.primary a'
|
||||
'table#tablestructure tbody tr:nth-child(1) "
|
||||
. "ul.table-structure-actions li.primary a'
|
||||
)
|
||||
);
|
||||
|
||||
@ -178,7 +179,8 @@ class PmaSeleniumTableCreateTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$this->assertFalse(
|
||||
$this->_helper->isElementPresent(
|
||||
'byCssSelector', 'css=ul.table-structure-actions:nth-child(2) li.primary a'
|
||||
'byCssSelector',
|
||||
'css=ul.table-structure-actions:nth-child(2) li.primary a'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ class PmaSeleniumTableInsertTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
// post
|
||||
$this->byCssSelector(
|
||||
"input[value=Go]"
|
||||
)->click();
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElementNotPresent("byId", "loading_parent");
|
||||
$ele = $this->_helper->waitForElement("byClassName", "success");
|
||||
@ -106,6 +106,11 @@ class PmaSeleniumTableInsertTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
$this->_assertDataPresent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert various data present in results table
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _assertDataPresent()
|
||||
{
|
||||
$this->byLinkText("Browse")->click();
|
||||
|
||||
@ -116,7 +116,8 @@ class PmaSeleniumTableOperationsTest extends PHPUnit_Extensions_Selenium2TestCas
|
||||
*/
|
||||
public function testMoveTable()
|
||||
{
|
||||
$this->byCssSelector("form#moveTableForm input[name='new_name']")->value("2");
|
||||
$this->byCssSelector("form#moveTableForm input[name='new_name']")
|
||||
->value("2");
|
||||
|
||||
$this->byXPath("(//input[@value='Go'])[2]")->click();
|
||||
|
||||
|
||||
@ -89,7 +89,8 @@ class PmaSeleniumTableStructureTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Table test_table has been altered successfully')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Table test_table has been altered successfully')]"
|
||||
);
|
||||
|
||||
$this->byLinkText("Structure")->click();
|
||||
@ -124,7 +125,8 @@ class PmaSeleniumTableStructureTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Table test_table has been altered successfully')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Table test_table has been altered successfully')]"
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
@ -142,16 +144,18 @@ class PmaSeleniumTableStructureTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
{
|
||||
$this->byCssSelector('label[for=checkbox_row_2]')->click();
|
||||
$this->byCssSelector('label[for=checkbox_row_3]')->click();
|
||||
$this->byXPath("//button[@class='mult_submit' and contains(., 'Drop')]")->click();
|
||||
$this->byXPath(
|
||||
"//button[@class='mult_submit' and contains(., 'Drop')]"
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElement(
|
||||
"byCssSelector", "input[id='buttonYes']"
|
||||
)
|
||||
->click();
|
||||
)->click();
|
||||
|
||||
$this->_helper->waitForElement(
|
||||
"byXPath",
|
||||
"//div[@class='success' and contains(., 'Your SQL query has been executed successfully')]"
|
||||
"//div[@class='success' and contains(., "
|
||||
. "'Your SQL query has been executed successfully')]"
|
||||
);
|
||||
|
||||
$this->assertFalse(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user