couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michel...@apache.org
Subject fauxton commit: updated refs/heads/master to e508dad
Date Thu, 14 May 2015 23:14:57 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master e49fbeac3 -> e508dad3e


fix nightwatch tests:
tests:
deletesDatabase
deletesDatabaseSpecialChars
deleteDatabaseModal
viewQueryOptions
viewSaveManytimes

other:
also adds ids to elements that only have css classes
also adds ability to include id to react component ConfirmButton


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

Branch: refs/heads/master
Commit: e508dad3ef7e5bea642f86a233c91bb1eaa6b148
Parents: e49fbea
Author: michellephung@gmail.com <michellephung@gmail.com>
Authored: Tue May 12 16:17:52 2015 -0400
Committer: michellephung@gmail.com <michellephung@gmail.com>
Committed: Thu May 14 18:49:53 2015 -0400

----------------------------------------------------------------------
 .../components/react-components.react.jsx       |  2 +-
 .../tests/nightwatch/deletesDatabase.js         |  7 ++++---
 .../nightwatch/deletesDatabaseSpecialChars.js   |  8 +++----
 .../documents/index-editor/components.react.jsx |  2 +-
 .../templates/delete_database_modal.html        |  2 +-
 .../tests/nightwatch/deleteDatabaseModal.js     | 22 +++++++++++---------
 .../documents/tests/nightwatch/viewCreate.js    |  1 +
 .../tests/nightwatch/viewQueryOptions.js        |  4 ++--
 .../tests/nightwatch/viewSaveManyTimes.js       | 20 ++++++++++--------
 app/addons/documents/views.js                   |  2 +-
 app/addons/fauxton/base.js                      |  2 +-
 .../custom-commands/clickWhenVisible.js         |  2 ++
 test/nightwatch_tests/helpers/helpers.js        |  2 +-
 13 files changed, 42 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/components/react-components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/react-components.react.jsx b/app/addons/components/react-components.react.jsx
index 79abc1c..78332c2 100644
--- a/app/addons/components/react-components.react.jsx
+++ b/app/addons/components/react-components.react.jsx
@@ -422,7 +422,7 @@ function (app, FauxtonAPI, React, Components, ace, beautifyHelper) {
   var ConfirmButton = React.createClass({
     render: function () {
       return (
-        <button type="submit" className="btn btn-success save">
+        <button type="submit" className="btn btn-success save" id={this.props.id}>
           <i className="icon fonticon-ok-circled"></i>
           {this.props.text}
         </button>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/databases/tests/nightwatch/deletesDatabase.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/nightwatch/deletesDatabase.js b/app/addons/databases/tests/nightwatch/deletesDatabase.js
index 7a386e5..b47c43b 100644
--- a/app/addons/databases/tests/nightwatch/deletesDatabase.js
+++ b/app/addons/databases/tests/nightwatch/deletesDatabase.js
@@ -23,9 +23,10 @@ module.exports = {
       .click("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog")
       .waitForElementPresent('#header-dropdown-menu .fonticon-trash', waitTime, false)
       .click('#header-dropdown-menu .fonticon-trash')
-      .waitForElementVisible('#db_name', waitTime, false)
-      .click('#db_name')
-      .setValue('input#db_name', [newDatabaseName, client.Keys.ENTER] )
+      .waitForElementPresent('#delete-db-modal', waitTime, false)
+      .waitForElementVisible('#db-name', waitTime, false)
+      .click('#db-name')
+      .setValue('input#db-name', [newDatabaseName, client.Keys.ENTER] )
       .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false)
       .url(baseUrl + '/_all_dbs')
       .waitForElementPresent('pre', waitTime, false)

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js b/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js
index 0ff4feb..b233d96 100644
--- a/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js
+++ b/app/addons/databases/tests/nightwatch/deletesDatabaseSpecialChars.js
@@ -23,10 +23,10 @@ module.exports = {
       .waitForElementPresent('#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog',
waitTime, false)
       .click("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog")
       .waitForElementPresent('#header-dropdown-menu .fonticon-trash', waitTime, false)
-      .click('#header-dropdown-menu .fonticon-trash')
-      .waitForElementVisible('#db_name', waitTime, false)
-      .click('#db_name')
-      .setValue('input#db_name', [newDatabaseName, client.Keys.ENTER] )
+      .clickWhenVisible('#header-dropdown-menu .fonticon-trash', waitTime, false)
+      .waitForElementPresent('#db-name', waitTime, false)
+      .click('#db-name')
+      .setValue('input#db-name', [newDatabaseName, client.Keys.ENTER])
       .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false)
       .url(baseUrl + '/_all_dbs')
       .waitForElementPresent('pre', waitTime, false)

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/documents/index-editor/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-editor/components.react.jsx b/app/addons/documents/index-editor/components.react.jsx
index 2f27464..f943c0c 100644
--- a/app/addons/documents/index-editor/components.react.jsx
+++ b/app/addons/documents/index-editor/components.react.jsx
@@ -433,7 +433,7 @@ function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents)
             </PaddedBorderedBox>
             <div className="padded-box">
               <div className="control-group">
-                <ConfirmButton text="Save &amp; Build Index" />
+                <ConfirmButton id="save-view" text="Save &amp; Build Index" />
                 <DeleteView />
                 {this.getCompactButton()}
               </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/documents/templates/delete_database_modal.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/delete_database_modal.html b/app/addons/documents/templates/delete_database_modal.html
index f1f8325..227fc54 100644
--- a/app/addons/documents/templates/delete_database_modal.html
+++ b/app/addons/documents/templates/delete_database_modal.html
@@ -27,7 +27,7 @@ the License.
       Please enter the database name below to confirm the deletion of the
       database and all documents and attachments within.
       </p>
-      <input class="input-block-level" type="text" name="db_name" id="db_name"></input>
+      <input class="input-block-level" type="text" name="db-name" id="db-name"></input>
       <br/>
       <div id="modal-error" class="alert alert-error hide" style="font-size: 16px;"></div>
     </form>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js b/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js
index 973e455..e828b7c 100644
--- a/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js
+++ b/app/addons/documents/tests/nightwatch/deleteDatabaseModal.js
@@ -18,11 +18,12 @@ module.exports = {
     client
       .loginToGUI()
       .url(baseUrl + '/#/database/_replicator/_all_docs')
-      .waitForElementPresent('#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog',
waitTime, false)
-      .click("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog")
-      .waitForElementPresent('#header-dropdown-menu .fonticon-trash', waitTime, false)
-      .click('#header-dropdown-menu .fonticon-trash')
-      .waitForElementVisible('#db_name', waitTime, false)
+      .waitForElementPresent("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog",
waitTime, false)
+      .clickWhenVisible("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog", waitTime,
false)
+      .waitForElementPresent("#header-dropdown-menu .fonticon-trash", waitTime, false)
+      .clickWhenVisible('#header-dropdown-menu .fonticon-trash', waitTime, false)
+      .waitForElementPresent('#delete-db-modal', waitTime, false)
+      .waitForElementVisible('input#db-name', waitTime, false)
       .assert.elementPresent('.warning')
     .end();
   },
@@ -35,11 +36,12 @@ module.exports = {
     client
       .loginToGUI()
       .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs')
-      .waitForElementPresent('#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog',
waitTime, false)
-      .click("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog")
-      .waitForElementPresent('#header-dropdown-menu .fonticon-trash', waitTime, false)
-      .click('#header-dropdown-menu .fonticon-trash')
-      .waitForElementVisible('#db_name', waitTime, false)
+      .waitForElementPresent("#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog",
waitTime, false)
+      .clickWhenVisible('#header-dropdown-menu a.dropdown-toggle.icon.fonticon-cog', waitTime,
false)
+      .waitForElementPresent("#header-dropdown-menu .fonticon-trash", waitTime, false)
+      .clickWhenVisible('#header-dropdown-menu .fonticon-trash', waitTime, false)
+      .waitForElementPresent('#delete-db-modal', waitTime, false)
+      .waitForElementVisible('input#db-name', waitTime, false)
       .assert.elementNotPresent('.warning')
     .end();
   }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/documents/tests/nightwatch/viewCreate.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/viewCreate.js b/app/addons/documents/tests/nightwatch/viewCreate.js
index b96eab6..ed1e2a3 100644
--- a/app/addons/documents/tests/nightwatch/viewCreate.js
+++ b/app/addons/documents/tests/nightwatch/viewCreate.js
@@ -18,6 +18,7 @@ module.exports = {
 
     /*jshint multistr: true */
     openDifferentDropdownsAndClick(client, '#header-dropdown-menu')
+      .waitForElementPresent('#new-ddoc', waitTime, false)
       .setValue('#new-ddoc', 'test_design_doc-selenium-1')
       .clearValue('#index-name')
       .setValue('#index-name', 'hasenindex')

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/documents/tests/nightwatch/viewQueryOptions.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/viewQueryOptions.js b/app/addons/documents/tests/nightwatch/viewQueryOptions.js
index fc529fc..b637570 100644
--- a/app/addons/documents/tests/nightwatch/viewQueryOptions.js
+++ b/app/addons/documents/tests/nightwatch/viewQueryOptions.js
@@ -21,8 +21,8 @@ module.exports = {
       .populateDatabase(newDatabaseName, 3)
       .loginToGUI()
       .url(baseUrl + '/#/database/' + newDatabaseName + '/_design/keyview/_view/keyview')
-      .clickWhenVisible('#toggle-query')
-      .clickWhenVisible('[data-action="showByKeys"]')
+      .clickWhenVisible('#toggle-query', waitTime, false)
+      .clickWhenVisible('[data-action="showByKeys"]', waitTime, false)
       .setValue('#keys-input', '["document_1"]')
       .click('#query-options .btn-success')
       .waitForElementNotPresent('#right-content [data-id="document_2"]', waitTime, false)

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/documents/tests/nightwatch/viewSaveManyTimes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/viewSaveManyTimes.js b/app/addons/documents/tests/nightwatch/viewSaveManyTimes.js
index 6f6570d..c6c86da 100644
--- a/app/addons/documents/tests/nightwatch/viewSaveManyTimes.js
+++ b/app/addons/documents/tests/nightwatch/viewSaveManyTimes.js
@@ -27,6 +27,7 @@ module.exports = {
     .click(dropDownElement + ' a')
     .click(dropDownElement + ' a[href*="new_view"]')
     .waitForElementPresent('.editor-wrapper', waitTime, false)
+    .waitForElementPresent('#new-ddoc', waitTime, false)
     .setValue('#new-ddoc', 'test_design_doc-save-many-times')
     .clearValue('#index-name')
     .setValue('#index-name', 'multiple-saves')
@@ -36,15 +37,16 @@ module.exports = {
       editor.getSession().setValue("function (doc) { emit(\'boom\', doc._id); }");\
       editor._emit(\'blur\');\
     ')
-    .click('button.btn-success.save')
-    .waitForElementVisible('.alert-success', waitTime, false)
-    .waitForElementNotVisible('.alert-success', waitTime, false)
-    .click('button.btn-success.save')
-    .waitForElementVisible('.alert-success', waitTime, false)
-    .waitForElementNotVisible('.alert-success', waitTime, false)
-    .click('button.btn-success.save')
-    .waitForElementVisible('.alert-success', waitTime, false)
-    .assert.containsText('.alert-success', 'View Saved.')
+    .clickWhenVisible('button#save-view')
+    .waitForElementVisible('#global-notifications', waitTime, false)
+    .waitForElementNotVisible('#global-notifications', waitTime, false)
+
+    .clickWhenVisible('button#save-view')
+    .waitForElementVisible('#global-notifications', waitTime, false)
+    .waitForElementNotVisible('#global-notifications', waitTime, false)
+
+    .clickWhenVisible('button#save-view')
+    .waitForElementVisible('#global-notifications', waitTime, false)
     .end();
   },
 };

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index b376b45..6721e72 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -149,7 +149,7 @@ function (app, FauxtonAPI, Components, Documents,
     deleteDatabase: function (event) {
       event.preventDefault();
 
-      var enteredName = $('#db_name').val();
+      var enteredName = $('#db-name').val();
       if (this.database.id != enteredName) {
         this.set_error_msg(enteredName + " does not match the database name.");
         return;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index a5e0755..c570f20 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -104,7 +104,7 @@ function (app, FauxtonAPI, Components, NavbarReactComponents, NavigationActions,
 
   Fauxton.Notification = FauxtonAPI.View.extend({
     animationTimer: 5000,
-
+    id: 'global-notification-id',
     events: {
       'click .js-dismiss': 'onClickRemoveWithAnimation'
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/test/nightwatch_tests/custom-commands/clickWhenVisible.js
----------------------------------------------------------------------
diff --git a/test/nightwatch_tests/custom-commands/clickWhenVisible.js b/test/nightwatch_tests/custom-commands/clickWhenVisible.js
index ee96eca..c56baf2 100644
--- a/test/nightwatch_tests/custom-commands/clickWhenVisible.js
+++ b/test/nightwatch_tests/custom-commands/clickWhenVisible.js
@@ -17,6 +17,8 @@ exports.command = function (element, waitTime) {
   }
 
   this
+    .waitForElementPresent(element, waitTime, false)
+    .execute('$("' + element + '").get(0).scrollIntoView();')
     .waitForElementVisible(element, waitTime, false)
     .click(element);
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e508dad3/test/nightwatch_tests/helpers/helpers.js
----------------------------------------------------------------------
diff --git a/test/nightwatch_tests/helpers/helpers.js b/test/nightwatch_tests/helpers/helpers.js
index 6ff9b31..ed034ed 100644
--- a/test/nightwatch_tests/helpers/helpers.js
+++ b/test/nightwatch_tests/helpers/helpers.js
@@ -13,7 +13,7 @@
 var nano = require('nano');
 
 module.exports = {
-  maxWaitTime: 20000,
+  maxWaitTime: 30000,
   testDatabaseName : 'fauxton-selenium-tests',
 
   getNanoInstance: function () {


Mime
View raw message