couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benk...@apache.org
Subject fauxton commit: updated refs/heads/master to 155d898
Date Mon, 24 Nov 2014 19:10:42 GMT
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 <ben.keen@gmail.com>
Authored: Mon Nov 17 17:06:26 2014 -0800
Committer: Benjamin Keen <ben.keen@gmail.com>
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;


Mime
View raw message