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 4EB6410748 for ; Mon, 24 Nov 2014 19:10:43 +0000 (UTC) Received: (qmail 92389 invoked by uid 500); 24 Nov 2014 19:10:43 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 92341 invoked by uid 500); 24 Nov 2014 19:10:43 -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 92332 invoked by uid 99); 24 Nov 2014 19:10:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Nov 2014 19:10:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CD560A173B4; Mon, 24 Nov 2014 19:10: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: <40b7dc996bae479381a5aa2dbd4d12f8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: fauxton commit: updated refs/heads/master to 155d898 Date: Mon, 24 Nov 2014 19:10:42 +0000 (UTC) Repository: couchdb-fauxton Updated Branches: refs/heads/master 84e6d87b2 -> 155d898d9 Nightwatch test to test lookahead component Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/155d898d Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/155d898d Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/155d898d Branch: refs/heads/master Commit: 155d898d9c400a98d9cd680f7ebbec2d682db80d Parents: 84e6d87 Author: Benjamin Keen Authored: Mon Nov 17 17:06:26 2014 -0800 Committer: Benjamin Keen Committed: Mon Nov 24 11:09:58 2014 -0800 ---------------------------------------------------------------------- .../switchDatabaseViaLookaheadTray.js | 40 ++++++++++++++++++++ .../custom-commands/closeNotification.js | 10 +++++ .../custom-commands/loginToGUI.js | 3 +- 3 files changed, 51 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/155d898d/app/addons/documents/tests/nightwatch/switchDatabaseViaLookaheadTray.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/switchDatabaseViaLookaheadTray.js b/app/addons/documents/tests/nightwatch/switchDatabaseViaLookaheadTray.js new file mode 100644 index 0000000..cc2b0dc --- /dev/null +++ b/app/addons/documents/tests/nightwatch/switchDatabaseViaLookaheadTray.js @@ -0,0 +1,40 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +module.exports = { + 'Confirm switching databases via lookahead tray': function (client) { + var waitTime = 8000, + newDatabaseName = client.globals.testDatabaseName, + secondDatabaseName = newDatabaseName + "2", + baseUrl = client.globals.baseUrl; + + client + .loginToGUI() + + // create the second database + .createDatabase(secondDatabaseName) + + // now select the first database, and select the second db from the lookahead tray + .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs') + .waitForElementPresent('#breadcrumbs .lookahead-tray-link', waitTime, false) + .click('#breadcrumbs .lookahead-tray-link') + .setValue('#breadcrumbs .search-autocomplete', [secondDatabaseName, client.Keys.ENTER]) + .getText('body', function (result) { + + // check the breadcrumb title is now the second database name. That indicates a successful redirect + client.assert.containsText("#breadcrumbs .lookahead-tray-link", secondDatabaseName); + }) + + .deleteDatabase(secondDatabaseName) + .end(); + } +}; http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/155d898d/test/nightwatch_tests/custom-commands/closeNotification.js ---------------------------------------------------------------------- diff --git a/test/nightwatch_tests/custom-commands/closeNotification.js b/test/nightwatch_tests/custom-commands/closeNotification.js new file mode 100644 index 0000000..77f8c58 --- /dev/null +++ b/test/nightwatch_tests/custom-commands/closeNotification.js @@ -0,0 +1,10 @@ +exports.command = function () { + var waitTime = 8000, + client = this; + + client + .waitForElementPresent('#global-notifications button.close', waitTime, false) + .click('#global-notifications button.close'); + + return this; +}; http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/155d898d/test/nightwatch_tests/custom-commands/loginToGUI.js ---------------------------------------------------------------------- diff --git a/test/nightwatch_tests/custom-commands/loginToGUI.js b/test/nightwatch_tests/custom-commands/loginToGUI.js index 7b4db79..ee2917c 100644 --- a/test/nightwatch_tests/custom-commands/loginToGUI.js +++ b/test/nightwatch_tests/custom-commands/loginToGUI.js @@ -10,8 +10,7 @@ exports.command = function () { .waitForElementPresent('#username', 8000, false) .setValue('#username', ['tester']) .setValue('#password', ['testerpass', client.Keys.ENTER]) - .waitForElementVisible('#global-notifications', 8000, false) - .click('#global-notifications button.close') + .closeNotification() .waitForElementPresent('#jump-to-db', 8000, false); return this;