Waiting for ajax_message_num_1 works only on first AJAX request and we're doing more of them. This should remove need for many consequent sleeps as we were actually not properly waiting for element. Also it's better to wrap this logic in separate method as it is used in many places in the code. Signed-off-by: Michal Čihař <michal@cihar.com>
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
/**
|
|
* Selenium TestCase for SQL query window related tests
|
|
*
|
|
* @package PhpMyAdmin-test
|
|
* @subpackage Selenium
|
|
*/
|
|
|
|
require_once 'TestBase.php';
|
|
|
|
/**
|
|
* PmaSeleniumXSSTest class
|
|
*
|
|
* @package PhpMyAdmin-test
|
|
* @subpackage Selenium
|
|
* @group selenium
|
|
*/
|
|
class PMA_SeleniumXSSTest extends PMA_SeleniumBase
|
|
{
|
|
public function setUpPage()
|
|
{
|
|
parent::setUpPage();
|
|
$this->login();
|
|
}
|
|
/**
|
|
* Tests the SQL query tab with a null query
|
|
*
|
|
* @return void
|
|
*
|
|
* @group large
|
|
*/
|
|
public function testQueryTabWithNullValue()
|
|
{
|
|
if (mb_strtolower($this->getBrowser()) == 'safari') {
|
|
$this->markTestSkipped('Alerts not supported on Safari browser.');
|
|
}
|
|
$this->waitForElement('byPartialLinkText', "SQL")->click();
|
|
$this->waitAjax();
|
|
|
|
$this->waitForElement("byId", "queryboxf");
|
|
$this->byId("button_submit_query")->click();
|
|
$this->assertEquals("Missing value in the form!", $this->alertText());
|
|
}
|
|
}
|