Repository: couchdb-fauxton Updated Branches: refs/heads/master 3224f8b79 -> 27036e685
Continued nw test updates - tweaks createsDatabase.js to ensure page has fully loaded; changed notification selector - added global timeout to loginToGUI.js Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/27036e68 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/27036e68 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/27036e68 Branch: refs/heads/master Commit: 27036e6858e89f373aa893138763a85fc4109979 Parents: 3224f8b Author: Ben Keen <ben.k...@gmail.com> Authored: Tue Apr 7 17:22:57 2015 -0700 Committer: Ben Keen <ben.k...@gmail.com> Committed: Wed Apr 8 07:24:14 2015 -0700 ---------------------------------------------------------------------- app/addons/databases/tests/nightwatch/createsDatabase.js | 9 +++++++-- test/nightwatch_tests/custom-commands/auth/loginToGUI.js | 7 ++++--- 2 files changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/27036e68/app/addons/databases/tests/nightwatch/createsDatabase.js ---------------------------------------------------------------------- diff --git a/app/addons/databases/tests/nightwatch/createsDatabase.js b/app/addons/databases/tests/nightwatch/createsDatabase.js index 3cb043c..09ec328 100644 --- a/app/addons/databases/tests/nightwatch/createsDatabase.js +++ b/app/addons/databases/tests/nightwatch/createsDatabase.js @@ -20,13 +20,18 @@ module.exports = { .loginToGUI() .deleteDatabase(newDatabaseName) //need to delete the automatic database 'fauxton-selenium-tests' that has been set up before each test .url(baseUrl) + + // ensure the page has fully loaded + .waitForElementPresent('.databases.table', waitTime, false) + .waitForElementPresent('#add-new-database', waitTime, false) .clickWhenVisible('#add-new-database', waitTime, false) .pause(1000) .waitForElementVisible('#js-new-database-name', waitTime, false) .setValue('#js-new-database-name', [newDatabaseName]) - .click('#js-create-database') - .waitForElementVisible('#global-notifications div.alert-success', waitTime, false) + + .clickWhenVisible('#js-create-database', waitTime, false) + .waitForElementVisible('#global-notifications .alert.alert-success', waitTime, false) .url(baseUrl + '/_all_dbs') .waitForElementVisible('html', waitTime, false) .getText('html', function (result) { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/27036e68/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 f43cfde..d0de106 100644 --- a/test/nightwatch_tests/custom-commands/auth/loginToGUI.js +++ b/test/nightwatch_tests/custom-commands/auth/loginToGUI.js @@ -13,19 +13,20 @@ exports.command = function () { var client = this, + waitTime = client.globals.maxWaitTime, baseUrl = client.globals.test_settings.launch_url, username = client.globals.test_settings.fauxton_username, password = client.globals.test_settings.password; client .url(baseUrl + '/#login') - .waitForElementPresent('a[href="#login"]', 15000, false) + .waitForElementPresent('a[href="#login"]', waitTime, false) .click('a[href="#login"]') - .waitForElementPresent('#username', 10000, false) + .waitForElementPresent('#username', waitTime, false) .setValue('#username', [username]) .setValue('#password', [password, client.Keys.ENTER]) .closeNotification() - .waitForElementPresent('#jump-to-db', 10000, false); + .waitForElementPresent('#jump-to-db', waitTime, false); return this; };