myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: integration tests: remove jQuery
Date Sat, 17 Aug 2019 05:45:26 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 23aa7e4  integration tests: remove jQuery
23aa7e4 is described below

commit 23aa7e46f4be7fc8e1057f0092c5a0dab3b7c668
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Sat Aug 17 06:53:05 2019 +0200

    integration tests: remove jQuery
---
 .../20-component/050-container/10-box/Box.test.js  |  84 +++++-----
 .../content/20-component/060-popup/Popup.test.js   | 178 ++++++++++-----------
 .../content/20-component/070-tab/Tab_Group.test.js |  30 ++--
 .../src/main/webapp/script/tobago-test.js          |  39 ++---
 4 files changed, 162 insertions(+), 169 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/10-box/Box.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/10-box/Box.test.js
index 9e5b60f..dcda4b5 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/10-box/Box.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/10-box/Box.test.js
@@ -15,103 +15,103 @@
  * limitations under the License.
  */
 
-import {jQueryFrameFn} from "/script/tobago-test.js";
+import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
 
 QUnit.test("Accordion: Box 1: 'hide' to 'show' to 'hide'", function (assert) {
-  var boxFn = jQueryFrameFn("#page\\:mainForm\\:accordionBox1");
-  var showBoxFn = jQueryFrameFn("#page\\:mainForm\\:showBox1");
-  var hideBoxFn = jQueryFrameFn("#page\\:mainForm\\:hideBox1");
-  var boxBodyFn = jQueryFrameFn("#page\\:mainForm\\:accordionBox1 .card-body");
+  let boxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:accordionBox1");
+  let showBoxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:showBox1");
+  let hideBoxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:hideBox1");
+  let boxBodyFn = testFrameQuerySelectorFn("#page\\:mainForm\\:accordionBox1 .card-body");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(3, function () {
-    assert.equal(showBoxFn().length, 1);
-    assert.equal(hideBoxFn().length, 0);
-    assert.equal(boxBodyFn().text().trim().length, 0);
+    assert.ok(showBoxFn() !== null);
+    assert.ok(hideBoxFn() === null);
+    assert.equal(boxBodyFn().textContent.trim(), "");
   });
   TTT.action(function () {
     showBoxFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(showBoxFn().length, 0);
-    assert.equal(hideBoxFn().length, 1);
-    assert.notEqual(boxBodyFn().text().trim().length, 0);
+    assert.ok(showBoxFn() === null);
+    assert.ok(hideBoxFn() !== null);
+    assert.notEqual(boxBodyFn().textContent.trim(), null);
   });
   TTT.action(function () {
     hideBoxFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(showBoxFn().length, 1);
-    assert.equal(hideBoxFn().length, 0);
-    assert.equal(boxBodyFn().text().trim().length, 0);
+    assert.ok(showBoxFn() !== null);
+    assert.ok(hideBoxFn() === null);
+    assert.equal(boxBodyFn().textContent.trim(), "");
   });
   TTT.startTest();
 });
 
 QUnit.test("Accordion: Box 2: 'hide' to 'show' to 'hide'", function (assert) {
-  var boxFn = jQueryFrameFn("#page\\:mainForm\\:accordionBox2");
-  var showBoxFn = jQueryFrameFn("#page\\:mainForm\\:showBox2");
-  var hideBoxFn = jQueryFrameFn("#page\\:mainForm\\:hideBox2");
-  var boxBodyFn = jQueryFrameFn("#page\\:mainForm\\:accordionBox2 .card-body");
+  let boxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:accordionBox2");
+  let showBoxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:showBox2");
+  let hideBoxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:hideBox2");
+  let boxBodyFn = testFrameQuerySelectorFn("#page\\:mainForm\\:accordionBox2 .card-body");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(3, function () {
-    assert.equal(showBoxFn().length, 1);
-    assert.equal(hideBoxFn().length, 0);
-    assert.equal(boxBodyFn().text().trim().length, 0);
+    assert.ok(showBoxFn() !== null);
+    assert.ok(hideBoxFn() === null);
+    assert.equal(boxBodyFn().textContent.trim(), "");
   });
   TTT.action(function () {
     showBoxFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(showBoxFn().length, 0);
-    assert.equal(hideBoxFn().length, 1);
-    assert.notEqual(boxBodyFn().text().trim().length, 0);
+    assert.ok(showBoxFn() === null);
+    assert.ok(hideBoxFn() !== null);
+    assert.notEqual(boxBodyFn().textContent.trim(), null);
   });
   TTT.action(function () {
     hideBoxFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(showBoxFn().length, 1);
-    assert.equal(hideBoxFn().length, 0);
-    assert.equal(boxBodyFn().text().trim().length, 0);
+    assert.ok(showBoxFn() !== null);
+    assert.ok(hideBoxFn() === null);
+    assert.equal(boxBodyFn().textContent.trim(), "");
   });
   TTT.startTest();
 });
 
 QUnit.test("Accordion: Box 3: 'hide' to 'show' to 'hide'", function (assert) {
-  var boxFn = jQueryFrameFn("#page\\:mainForm\\:accordionBox3");
-  var showBoxFn = jQueryFrameFn("#page\\:mainForm\\:showBox3");
-  var hideBoxFn = jQueryFrameFn("#page\\:mainForm\\:hideBox3");
+  let boxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:accordionBox3");
+  let showBoxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:showBox3");
+  let hideBoxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:hideBox3");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(3, function () {
-    assert.ok(boxFn().hasClass("tobago-collapsed"));
-    assert.equal(showBoxFn().length, 1);
-    assert.equal(hideBoxFn().length, 0);
+    assert.ok(boxFn().classList.contains("tobago-collapsed"));
+    assert.ok(showBoxFn() !== null);
+    assert.ok(hideBoxFn() === null);
   });
   TTT.action(function () {
     showBoxFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.notOk(boxFn().hasClass("tobago-collapsed"));
-    assert.equal(showBoxFn().length, 0);
-    assert.equal(hideBoxFn().length, 1);
+    assert.notOk(boxFn().classList.contains("tobago-collapsed"));
+    assert.ok(showBoxFn() === null);
+    assert.ok(hideBoxFn() !== null);
   });
   TTT.action(function () {
     hideBoxFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.ok(boxFn().hasClass("tobago-collapsed"));
-    assert.equal(showBoxFn().length, 1);
-    assert.equal(hideBoxFn().length, 0);
+    assert.ok(boxFn().classList.contains("tobago-collapsed"));
+    assert.ok(showBoxFn() !== null);
+    assert.ok(hideBoxFn() === null);
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/Popup.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/Popup.test.js
index bf5962f..1659bd0 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/Popup.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/Popup.test.js
@@ -15,45 +15,45 @@
  * limitations under the License.
  */
 
-import {jQueryFrameFn} from "/script/tobago-test.js";
+import {testFrameQuerySelectorAllFn, testFrameQuerySelectorFn} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
 
 QUnit.test("Open 'Client Popup' and press 'Cancel'.", function (assert) {
   assert.expect(3);
 
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup input");
-  var openButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:open");
-  var cancelButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:cancel2");
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup input");
+  let openButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:open");
+  let cancelButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:cancel2");
 
-  assert.equal(popupFn().attr("value"), "true");
+  assert.equal(popupFn().getAttribute("value"), "true");
   openButtonFn().click();
-  assert.equal(popupFn().attr("value"), "false");
+  assert.equal(popupFn().getAttribute("value"), "false");
   cancelButtonFn().click();
-  assert.equal(popupFn().attr("value"), "true");
+  assert.equal(popupFn().getAttribute("value"), "true");
 });
 
 QUnit.test("Open 'Client Popup', press 'Submit' while field is empty. Press 'Cancel'.", function
(assert) {
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup input");
-  var openButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:open");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:output span");
-  var messagesFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:messages div");
-  var inputFieldFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
-  var submitButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:submit2");
-  var cancelButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:cancel2");
-  var outputValue = outputFn().text();
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup input");
+  let openButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:open");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:out span");
+  let messagesFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:form2\\:clientPopup\\:messages
div");
+  let inputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
+  let submitButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:submit2");
+  let cancelButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:cancel2");
+  let outputValue = outputFn().textContent;
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "true");
+    assert.equal(popupFn().getAttribute("value"), "true");
   });
   TTT.action(function () {
     openButtonFn().click();
   });
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "false");
+    assert.equal(popupFn().getAttribute("value"), "false");
   });
   TTT.action(function () {
-    inputFieldFn().val("");
+    inputFieldFn().value = "";
     submitButtonFn().click();
   });
   TTT.waitForResponse();
@@ -64,33 +64,33 @@ QUnit.test("Open 'Client Popup', press 'Submit' while field is empty.
Press 'Can
     cancelButtonFn().click();
   });
   TTT.asserts(2, function () {
-    assert.equal(popupFn().attr("value"), "true");
-    assert.equal(outputFn().text(), outputValue);
+    assert.equal(popupFn().getAttribute("value"), "true");
+    assert.equal(outputFn().textContent, outputValue);
   });
   TTT.startTest();
 });
 
 QUnit.test("Open 'Client Popup', press 'Submit' while field has content. Press 'Cancel'.",
function (assert) {
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup input");
-  var openButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:open");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:out span");
-  var messagesFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:messages div");
-  var inputFieldFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
-  var submitButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:submit2");
-  var cancelButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:cancel2");
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup input");
+  let openButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:open");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:out span");
+  let messagesFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:form2\\:clientPopup\\:messages
div");
+  let inputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
+  let submitButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:submit2");
+  let cancelButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:cancel2");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "true");
+    assert.equal(popupFn().getAttribute("value"), "true");
   });
   TTT.action(function () {
     openButtonFn().click();
   });
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "false");
+    assert.equal(popupFn().getAttribute("value"), "false");
   });
   TTT.action(function () {
-    inputFieldFn().val("test client popup - submit button");
+    inputFieldFn().value = "test client popup - submit button";
     submitButtonFn().click();
   });
   TTT.waitForResponse();
@@ -101,159 +101,159 @@ QUnit.test("Open 'Client Popup', press 'Submit' while field has content.
Press '
     cancelButtonFn().click();
   });
   TTT.asserts(2, function () {
-    assert.equal(popupFn().attr("value"), "true");
-    assert.equal(outputFn().text(), "test client popup - submit button");
+    assert.equal(popupFn().getAttribute("value"), "true");
+    assert.equal(outputFn().textContent, "test client popup - submit button");
   });
   TTT.startTest();
 });
 
 QUnit.test("Open 'Client Popup', press 'Submit & Close' while field is empty.", function
(assert) {
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup input");
-  var openButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:open");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:output span");
-  var inputFieldFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
-  var submitCloseButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:submitClose2");
-  var outputValue = outputFn().text();
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup input");
+  let openButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:open");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:out span");
+  let inputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
+  let submitCloseButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:submitClose2");
+  let outputValue = outputFn().textContent;
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "true");
+    assert.equal(popupFn().getAttribute("value"), "true");
   });
   TTT.action(function () {
     openButtonFn().click();
   });
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "false");
+    assert.equal(popupFn().getAttribute("value"), "false");
   });
   TTT.action(function () {
-    inputFieldFn().val("");
+    inputFieldFn().value = "";
     submitCloseButtonFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(2, function () {
-    assert.equal(popupFn().attr("value"), "true");
-    assert.equal(outputFn().text(), outputValue);
+    assert.equal(popupFn().getAttribute("value"), "true");
+    assert.equal(outputFn().textContent, outputValue);
   });
   TTT.startTest();
 });
 
 QUnit.test("Open 'Client Popup', press 'Submit & Close' while field has content.", function
(assert) {
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup input");
-  var openButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:open");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:out span");
-  var inputFieldFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
-  var submitCloseButtonFn = jQueryFrameFn("#page\\:mainForm\\:form2\\:clientPopup\\:submitClose2");
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup input");
+  let openButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:open");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:out span");
+  let inputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:in2\\:\\:field");
+  let submitCloseButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:form2\\:clientPopup\\:submitClose2");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "true");
+    assert.equal(popupFn().getAttribute("value"), "true");
   });
   TTT.action(function () {
     openButtonFn().click();
   });
   TTT.asserts(1, function () {
-    assert.equal(popupFn().attr("value"), "false");
+    assert.equal(popupFn().getAttribute("value"), "false");
   });
   TTT.action(function () {
-    inputFieldFn().val("test client popup - submit and close button");
+    inputFieldFn().value = "test client popup - submit and close button";
     submitCloseButtonFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(2, function () {
-    assert.equal(popupFn().attr("value"), "true");
-    assert.equal(outputFn().text(), "test client popup - submit and close button");
+    assert.equal(popupFn().getAttribute("value"), "true");
+    assert.equal(outputFn().textContent, "test client popup - submit and close button");
   });
   TTT.startTest();
 });
 
 QUnit.test("Open 'Large Popup'.", function (assert) {
-  var dropdownContainerFn = jQueryFrameFn("#page\\:mainForm\\:dropdownButton");
-  var dropdownButtonFn = jQueryFrameFn("#page\\:mainForm\\:dropdownButton\\:\\:command");
-  var openButtonFn = jQueryFrameFn("#page\\:mainForm\\:largePopupLink");
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:largePopup");
-  var closeButtonFn = jQueryFrameFn("#page\\:mainForm\\:largePopup\\:closeLargePopup");
+  let dropdownContainerFn = testFrameQuerySelectorFn("#page\\:mainForm\\:dropdownButton");
+  let dropdownButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:dropdownButton\\:\\:command");
+  let openButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:largePopupLink");
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:largePopup");
+  let closeButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:largePopup\\:closeLargePopup");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    if (popupFn().hasClass("show")) {
+    if (popupFn().classList.contains("show")) {
       closeButtonFn().click();
     }
-    if (dropdownContainerFn().hasClass("show")) {
+    if (dropdownContainerFn().classList.contains("show")) {
       dropdownButtonFn().click();
     }
   });
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), false);
-    assert.equal(popupFn().hasClass("show"), false);
+    assert.equal(dropdownContainerFn().classList.contains("show"), false);
+    assert.equal(popupFn().classList.contains("show"), false);
   });
   TTT.action(function () {
     dropdownButtonFn().click();
   });
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), true);
-    assert.equal(popupFn().hasClass("show"), false);
+    assert.equal(dropdownContainerFn().classList.contains("show"), true);
+    assert.equal(popupFn().classList.contains("show"), false);
   });
   TTT.action(function () {
     openButtonFn().click();
   });
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), false);
-    assert.equal(popupFn().hasClass("show"), true);
+    assert.equal(dropdownContainerFn().classList.contains("show"), false);
+    assert.equal(popupFn().classList.contains("show"), true);
   });
   TTT.action(function () {
     closeButtonFn().click();
   });
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), false);
-    assert.equal(popupFn().hasClass("show"), false);
+    assert.equal(dropdownContainerFn().classList.contains("show"), false);
+    assert.equal(popupFn().classList.contains("show"), false);
   });
   TTT.startTest();
 });
 
 QUnit.test("Open 'Small Popup'.", function (assert) {
-  var dropdownContainerFn = jQueryFrameFn("#page\\:mainForm\\:dropdownButton");
-  var dropdownButtonFn = jQueryFrameFn("#page\\:mainForm\\:dropdownButton\\:\\:command");
-  var openButtonFn = jQueryFrameFn("#page\\:mainForm\\:smallPopupLink");
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:smallPopup");
-  var closeButtonFn = jQueryFrameFn("#page\\:mainForm\\:smallPopup\\:closeSmallPopup");
+  let dropdownContainerFn = testFrameQuerySelectorFn("#page\\:mainForm\\:dropdownButton");
+  let dropdownButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:dropdownButton\\:\\:command");
+  let openButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:smallPopupLink");
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:smallPopup");
+  let closeButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:smallPopup\\:closeSmallPopup");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    if (popupFn().hasClass("show")) {
+    if (popupFn().classList.contains("show")) {
       closeButtonFn().click();
     }
-    if (dropdownContainerFn().hasClass("show")) {
+    if (dropdownContainerFn().classList.contains("show")) {
       dropdownButtonFn().click();
     }
   });
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), false);
-    assert.equal(popupFn().hasClass("show"), false);
+    assert.equal(dropdownContainerFn().classList.contains("show"), false);
+    assert.equal(popupFn().classList.contains("show"), false);
   });
   TTT.action(function () {
     dropdownButtonFn().click();
   });
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), true);
-    assert.equal(popupFn().hasClass("show"), false);
+    assert.equal(dropdownContainerFn().classList.contains("show"), true);
+    assert.equal(popupFn().classList.contains("show"), false);
   });
   TTT.action(function () {
     openButtonFn().click();
   });
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), false);
-    assert.equal(popupFn().hasClass("show"), true);
+    assert.equal(dropdownContainerFn().classList.contains("show"), false);
+    assert.equal(popupFn().classList.contains("show"), true);
   });
   TTT.action(function () {
     closeButtonFn().click();
   });
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(2, function () {
-    assert.equal(dropdownContainerFn().hasClass("show"), false);
-    assert.equal(popupFn().hasClass("show"), false);
+    assert.equal(dropdownContainerFn().classList.contains("show"), false);
+    assert.equal(popupFn().classList.contains("show"), false);
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/Tab_Group.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/Tab_Group.test.js
index 3a196c1..b5acd10 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/Tab_Group.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/Tab_Group.test.js
@@ -19,12 +19,12 @@ import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
 
 QUnit.test("Client: Select Tab 3", function (assert) {
-  var hiddenInputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tabGroupClient\\:\\:activeIndex");
-  var tab1Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab1Client");
-  var tab3Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Client");
-  var tab3linkFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Client .nav-link");
+  let hiddenInputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tabGroupClient\\:\\:activeIndex");
+  let tab1Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab1Client");
+  let tab3Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Client");
+  let tab3linkFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Client .nav-link");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(5, function () {
     assert.equal(hiddenInputFn().value, 0);
     assert.ok(tab1Fn().classList.contains("tobago-tab-markup-selected"));
@@ -46,12 +46,12 @@ QUnit.test("Client: Select Tab 3", function (assert) {
 });
 
 QUnit.test("Ajax: Select Tab 3", function (assert) {
-  var hiddenInputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tabGroupAjax\\:\\:activeIndex");
-  var tab1Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab1Ajax");
-  var tab3Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Ajax");
-  var tab3linkFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Ajax .nav-link");
+  let hiddenInputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tabGroupAjax\\:\\:activeIndex");
+  let tab1Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab1Ajax");
+  let tab3Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Ajax");
+  let tab3linkFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3Ajax .nav-link");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(5, function () {
     assert.equal(hiddenInputFn().value, 0);
     assert.ok(tab1Fn().classList.contains("tobago-tab-markup-selected"));
@@ -74,12 +74,12 @@ QUnit.test("Ajax: Select Tab 3", function (assert) {
 });
 
 QUnit.test("FullReload: Select Tab 3", function (assert) {
-  var hiddenInputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tabGroupFullReload\\:\\:activeIndex");
-  var tab1Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab1FullReload");
-  var tab3Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3FullReload");
-  var tab3linkFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3FullReload .nav-link");
+  let hiddenInputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tabGroupFullReload\\:\\:activeIndex");
+  let tab1Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab1FullReload");
+  let tab3Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3FullReload");
+  let tab3linkFn = testFrameQuerySelectorFn("#page\\:mainForm\\:tab3FullReload .nav-link");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(5, function () {
     assert.equal(hiddenInputFn().value, 0);
     assert.ok(tab1Fn().classList.contains("tobago-tab-markup-selected"));
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js b/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
index 60b4edf..8254e2e 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
@@ -15,16 +15,6 @@
  * limitations under the License.
  */
 
-function jQueryFrame(expression) {
-  return document.getElementById("page:testframe").contentWindow.jQuery(expression);
-}
-
-function jQueryFrameFn(expression) {
-  return function () {
-    return jQueryFrame(expression);
-  }
-}
-
 function testFrameQuerySelectorFn(expression) {
   return function () {
     return document.getElementById("page:testframe").contentWindow.document.querySelector(expression);
@@ -37,15 +27,15 @@ function testFrameQuerySelectorAllFn(expression) {
   }
 }
 
-export {jQueryFrame, jQueryFrameFn, testFrameQuerySelectorFn, testFrameQuerySelectorAllFn};
+export {testFrameQuerySelectorFn, testFrameQuerySelectorAllFn};
 
 QUnit.test("wait for test", function (assert) {
-  var done = assert.async();
+  let done = assert.async();
 
-  var startTime = new Date().getTime();
-  var contentWindowName = "";
-  var waitingDone = false;
-  var interval = setInterval(function () {
+  let startTime = new Date().getTime();
+  let contentWindowName = "";
+  let waitingDone = false;
+  let interval = setInterval(function () {
     contentWindowName = document.getElementById("page:testframe").contentWindow.name;
     waitingDone = (contentWindowName !== "page:testframe" && contentWindowName !==
"ds-tempWindowId")
         || new RegExp('[\?&]base=([^&#]*)').exec(window.location.href)[1].indexOf("error%2F")
=== 0;
@@ -59,19 +49,22 @@ QUnit.test("wait for test", function (assert) {
 
 QUnit.test("duplicated IDs", function (assert) {
   function getDuplicatedIDs() {
-    var duplicatedIDs = [];
-    jQueryFrame('[id]').each(function () {
-      var ids = jQueryFrame('[id="' + this.id + '"]');
-      if (ids.length > 1 && ids[0] === this)
-        duplicatedIDs.push(this.id);
+    let duplicatedIDs = [];
+    const elementsWithId = document.querySelectorAll("[id]");
+    Array.prototype.forEach.call(elementsWithId, function (element, i) {
+      let sameIdElements = document.querySelectorAll("[id='" + element.id + "']");
+      if (sameIdElements.length > 1) {
+        duplicatedIDs.push(element.id);
+      }
     });
     return duplicatedIDs;
   }
 
-  var duplicatedIDs = getDuplicatedIDs();
+  let duplicatedIDs = getDuplicatedIDs();
   assert.equal(duplicatedIDs.length, 0, "duplicated IDs are: " + duplicatedIDs);
 });
 
 QUnit.test("test '???'", function (assert) {
-  assert.equal(jQueryFrame("*:contains('???')").length, 0, "There must no '???' on the site.");
+  assert.ok(testFrameQuerySelectorFn("html")().textContent.indexOf("???") <= -1,
+      "There must no '???' on the site.");
 });


Mime
View raw message