From ea6f79bf21187580234c459710f235bd6506aae5 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Thu, 17 Aug 2017 17:29:26 +0530 Subject: [PATCH 1/6] Fix createRemoveUser and TableBrowse::DeleteRecords Signed-off-by: Deven Bansod --- test/selenium/PmaSeleniumCreateRemoveUserTest.php | 2 +- test/selenium/PmaSeleniumTableBrowseTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/selenium/PmaSeleniumCreateRemoveUserTest.php b/test/selenium/PmaSeleniumCreateRemoveUserTest.php index 815a848e0b..f35ab68353 100644 --- a/test/selenium/PmaSeleniumCreateRemoveUserTest.php +++ b/test/selenium/PmaSeleniumCreateRemoveUserTest.php @@ -122,8 +122,8 @@ class PMA_SeleniumCreateRemoveUserTest extends PMA_SeleniumBase "(//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(); diff --git a/test/selenium/PmaSeleniumTableBrowseTest.php b/test/selenium/PmaSeleniumTableBrowseTest.php index f3cd238dca..12627db3c2 100644 --- a/test/selenium/PmaSeleniumTableBrowseTest.php +++ b/test/selenium/PmaSeleniumTableBrowseTest.php @@ -363,7 +363,7 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase public function testDeleteRecords() { $this->waitForElementNotPresent('byId', 'ajax_message_num_1'); - usleep(1000000); + usleep(2000000); $this->byId("id_rows_to_delete1_left")->click(); $this->byId("id_rows_to_delete2_left")->click(); From 7021aac7ce7752feb7435d58c60a38a42288c470 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Thu, 17 Aug 2017 17:49:43 +0530 Subject: [PATCH 2/6] Try using dynamic wait in TableBrowse and TableStructure Signed-off-by: Deven Bansod --- test/selenium/PmaSeleniumTableBrowseTest.php | 25 ++++++++----------- .../PmaSeleniumTableStructureTest.php | 8 ++++++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/test/selenium/PmaSeleniumTableBrowseTest.php b/test/selenium/PmaSeleniumTableBrowseTest.php index 12627db3c2..327e773884 100644 --- a/test/selenium/PmaSeleniumTableBrowseTest.php +++ b/test/selenium/PmaSeleniumTableBrowseTest.php @@ -53,6 +53,17 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase $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); } /** @@ -64,9 +75,6 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase */ 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'); @@ -158,9 +166,6 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase */ 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)" ); @@ -223,7 +228,6 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase */ 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)" ); @@ -267,9 +271,6 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase */ 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)" ); @@ -323,7 +324,6 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase */ public function testSearchRecords() { - $this->waitForElementNotPresent('byId', 'ajax_message_num_1'); $this->expandMore(); $this->byPartialLinkText("Search")->click(); @@ -362,9 +362,6 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase */ public function testDeleteRecords() { - $this->waitForElementNotPresent('byId', 'ajax_message_num_1'); - usleep(2000000); - $this->byId("id_rows_to_delete1_left")->click(); $this->byId("id_rows_to_delete2_left")->click(); diff --git a/test/selenium/PmaSeleniumTableStructureTest.php b/test/selenium/PmaSeleniumTableStructureTest.php index 253488b73b..5ed2064d79 100644 --- a/test/selenium/PmaSeleniumTableStructureTest.php +++ b/test/selenium/PmaSeleniumTableStructureTest.php @@ -56,6 +56,14 @@ class PMA_SeleniumTableStructureTest extends PMA_SeleniumBase $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); } /** From 26d80bd9758858b0fb97d40e8b57783014245919 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Fri, 18 Aug 2017 16:31:12 +0530 Subject: [PATCH 3/6] Fix DbEvents test Signed-off-by: Deven Bansod --- test/selenium/PmaSeleniumDbEventsTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/selenium/PmaSeleniumDbEventsTest.php b/test/selenium/PmaSeleniumDbEventsTest.php index ea1b952107..e956032890 100644 --- a/test/selenium/PmaSeleniumDbEventsTest.php +++ b/test/selenium/PmaSeleniumDbEventsTest.php @@ -124,6 +124,28 @@ class PMA_SeleniumDbEventsTest extends PMA_SeleniumBase $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")->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")->click(); + $this->keys($endDate); + return null; + }, 5000); + $ele = $this->waitForElement('byName', "item_interval_value"); $ele->value('1'); From 7c8e33b6570fb96bc2a81c8104b53b6135c75bb0 Mon Sep 17 00:00:00 2001 From: Neha Parihar Sinha Date: Sun, 20 Aug 2017 08:09:10 +0200 Subject: [PATCH 4/6] Fix #13593 : removed whitespace in textarea for column default value Signed-off-by: Neha Parihar Sinha --- templates/columns_definitions/column_default.phtml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/columns_definitions/column_default.phtml b/templates/columns_definitions/column_default.phtml index 34216148a2..a0390f315a 100644 --- a/templates/columns_definitions/column_default.phtml +++ b/templates/columns_definitions/column_default.phtml @@ -39,9 +39,7 @@ if ($type_upper == 'BIT') { + default_value"> Date: Sun, 20 Aug 2017 13:01:17 +0530 Subject: [PATCH 5/6] Fix another possible failure point in DbEvents - testAddEvent See: https://travis-ci.org/phpmyadmin/phpmyadmin/jobs/266409700 for example Signed-off-by: Deven Bansod --- test/selenium/PmaSeleniumDbEventsTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/selenium/PmaSeleniumDbEventsTest.php b/test/selenium/PmaSeleniumDbEventsTest.php index e956032890..544150a6ae 100644 --- a/test/selenium/PmaSeleniumDbEventsTest.php +++ b/test/selenium/PmaSeleniumDbEventsTest.php @@ -164,6 +164,9 @@ class PMA_SeleniumDbEventsTest extends PMA_SeleniumBase '//div[@id=\'alertLabel\' and not(contains(@style,\'display: none;\'))]' ); + // Refresh the page + $this->url($this->url()); + $this->assertTrue( $this->isElementPresent( 'byXPath', From 94d8d897ce53170e397abffcaf12c81cb5c4ff9a Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Sun, 20 Aug 2017 13:49:37 +0530 Subject: [PATCH 6/6] Clear input fields to avoid duplicate texts Signed-off-by: Deven Bansod --- test/selenium/PmaSeleniumDbEventsTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/selenium/PmaSeleniumDbEventsTest.php b/test/selenium/PmaSeleniumDbEventsTest.php index 544150a6ae..257caf170b 100644 --- a/test/selenium/PmaSeleniumDbEventsTest.php +++ b/test/selenium/PmaSeleniumDbEventsTest.php @@ -131,6 +131,7 @@ class PMA_SeleniumDbEventsTest extends PMA_SeleniumBase return true; } + $this->byName("item_starts")->clear(); $this->byName("item_starts")->click(); $this->keys($startDate); return null; @@ -141,6 +142,7 @@ class PMA_SeleniumDbEventsTest extends PMA_SeleniumBase return true; } + $this->byName("item_ends")->clear(); $this->byName("item_ends")->click(); $this->keys($endDate); return null;