couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to fd67892
Date Thu, 14 Jan 2016 15:32:48 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master bfdbf1121 -> fd67892ab


add nightwatch test for include_docs in json view

PR: #604
PR-URL: https://github.com/apache/couchdb-fauxton/pull/604
Reviewed-By: Benjamin Keen <ben.keen@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/fd67892a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/fd67892a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/fd67892a

Branch: refs/heads/master
Commit: fd67892abc845ad5f24b3fc56e89e30c5e7c2e67
Parents: bfdbf11
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Thu Jan 14 11:01:18 2016 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Thu Jan 14 16:34:31 2016 +0100

----------------------------------------------------------------------
 .../documents/tests/nightwatch/jsonView.js      | 33 ++++++++++++++++++++
 1 file changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fd67892a/app/addons/documents/tests/nightwatch/jsonView.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/jsonView.js b/app/addons/documents/tests/nightwatch/jsonView.js
new file mode 100644
index 0000000..5e9fc82
--- /dev/null
+++ b/app/addons/documents/tests/nightwatch/jsonView.js
@@ -0,0 +1,33 @@
+module.exports = {
+
+  'Doc results: check ?include_docs=true returns doc content': function (client) {
+    var newDatabaseName = client.globals.testDatabaseName,
+        newDocumentName = 'bitterns',
+        baseUrl = client.globals.test_settings.launch_url;
+
+    var docContent = {
+      "species": "American Bittern",
+      "seen_general": "not as often as I'd like",
+      "seen_this_year": "*sigh*, no."
+    };
+
+    client
+      .createDocument(newDocumentName, newDatabaseName, docContent)
+      .loginToGUI()
+      .checkForDocumentCreated(newDocumentName)
+
+      .url(baseUrl + '#/database/' + newDatabaseName + '/_all_docs')
+      .waitForElementPresent('.doc-item', client.globals.maxWaitTime, false)
+      // by default include_docs is off, so check "American Bittern" doesn't exist in the
DOM
+      .getText('body', function (result) {
+        var birdNameNotPresent = result.value.indexOf('"American Bittern"') === -1;
+        this.verify.ok(birdNameNotPresent, 'Checking doc content doesn\'t show up in results.');
+      })
+
+      // now enable ?include_docs and try again
+      .url(baseUrl + '#/database/' + newDatabaseName + '/_all_docs?include_docs=true')
+      .waitForElementPresent('.prettyprint', client.globals.maxWaitTime, false)
+      .assert.containsText('.prettyprint', 'American Bittern')
+      .end();
+  }
+};


Mime
View raw message