From 62bc992b93b75b0bd835ee5a0876172a0559cd33 Mon Sep 17 00:00:00 2001 From: Antonio Maranhao Date: Mon, 3 Jun 2024 16:09:03 -0400 Subject: [PATCH] Fix errors running Nightwatch's execute() --- .../tests/nightwatch/deletesDatabase.js | 2 +- .../tests/nightwatch/deletesDocuments.js | 2 +- .../tests/nightwatch/replicationactivity.js | 48 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/addons/databases/tests/nightwatch/deletesDatabase.js b/app/addons/databases/tests/nightwatch/deletesDatabase.js index 47978d22b..9b61e1dca 100644 --- a/app/addons/databases/tests/nightwatch/deletesDatabase.js +++ b/app/addons/databases/tests/nightwatch/deletesDatabase.js @@ -45,7 +45,7 @@ module.exports = { .assert.elementPresent('a[href="database/' + newDatabaseName + '/_all_docs"]') .waitForElementPresent('button[aria-label="Delete ' + newDatabaseName + '"]', waitTime, false) - .execute('button[aria-label="Delete ' + newDatabaseName + '"]").scrollIntoView();') + .execute(`document.querySelector("button[aria-label='Delete ${newDatabaseName}']").scrollIntoView();`) .clickWhenVisible('button[aria-label="Delete ' + newDatabaseName + '"]', waitTime, false) .waitForElementVisible('.delete-db-modal', waitTime, false) diff --git a/app/addons/documents/tests/nightwatch/deletesDocuments.js b/app/addons/documents/tests/nightwatch/deletesDocuments.js index 03421012c..442b54d37 100644 --- a/app/addons/documents/tests/nightwatch/deletesDocuments.js +++ b/app/addons/documents/tests/nightwatch/deletesDocuments.js @@ -127,7 +127,7 @@ module.exports = { .clickWhenVisible('input[id="checkbox-_design/sidebar-update"][type="checkbox"]', waitTime, false) .waitForElementPresent('.bulk-action-component-selector-group button.toolbar-btn[icon="fonticon-trash"]', waitTime, false) - .execute('document.querySelector(".bulk-action-component-selector-group button.toolbar-btn[icon="fonticon-trash"]").scrollIntoView();') + .execute('document.querySelector(".bulk-action-component-selector-group button.toolbar-btn[icon=\'fonticon-trash\']").scrollIntoView();') .clickWhenVisible('.bulk-action-component-selector-group button.toolbar-btn[icon="fonticon-trash"]') .acceptAlert() diff --git a/app/addons/replication/tests/nightwatch/replicationactivity.js b/app/addons/replication/tests/nightwatch/replicationactivity.js index 970ca01d9..65c089e04 100644 --- a/app/addons/replication/tests/nightwatch/replicationactivity.js +++ b/app/addons/replication/tests/nightwatch/replicationactivity.js @@ -19,8 +19,8 @@ module.exports = { const replicatorDoc = { _id: 'existing-doc-id-view-doc', - source: "http://source-db.com", - target: "http://target-db.com" + source: "https://source-db.com", + target: "https://target-db.com" }; client .deleteDatabase('_replicator') @@ -43,8 +43,8 @@ module.exports = { const replicatorDoc = { _id: 'existing-doc-id-edit-doc', - source: "http://source-db.com", - target: "http://target-db.com" + source: "https://source-db.com", + target: "https://target-db.com" }; client .deleteDatabase('_replicator') @@ -68,14 +68,14 @@ module.exports = { const replicatorDoc1 = { _id: 'existing-doc-id-filter1', - source: "http://source-db.com", - target: "http://target-db.com" + source: "https://source-db.com", + target: "https://target-db.com" }; const replicatorDoc2 = { _id: 'existing-doc-filter2', - source: "http://source-db2.com", - target: "http://target-db.com" + source: "https://source-db2.com", + target: "https://target-db.com" }; client .deleteDatabase('_replicator') @@ -102,14 +102,14 @@ module.exports = { const replicatorDoc1 = { _id: 'existing-doc-id-filter1', - source: "http://source-db.com", - target: "http://target-db.com" + source: "https://source-db.com", + target: "https://target-db.com" }; const replicatorDoc2 = { _id: 'existing-doc-filter2', - source: "http://source-db2.com", - target: "http://target-db.com" + source: "https://source-db2.com", + target: "https://target-db.com" }; client .deleteDatabase('_replicator') @@ -139,38 +139,38 @@ module.exports = { const replicatorDoc1 = { _id: 'existing-doc-id-display', - source: "http://source-db.com", - target: "http://target-db.com" + source: "https://source-db.com", + target: "https://target-db.com" }; const replicatorDoc2 = { _id: 'existing-doc-id-display2', - source: "http://source-db2.com", - target: "http://target-db.com" + source: "https://source-db2.com", + target: "https://target-db.com" }; const replicatorDoc3 = { _id: 'existing-doc-id-display3', - source: "http://source-db3.com", - target: "http://target-db.com" + source: "https://source-db3.com", + target: "https://target-db.com" }; const replicatorDoc4 = { _id: 'existing-doc-id-display4', - source: "http://source-db4.com", - target: "http://target-db.com" + source: "https://source-db4.com", + target: "https://target-db.com" }; const replicatorDoc5 = { _id: 'existing-doc-id-display5', - source: "http://source-db5.com", - target: "http://target-db.com" + source: "https://source-db5.com", + target: "https://target-db.com" }; const replicatorDoc6 = { _id: 'existing-doc-id-display6', - source: "http://source-db6.com", - target: "http://target-db.com" + source: "https://source-db6.com", + target: "https://target-db.com" }; client