make other test green, fix things that came up while running the tests
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/8a650dc3 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/8a650dc3 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/8a650dc3 Branch: refs/heads/doc-design Commit: 8a650dc34814c5e99c9809f84effaf663324777a Parents: 5d4c7f9 Author: Robert Kowalski <[email protected]> Authored: Wed Nov 19 15:52:04 2014 +0100 Committer: Robert Kowalski <[email protected]> Committed: Fri Nov 21 11:49:07 2014 +0100 ---------------------------------------------------------------------- app/addons/documents/assets/less/documents.less | 2 ++ .../tests/nightwatch/deletesDocument.js | 11 +++--- app/addons/documents/views.js | 35 +++----------------- test/nightwatch_tests/nightwatch.json | 5 ++- 4 files changed, 16 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8a650dc3/app/addons/documents/assets/less/documents.less ---------------------------------------------------------------------- diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less index 91d1c32..8c6739c 100644 --- a/app/addons/documents/assets/less/documents.less +++ b/app/addons/documents/assets/less/documents.less @@ -170,6 +170,8 @@ button.string-edit[disabled] { label.label-checkbox-doclist { // https://code.google.com/p/chromium/issues/detail?id=411065 -webkit-user-select: none; + height: 1px; + width: 1px; } /* checkboxes in doc-list */ label.label-checkbox-doclist:before { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8a650dc3/app/addons/documents/tests/nightwatch/deletesDocument.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/deletesDocument.js b/app/addons/documents/tests/nightwatch/deletesDocument.js index 733c5cc..b4fb10d 100644 --- a/app/addons/documents/tests/nightwatch/deletesDocument.js +++ b/app/addons/documents/tests/nightwatch/deletesDocument.js @@ -21,13 +21,14 @@ module.exports = { .loginToGUI() .createDocument(newDocumentName, newDatabaseName) .url(baseUrl) - .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime, false) - .pause(1000) + .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime) .click('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]') - .waitForElementPresent('[data-id="'+newDocumentName+'"] .btn.btn-small.btn-danger.delete', waitTime, false) - .execute('$("[data-id=\''+newDocumentName+'\'] .btn.btn-small.btn-danger.delete").click();') + .waitForElementVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime) + .click('label[for="checkbox-' + newDocumentName + '"]') + .waitForElementPresent('.js-bulk-delete:not(.disabled)', waitTime) + .click('button.js-bulk-delete') .acceptAlert() - .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false) + .waitForElementVisible('#global-notifications .alert.alert-info', waitTime) .url(baseUrl+'/'+newDatabaseName+'/_all_docs') .waitForElementPresent('pre', waitTime, false) .getText('pre',function (result) { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8a650dc3/app/addons/documents/views.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js index 8cb348f..903ca4e 100644 --- a/app/addons/documents/views.js +++ b/app/addons/documents/views.js @@ -184,7 +184,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) }, events: { - "click button.delete": "destroy", "dblclick pre.prettyprint": "edit" }, @@ -209,36 +208,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) edit: function(event) { event.preventDefault(); FauxtonAPI.navigate("#" + this.model.url('web-index')); - }, - - destroy: function(event) { - event.preventDefault(); - var that = this; - - if (!window.confirm("Are you sure you want to delete this doc?")) { - return false; - } - - this.model.destroy().then(function(resp) { - FauxtonAPI.addNotification({ - msg: "Successfully deleted your doc", - clear: true - }); - that.$el.fadeOut(function () { - that.remove(); - }); - - that.model.collection.remove(that.model.id); - if (!!that.model.id.match('_design')) { - FauxtonAPI.triggerRouteEvent('reloadDesignDocs'); - } - }, function(resp) { - FauxtonAPI.addNotification({ - msg: "Failed to deleted your doc!", - type: "error", - clear: true - }); - }); } }); @@ -343,6 +312,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) }.bind(this))).done(function () { this.pagination.updatePerPage(parseInt(this.$('#select-per-page :selected').val(), 10)); FauxtonAPI.triggerRouteEvent('perPageChange', this.pagination.documentsLeftToFetch()); + FauxtonAPI.addNotification({ + msg: 'Successfully deleted your docs', + clear: true + }); }.bind(this)); }, http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8a650dc3/test/nightwatch_tests/nightwatch.json ---------------------------------------------------------------------- diff --git a/test/nightwatch_tests/nightwatch.json b/test/nightwatch_tests/nightwatch.json index 2ad9441..1f74596 100644 --- a/test/nightwatch_tests/nightwatch.json +++ b/test/nightwatch_tests/nightwatch.json @@ -44,7 +44,10 @@ "desiredCapabilities" : { "browserName" : "chrome", "javascriptEnabled" : true, - "acceptSslCerts" : true + "acceptSslCerts" : true, + "chromeOptions" : { + "args" : ["window-size=1400,900"] + } } },
