Skip to content

Commit

Permalink
Merge branch 'master' of github.com:phpmyadmin/phpmyadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Aug 21, 2017
2 parents 87ec560 + dac19fb commit 02f8195
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 18 deletions.
4 changes: 1 addition & 3 deletions templates/columns_definitions/column_default.phtml
Expand Up @@ -39,9 +39,7 @@ if ($type_upper == 'BIT') {
<textarea name="field_default_value[<?= $columnNumber; ?>]"
cols="15"
class="textfield
default_value">
<?= htmlspecialchars($defaultValue); ?>
</textarea>
default_value"><?= htmlspecialchars($defaultValue); ?></textarea>
<?php else: ?>
<input type="text"
name="field_default_value[<?= $columnNumber; ?>]"
Expand Down
2 changes: 1 addition & 1 deletion test/selenium/PmaSeleniumCreateRemoveUserTest.php
Expand Up @@ -122,8 +122,8 @@ public function testCreateRemoveUser()
"(//input[@name='selected_usr[]'])[@value='" . $temp . "']"
)->click();

$this->byId("checkbox_drop_users_db")->click();
$this->scrollIntoView('fieldset_delete_user_footer');
$this->byId("checkbox_drop_users_db")->click();

$this->byId("buttonGo")->click();
$this->waitForElement("byCssSelector", "button.submitOK")->click();
Expand Down
27 changes: 27 additions & 0 deletions test/selenium/PmaSeleniumDbEventsTest.php
Expand Up @@ -124,6 +124,30 @@ public function testAddEvent()
$this->byName("item_ends")->click();
$this->keys(date('Y-m-d', strtotime('+1 day')));

// Dynamic wait, retry if complete text not typed
$this->waitUntil(function () {
$startDate = date('Y-m-d', strtotime('-1 day'));
if ($this->byName('item_starts')->value() === $startDate) {
return true;
}

$this->byName("item_starts")->clear();
$this->byName("item_starts")->click();
$this->keys($startDate);
return null;
}, 5000);
$this->waitUntil(function () {
$endDate = date('Y-m-d', strtotime('+1 day'));
if ($this->byName('item_ends')->value() === $endDate) {
return true;
}

$this->byName("item_ends")->clear();
$this->byName("item_ends")->click();
$this->keys($endDate);
return null;
}, 5000);

$ele = $this->waitForElement('byName', "item_interval_value");
$ele->value('1');

Expand All @@ -142,6 +166,9 @@ public function testAddEvent()
'//div[@id=\'alertLabel\' and not(contains(@style,\'display: none;\'))]'
);

// Refresh the page
$this->url($this->url());

$this->assertTrue(
$this->isElementPresent(
'byXPath',
Expand Down
25 changes: 11 additions & 14 deletions test/selenium/PmaSeleniumTableBrowseTest.php
Expand Up @@ -53,6 +53,17 @@ public function setUpPage()

$this->login();
$this->navigateTable('test_table');

$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
usleep(1000000); // let the page load

// Dynamic wait
$this->waitUntil(function () {
if (trim($this->getCellByTableClass('table_results', 1, 5)) === '1') {
return true;
}
return null;
}, 5000);
}

/**
Expand All @@ -64,9 +75,6 @@ public function setUpPage()
*/
public function testSortRecords()
{
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
usleep(1000000); // let the page load

// case 1
$this->byPartialLinkText("name")->click();
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
Expand Down Expand Up @@ -158,9 +166,6 @@ public function testSortRecords()
*/
public function testChangeRecords()
{
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
$this->sleep();

$ele = $this->byCssSelector(
"table.table_results tbody tr:nth-child(2) td:nth-child(2)"
);
Expand Down Expand Up @@ -223,7 +228,6 @@ public function testChangeRecords()
*/
public function testChangeRecordsByDoubleClick()
{
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
$element = $this->byCssSelector(
"table.table_results tbody tr:nth-child(1) td:nth-child(6)"
);
Expand Down Expand Up @@ -267,9 +271,6 @@ public function testChangeRecordsByDoubleClick()
*/
public function testCopyRecords()
{
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
$this->sleep();

$ele = $this->byCssSelector(
"table.table_results tbody tr:nth-child(3) td:nth-child(3)"
);
Expand Down Expand Up @@ -323,7 +324,6 @@ public function testCopyRecords()
*/
public function testSearchRecords()
{
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
$this->expandMore();

$this->byPartialLinkText("Search")->click();
Expand Down Expand Up @@ -362,9 +362,6 @@ public function testSearchRecords()
*/
public function testDeleteRecords()
{
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
usleep(1000000);

$this->byId("id_rows_to_delete1_left")->click();
$this->byId("id_rows_to_delete2_left")->click();

Expand Down
8 changes: 8 additions & 0 deletions test/selenium/PmaSeleniumTableStructureTest.php
Expand Up @@ -56,6 +56,14 @@ public function setUpPage()
$this->waitForElementNotPresent('byId', 'ajax_message_num_1');
$this->waitForElement("byId", "tablestructure");
usleep(1000000);

// Dynamic wait
$this->waitUntil(function () {
if (trim($this->getCellByTableId('tablestructure', 2, 2)) === '2') {
return true;
}
return null;
}, 5000);
}

/**
Expand Down

0 comments on commit 02f8195

Please sign in to comment.