Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/192#discussion_r21756201
--- Diff: app/addons/documents/tests/nightwatch/editDocumentsFromView.js ---
@@ -0,0 +1,55 @@
+// 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 = {
+ 'Edit is allowed from default Map Views' : function (client) {
+ var newDatabaseName = client.globals.testDatabaseName,
+ newDocumentName = '_design/abc',
+ baseUrl = client.globals.test_settings.launch_url,
+ ddocContents = {
+ "views": {
+ "evens": {
+ "map": "function (doc) { if (doc.number%2 === 0){
emit(doc._id, doc.number); } }",
+ "reduce" : "_count"
+ }
+ },
+ "language": "javascript"
+ };
+
+ client
+ .loginToGUI()
+ .createDocument(newDocumentName, newDatabaseName, ddocContents )
+ .populateDatabase(newDatabaseName)
+
+ //navigate to 'evens' view (declared above), then click on first
document's pencil icon
+ .clickWhenReady('#dashboard-content a[href="#/database/' +
newDatabaseName + '/_all_docs"]')
+ .clickWhenReady('#nav-header-abc')
+ .clickWhenReady('#nav-design-function-abcviews')
+ .clickWhenReady('#abc_evens')
+ .pause(1000) //why?
+
.clickWhenReady('a[href=\'#/database/fauxton-selenium-tests/document_10\']')
--- End diff --
it seems to be a bug in nightwatch, bumping nightwatch to `~0.5.35` solved
the issue for me and I was able to remove the `pause()`.
you can simplify the clickwhenreadycall to:
```
.clickWhenReady('a[href="#/database/fauxton-selenium-tests/document_10"]')
```
for better readability
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---