Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F88D18137 for ; Fri, 15 May 2015 17:39:42 +0000 (UTC) Received: (qmail 21751 invoked by uid 500); 15 May 2015 17:39:42 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 21703 invoked by uid 500); 15 May 2015 17:39:42 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 21693 invoked by uid 99); 15 May 2015 17:39:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2015 17:39:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4A569E179F; Fri, 15 May 2015 17:39:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: benkeen@apache.org To: commits@couchdb.apache.org Message-Id: <6ebdf8b08da5434e99e709edf91cfa56@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: fauxton commit: updated refs/heads/master to 78ec2a6 Date: Fri, 15 May 2015 17:39:42 +0000 (UTC) Repository: couchdb-fauxton Updated Branches: refs/heads/master ceb51a738 -> 78ec2a613 General NW robustness test PR This ticket illustrated there are numerous buggy tests that fail erratically from time to time: This is a general ticket to improve the robustness of the NW tests. I'm going to re-run it again and again and fix whatever comes up. - bulkDelete extra check for DOM content - deleteDatabaseModal.js fix: now ensures the test to confirm the modal DOM element exists PRIOR to clicking the delete menu item. - removing test comment - tweaks to paginateView.js - ensuring db page is fully loaded before all tests start - mango test fixes Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/78ec2a61 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/78ec2a61 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/78ec2a61 Branch: refs/heads/master Commit: 78ec2a613b754b206051f00a23eff8c494bc7a8a Parents: ceb51a7 Author: Ben Keen Authored: Thu May 14 16:22:05 2015 -0700 Committer: Ben Keen Committed: Fri May 15 09:36:43 2015 -0700 ---------------------------------------------------------------------- .../databases/tests/nightwatch/deletesDatabase.js | 6 +++--- .../tests/nightwatch/deletesDatabaseSpecialChars.js | 4 ++-- app/addons/documents/tests/nightwatch/bulkDelete.js | 8 ++++++++ .../tests/nightwatch/deleteDatabaseModal.js | 2 +- app/addons/documents/tests/nightwatch/mangoIndex.js | 4 +++- .../documents/tests/nightwatch/mangoIndexList.js | 2 ++ .../documents/tests/nightwatch/paginateView.js | 15 +++++++++++++++ app/addons/documents/tests/nightwatch/viewCreate.js | 12 +++++++++--- .../custom-commands/auth/loginToGUI.js | 6 +++++- 9 files changed, 48 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/databases/tests/nightwatch/deletesDatabase.js ---------------------------------------------------------------------- diff --git a/app/addons/databases/tests/nightwatch/deletesDatabase.js b/app/addons/databases/tests/nightwatch/deletesDatabase.js index b47c43b..7e2d2fa 100644 --- a/app/addons/databases/tests/nightwatch/deletesDatabase.js +++ b/app/addons/databases/tests/nightwatch/deletesDatabase.js @@ -20,12 +20,12 @@ module.exports = { .loginToGUI() .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs') .waitForElementPresent('#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog', waitTime, false) - .click("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog") + .clickWhenVisible("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog", waitTime, false) .waitForElementPresent('#header-dropdown-menu .fonticon-trash', waitTime, false) - .click('#header-dropdown-menu .fonticon-trash') .waitForElementPresent('#delete-db-modal', waitTime, false) + .clickWhenVisible('#header-dropdown-menu .fonticon-trash', waitTime, false) .waitForElementVisible('#db-name', waitTime, false) - .click('#db-name') + .clickWhenVisible('#db-name', waitTime, false) .setValue('input#db-name', [newDatabaseName, client.Keys.ENTER] ) .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false) .url(baseUrl + '/_all_dbs') http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js ---------------------------------------------------------------------- diff --git a/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js b/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js index b233d96..61f0535 100644 --- a/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js +++ b/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js @@ -21,11 +21,11 @@ module.exports = { .loginToGUI() .url(baseUrl + '/#/database/' + encodeURIComponent(newDatabaseName) + '/_all_docs') .waitForElementPresent('#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog', waitTime, false) - .click("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog") + .clickWhenVisible("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog", waitTime, false) .waitForElementPresent('#header-dropdown-menu .fonticon-trash', waitTime, false) .clickWhenVisible('#header-dropdown-menu .fonticon-trash', waitTime, false) .waitForElementPresent('#db-name', waitTime, false) - .click('#db-name') + .clickWhenVisible('#db-name', waitTime, false) .setValue('input#db-name', [newDatabaseName, client.Keys.ENTER]) .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false) .url(baseUrl + '/_all_dbs') http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/documents/tests/nightwatch/bulkDelete.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/bulkDelete.js b/app/addons/documents/tests/nightwatch/bulkDelete.js index 57676a5..a729aad 100644 --- a/app/addons/documents/tests/nightwatch/bulkDelete.js +++ b/app/addons/documents/tests/nightwatch/bulkDelete.js @@ -25,6 +25,10 @@ module.exports = { .createDocument(newDocumentName2, newDatabaseName) .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs') .waitForElementPresent('.control-toggle-alternative-header', waitTime, false) + + // ensures page content has loaded before proceeding + .waitForElementVisible('.prettyprint', waitTime, false) + .clickWhenVisible('.control-toggle-alternative-header') .waitForElementPresent('.control-select-all', waitTime, false) .clickWhenVisible('.control-select-all', waitTime, false) @@ -54,6 +58,10 @@ module.exports = { .createManyDocuments(25, newDatabaseName) .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs') .waitForElementPresent('.control-toggle-alternative-header', waitTime, false) + + // ensures page content has loaded before proceeding + .waitForElementVisible('.prettyprint', waitTime, false) + .clickWhenVisible('.control-toggle-alternative-header') .waitForElementPresent('.control-select-all', waitTime, false) .clickWhenVisible('.control-select-all', waitTime, false) http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js b/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js index e828b7c..2995d39 100644 --- a/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js +++ b/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js @@ -39,8 +39,8 @@ module.exports = { .waitForElementPresent("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog", waitTime, false) .clickWhenVisible('#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog', waitTime, false) .waitForElementPresent("#header-dropdown-menu .fonticon-trash", waitTime, false) - .clickWhenVisible('#header-dropdown-menu .fonticon-trash', waitTime, false) .waitForElementPresent('#delete-db-modal', waitTime, false) + .clickWhenVisible('#header-dropdown-menu .fonticon-trash', waitTime, false) .waitForElementVisible('input#db-name', waitTime, false) .assert.elementNotPresent('.warning') .end(); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/documents/tests/nightwatch/mangoIndex.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/mangoIndex.js b/app/addons/documents/tests/nightwatch/mangoIndex.js index f308ba5..b6d4018 100644 --- a/app/addons/documents/tests/nightwatch/mangoIndex.js +++ b/app/addons/documents/tests/nightwatch/mangoIndex.js @@ -37,7 +37,9 @@ module.exports = { ') .execute('$(".save")[0].scrollIntoView();') .click('button.btn-success.save') - + .waitForAttribute('#global-notifications', 'textContent', function (successAlertText) { + return (/Index created/).test(successAlertText); + }) .waitForElementNotVisible('.global-notification', waitTime, false) .url(baseUrl + '/#/database/' + newDatabaseName + '/_indexlist') .waitForElementPresent('.prettyprint', waitTime, false) http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/documents/tests/nightwatch/mangoIndexList.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/mangoIndexList.js b/app/addons/documents/tests/nightwatch/mangoIndexList.js index 7ed4af2..95a9e1c 100644 --- a/app/addons/documents/tests/nightwatch/mangoIndexList.js +++ b/app/addons/documents/tests/nightwatch/mangoIndexList.js @@ -22,7 +22,9 @@ module.exports = { .loginToGUI() .url(baseUrl + '/#/database/' + newDatabaseName + '/_indexlist') .waitForElementPresent('.prettyprint', waitTime, false) + .waitForElementVisible('.header-doc-id', waitTime, false) .assert.containsText('.header-doc-id', '_all_docs') + .waitForElementVisible('#doc-list', waitTime, false) .assert.containsText('#doc-list', 'ente_ente_mango_ananas') .end(); } http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/documents/tests/nightwatch/paginateView.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/paginateView.js b/app/addons/documents/tests/nightwatch/paginateView.js index bcbca08..d7143ca 100644 --- a/app/addons/documents/tests/nightwatch/paginateView.js +++ b/app/addons/documents/tests/nightwatch/paginateView.js @@ -20,12 +20,18 @@ module.exports = { client .populateDatabase(newDatabaseName) .loginToGUI() + + // wait for the db page to fully load + .waitForElementVisible('#dashboard-content table.databases', waitTime, false) + .url(baseUrl + '/#/database/' + newDatabaseName + '/_design/keyview/_view/keyview') + .waitForElementPresent('#toggle-query', waitTime, false) // ensure the page content has loaded .waitForElementPresent('.prettyprint', waitTime, false) + .waitForElementPresent('#select-per-page', waitTime, false) .clickWhenVisible('#select-per-page', waitTime, false) // hack to get select working by clicking on it and using keyboard to select @@ -49,6 +55,10 @@ module.exports = { client .populateDatabase(newDatabaseName) .loginToGUI() + + // wait for the db page to fully load + .waitForElementVisible('#dashboard-content table.databases', waitTime, false) + .url(baseUrl + '/#/database/' + newDatabaseName + '/_design/keyview/_view/keyview') .waitForElementPresent('#toggle-query', waitTime, false) @@ -59,6 +69,7 @@ module.exports = { // http://www.w3.org/TR/2012/WD-webdriver-20120710/ .keys(['\uE013', '\uE006']) + .waitForElementPresent('#next', waitTime, false) .clickWhenVisible('#next', waitTime, false) .waitForElementNotPresent('div[data-id="document_1"]', waitTime) .waitForElementNotPresent('.loading-lines', waitTime, false) @@ -78,6 +89,10 @@ module.exports = { client .populateDatabase(newDatabaseName) .loginToGUI() + + // wait for the db page to fully load + .waitForElementVisible('#dashboard-content table.databases', waitTime, false) + .url(baseUrl + '/#/database/' + newDatabaseName + '/_design/keyview/_view/keyview') .waitForElementPresent('#toggle-query', waitTime, false) http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/app/addons/documents/tests/nightwatch/viewCreate.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/viewCreate.js b/app/addons/documents/tests/nightwatch/viewCreate.js index ed1e2a3..45960d5 100644 --- a/app/addons/documents/tests/nightwatch/viewCreate.js +++ b/app/addons/documents/tests/nightwatch/viewCreate.js @@ -27,7 +27,8 @@ module.exports = { editor.getSession().setValue("function (doc) { emit(\'hasehase\'); }");\ ') .execute('$(".save")[0].scrollIntoView();') - .click('button.btn.btn-success.save') + .waitForElementPresent('button.btn.btn-success.save', waitTime, false) + .clickWhenVisible('button.btn.btn-success.save', waitTime, false) .waitForElementPresent('.prettyprint', waitTime, false) .waitForElementNotPresent('.loading-lines', waitTime, false) .assert.containsText('.prettyprint', 'hasehase') @@ -42,6 +43,7 @@ module.exports = { /*jshint multistr: true */ openDifferentDropdownsAndClick(client, '#header-dropdown-menu') .waitForElementPresent('#new-ddoc', waitTime, false) + .waitForElementVisible('#new-ddoc', waitTime, false) .setValue('#new-ddoc', 'test_design_doc-selenium-2') .clearValue('#index-name') .setValue('#index-name', 'gaenseindex') @@ -65,6 +67,8 @@ module.exports = { /*jshint multistr: true */ openDifferentDropdownsAndClick(client, '#nav-header-testdesigndoc') + .waitForElementPresent('#index-name', waitTime, false) + .waitForElementVisible('#index-name', waitTime, false) .clearValue('#index-name') .setValue('#index-name', 'test-new-view') .sendKeys("textarea.ace_text-input", client.Keys.Enter) @@ -101,7 +105,9 @@ function openDifferentDropdownsAndClick (client, dropDownElement) { .populateDatabase(newDatabaseName) .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs') .waitForElementPresent(dropDownElement, waitTime, false) - .click(dropDownElement + ' a') - .click(dropDownElement + ' a[href*="new_view"]') + .waitForElementPresent(dropDownElement + ' a', waitTime, false) + .clickWhenVisible(dropDownElement + ' a', waitTime, false) + .waitForElementPresent(dropDownElement + ' a[href*="new_view"]', waitTime, false) + .clickWhenVisible(dropDownElement + ' a[href*="new_view"]', waitTime, false) .waitForElementPresent('.editor-wrapper', waitTime, false); } http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/78ec2a61/test/nightwatch_tests/custom-commands/auth/loginToGUI.js ---------------------------------------------------------------------- diff --git a/test/nightwatch_tests/custom-commands/auth/loginToGUI.js b/test/nightwatch_tests/custom-commands/auth/loginToGUI.js index d0de106..317a5a4 100644 --- a/test/nightwatch_tests/custom-commands/auth/loginToGUI.js +++ b/test/nightwatch_tests/custom-commands/auth/loginToGUI.js @@ -26,7 +26,11 @@ exports.command = function () { .setValue('#username', [username]) .setValue('#password', [password, client.Keys.ENTER]) .closeNotification() - .waitForElementPresent('#jump-to-db', waitTime, false); + .waitForElementPresent('#jump-to-db', waitTime, false) + + // important! wait for the db page to fully load. This was the cause of many bugs + .waitForElementVisible('#dashboard-content table.databases', waitTime, false); + return this; };