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: fix integration tests
Date Fri, 16 Aug 2019 17:47:00 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 e7e1e51  fix integration tests
e7e1e51 is described below

commit e7e1e516b698c2481e61010399368a48a3af16c5
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Fri Aug 16 19:40:37 2019 +0200

    fix integration tests
---
 .../20-component/010-input/10-in/In.test.js        |  33 ++--
 .../15-selectBooleanToggle/Toggle.test.js          | 108 +++++++------
 .../080-sheet/30-event/Sheet_Event.test.js         | 120 +++++++-------
 .../090-tree/01-select/Tree_Select.test.js         | 179 +++++++++++----------
 4 files changed, 230 insertions(+), 210 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/In.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/In.test.js
index c47ae21..0d4568b 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/In.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/In.test.js
@@ -15,45 +15,46 @@
  * 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("inputfield with label", function (assert) {
-  var labelFn = jQueryFrameFn("#page\\:mainForm\\:iNormal > label");
-  var inputFieldFn = jQueryFrameFn("#page\\:mainForm\\:iNormal\\:\\:field");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:iNormal > label");
+  let inputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:iNormal\\:\\:field");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(2, function () {
-    assert.equal(labelFn().text(), "Input");
-    assert.equal(inputFieldFn().val(), "Some Text");
+    assert.equal(labelFn().textContent, "Input");
+    assert.equal(inputFieldFn().value, "Some Text");
   });
   TTT.action(function () {
-    inputFieldFn().val("abc");
+    inputFieldFn().value = "abc";
   });
   TTT.asserts(1, function () {
-    assert.equal(inputFieldFn().val(), "abc");
+    assert.equal(inputFieldFn().value, "abc");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax change event", function (assert) {
-  var inputFieldFn = jQueryFrameFn("#page\\:mainForm\\:inputAjax\\:\\:field");
-  var outputFieldFn = jQueryFrameFn("#page\\:mainForm\\:outputAjax span:first");
+  let inputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:inputAjax\\:\\:field");
+  let outputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:outputAjax span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(2, function () {
-    assert.equal(inputFieldFn().val(), "");
-    assert.equal(outputFieldFn().text(), "");
+    assert.equal(inputFieldFn().value, "");
+    assert.equal(outputFieldFn().textContent, "");
   });
   TTT.action(function () {
-    inputFieldFn().val("qwe").trigger("change");
+    inputFieldFn().value = "qwe";
+    inputFieldFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFieldFn().val(), "qwe");
+    assert.equal(inputFieldFn().value, "qwe");
   });
   TTT.asserts(1, function () {
-    assert.equal(outputFieldFn().text(), "qwe");
+    assert.equal(outputFieldFn().textContent, "qwe");
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/15-selectBooleanToggle/Toggle.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/15-selectBooleanToggle/Toggle.test.js
index c36d3cd..94f1905 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/15-selectBooleanToggle/Toggle.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/15-selectBooleanToggle/Toggle.test.js
@@ -15,137 +15,143 @@
  * 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("submit: select A", function (assert) {
-  var selectAFn = jQueryFrameFn("#page\\:mainForm\\:selectA input");
-  var selectBFn = jQueryFrameFn("#page\\:mainForm\\:selectB input");
-  var selectCFn = jQueryFrameFn("#page\\:mainForm\\:selectC input");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:submitOutput span");
+  let selectAFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectA input");
+  let selectBFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectB input");
+  let selectCFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectC input");
+  let submitFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submit");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submitOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectAFn().prop("checked", true);
-    selectBFn().prop("checked", false);
-    selectCFn().prop("checked", false);
+    selectAFn().checked = true;
+    selectBFn().checked = false;
+    selectCFn().checked = false;
     submitFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "A ");
+    assert.equal(outputFn().textContent, "A ");
   });
   TTT.startTest();
 });
 
 QUnit.test("submit: select B and C", function (assert) {
-  var selectAFn = jQueryFrameFn("#page\\:mainForm\\:selectA input");
-  var selectBFn = jQueryFrameFn("#page\\:mainForm\\:selectB input");
-  var selectCFn = jQueryFrameFn("#page\\:mainForm\\:selectC input");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:submitOutput span");
+  let selectAFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectA input");
+  let selectBFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectB input");
+  let selectCFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectC input");
+  let submitFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submit");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submitOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectAFn().prop("checked", false);
-    selectBFn().prop("checked", true);
-    selectCFn().prop("checked", true);
+    selectAFn().checked = false;
+    selectBFn().checked = true;
+    selectCFn().checked = true;
     submitFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "B C ");
+    assert.equal(outputFn().textContent, "B C ");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select D", function (assert) {
-  var selectDFn = jQueryFrameFn("#page\\:mainForm\\:selectD input");
-  var outputDFn = jQueryFrameFn("#page\\:mainForm\\:outputD span");
+  let selectDFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectD input");
+  let outputDFn = testFrameQuerySelectorFn("#page\\:mainForm\\:outputD span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectDFn().prop("checked", true).trigger("change");
+    selectDFn().checked = true;
+    selectDFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputDFn().text(), "true");
+    assert.equal(outputDFn().textContent, "true");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: deselect D", function (assert) {
-  var selectDFn = jQueryFrameFn("#page\\:mainForm\\:selectD input");
-  var outputDFn = jQueryFrameFn("#page\\:mainForm\\:outputD span");
+  let selectDFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectD input");
+  let outputDFn = testFrameQuerySelectorFn("#page\\:mainForm\\:outputD span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectDFn().prop("checked", false).trigger("change");
+    selectDFn().checked = false;
+    selectDFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputDFn().text(), "false");
+    assert.equal(outputDFn().textContent, "false");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select E", function (assert) {
-  var selectEFn = jQueryFrameFn("#page\\:mainForm\\:selectE input");
-  var outputEFn = jQueryFrameFn("#page\\:mainForm\\:outputE span");
+  let selectEFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectE input");
+  let outputEFn = testFrameQuerySelectorFn("#page\\:mainForm\\:outputE span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectEFn().prop("checked", true).trigger("change");
+    selectEFn().checked = true;
+    selectEFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputEFn().text(), "true");
+    assert.equal(outputEFn().textContent, "true");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: deselect E", function (assert) {
-  var selectEFn = jQueryFrameFn("#page\\:mainForm\\:selectE input");
-  var outputEFn = jQueryFrameFn("#page\\:mainForm\\:outputE span");
+  let selectEFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectE input");
+  let outputEFn = testFrameQuerySelectorFn("#page\\:mainForm\\:outputE span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectEFn().prop("checked", false).trigger("change");
+    selectEFn().checked = false;
+    selectEFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputEFn().text(), "false");
+    assert.equal(outputEFn().textContent, "false");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select F", function (assert) {
-  var selectFFn = jQueryFrameFn("#page\\:mainForm\\:selectF input");
-  var outputFFn = jQueryFrameFn("#page\\:mainForm\\:outputF span");
+  let selectFFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectF input");
+  let outputFFn = testFrameQuerySelectorFn("#page\\:mainForm\\:outputF span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectFFn().prop("checked", true).trigger("change");
+    selectFFn().checked = true;
+    selectFFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFFn().text(), "true");
+    assert.equal(outputFFn().textContent, "true");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: deselect F", function (assert) {
-  var selectFFn = jQueryFrameFn("#page\\:mainForm\\:selectF input");
-  var outputFFn = jQueryFrameFn("#page\\:mainForm\\:outputF span");
+  let selectFFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectF input");
+  let outputFFn = testFrameQuerySelectorFn("#page\\:mainForm\\:outputF span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectFFn().prop("checked", false).trigger("change");
+    selectFFn().checked = false;
+    selectFFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFFn().text(), "false");
+    assert.equal(outputFFn().textContent, "false");
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js
index 6615f80..cef2c6c 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js
@@ -15,154 +15,154 @@
  * limitations under the License.
  */
 
-import {jQueryFrameFn, testFrameQuerySelectorFn} from "/script/tobago-test.js";
+import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
 
 QUnit.test("On click with ajax", function (assert) {
-  var oneClickAjaxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:0");
-  var venusFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:2\\:sample0");
-  var jupiterFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:5\\:sample0");
-  var saturnFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:6\\:sample0");
-  var namefieldFn = jQueryFrameFn("#page\\:mainForm\\:name\\:\\:field");
+  let oneClickAjaxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:0");
+  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample0");
+  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample0");
+  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample0");
+  let namefieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:name\\:\\:field");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     oneClickAjaxFn().checked = true;
     oneClickAjaxFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(venusFn().length, 1);
-    assert.equal(jupiterFn().length, 1);
-    assert.equal(saturnFn().length, 1);
+    assert.ok(venusFn());
+    assert.ok(jupiterFn());
+    assert.ok(saturnFn());
   });
   TTT.action(function () {
     venusFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Venus");
+    assert.equal(namefieldFn().value, "Venus");
   });
   TTT.action(function () {
     jupiterFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Jupiter");
+    assert.equal(namefieldFn().value, "Jupiter");
   });
   TTT.action(function () {
     saturnFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Saturn");
+    assert.equal(namefieldFn().value, "Saturn");
   });
   TTT.startTest();
 });
 
 QUnit.test("On click with full request", function (assert) {
-  var oneClickFullRequestFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:1");
-  var venusFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:2\\:sample1");
-  var jupiterFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:5\\:sample1");
-  var saturnFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:6\\:sample1");
-  var namefieldFn = jQueryFrameFn("#page\\:mainForm\\:name\\:\\:field");
+  let oneClickFullRequestFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:1");
+  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample1");
+  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample1");
+  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample1");
+  let namefieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:name\\:\\:field");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     oneClickFullRequestFn().checked = true;
     oneClickFullRequestFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(venusFn().length, 1);
-    assert.equal(jupiterFn().length, 1);
-    assert.equal(saturnFn().length, 1);
+    assert.ok(venusFn());
+    assert.ok(jupiterFn());
+    assert.ok(saturnFn());
   });
   TTT.action(function () {
     venusFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Venus");
+    assert.equal(namefieldFn().value, "Venus");
   });
   TTT.action(function () {
     jupiterFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Jupiter");
+    assert.equal(namefieldFn().value, "Jupiter");
   });
   TTT.action(function () {
     saturnFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Saturn");
+    assert.equal(namefieldFn().value, "Saturn");
   });
   TTT.startTest();
 });
 
 QUnit.test("On double click with full request", function (assert) {
-  var doubleClickFullRequestFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:2");
-  var venusFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:2\\:sample2");
-  var jupiterFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:5\\:sample2");
-  var saturnFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:6\\:sample2");
-  var namefieldFn = jQueryFrameFn("#page\\:mainForm\\:name\\:\\:field");
+  let doubleClickFullRequestFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:2");
+  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample2");
+  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample2");
+  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample2");
+  let namefieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:name\\:\\:field");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     doubleClickFullRequestFn().checked = true;
     doubleClickFullRequestFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(venusFn().length, 1);
-    assert.equal(jupiterFn().length, 1);
-    assert.equal(saturnFn().length, 1);
+    assert.ok(venusFn());
+    assert.ok(jupiterFn());
+    assert.ok(saturnFn());
   });
   TTT.action(function () {
-    venusFn().dblclick();
+    venusFn().dispatchEvent(new Event('dblclick'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Venus");
+    assert.equal(namefieldFn().value, "Venus");
   });
   TTT.action(function () {
-    jupiterFn().dblclick();
+    jupiterFn().dispatchEvent(new Event('dblclick'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Jupiter");
+    assert.equal(namefieldFn().value, "Jupiter");
   });
   TTT.action(function () {
-    saturnFn().dblclick();
+    saturnFn().dispatchEvent(new Event('dblclick'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(namefieldFn().val(), "Saturn");
+    assert.equal(namefieldFn().value, "Saturn");
   });
   TTT.startTest();
 });
 
 QUnit.test("Open popup on click with ajax", function (assert) {
-  var radioButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:3");
-  var venusFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:2\\:sample3");
-  var jupiterFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:5\\:sample3");
-  var saturnFn = jQueryFrameFn("#page\\:mainForm\\:s1\\:6\\:sample3");
-  var popupFn = jQueryFrameFn("#page\\:mainForm\\:popup");
-  var nameFn = jQueryFrameFn("#page\\:mainForm\\:popup\\:popupName\\:\\:field");
-  var cancelFn = jQueryFrameFn("#page\\:mainForm\\:popup\\:cancel");
+  let radioButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:3");
+  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample3");
+  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample3");
+  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample3");
+  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:popup");
+  let nameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:popup\\:popupName\\:\\:field");
+  let cancelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:popup\\:cancel");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     radioButtonFn().checked = true;
     radioButtonFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(3, function () {
-    assert.equal(venusFn().length, 1);
-    assert.equal(jupiterFn().length, 1);
-    assert.equal(saturnFn().length, 1);
+    assert.ok(venusFn());
+    assert.ok(jupiterFn());
+    assert.ok(saturnFn());
   });
   TTT.action(function () {
     venusFn().click();
@@ -170,15 +170,15 @@ QUnit.test("Open popup on click with ajax", function (assert) {
   TTT.waitForResponse();
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(2, function () {
-    assert.ok(popupFn().hasClass("show"));
-    assert.equal(nameFn().val(), "Venus");
+    assert.ok(popupFn().classList.contains("show"));
+    assert.equal(nameFn().value, "Venus");
   });
   TTT.action(function () {
     cancelFn().click();
   });
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(1, function () {
-    assert.notOk(popupFn().hasClass("show"));
+    assert.notOk(popupFn().classList.contains("show"));
   });
   TTT.action(function () {
     jupiterFn().click();
@@ -186,15 +186,15 @@ QUnit.test("Open popup on click with ajax", function (assert) {
   TTT.waitForResponse();
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(2, function () {
-    assert.ok(popupFn().hasClass("show"));
-    assert.equal(nameFn().val(), "Jupiter");
+    assert.ok(popupFn().classList.contains("show"));
+    assert.equal(nameFn().value, "Jupiter");
   });
   TTT.action(function () {
     cancelFn().click();
   });
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(1, function () {
-    assert.notOk(popupFn().hasClass("show"));
+    assert.notOk(popupFn().classList.contains("show"));
   });
   TTT.action(function () {
     saturnFn().click();
@@ -202,15 +202,15 @@ QUnit.test("Open popup on click with ajax", function (assert) {
   TTT.waitForResponse();
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(2, function () {
-    assert.ok(popupFn().hasClass("show"));
-    assert.equal(nameFn().val(), "Saturn");
+    assert.ok(popupFn().classList.contains("show"));
+    assert.equal(nameFn().value, "Saturn");
   });
   TTT.action(function () {
     cancelFn().click();
   });
   TTT.waitMs(1000); // wait for animation
   TTT.asserts(1, function () {
-    assert.notOk(popupFn().hasClass("show"));
+    assert.notOk(popupFn().classList.contains("show"));
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/01-select/Tree_Select.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/01-select/Tree_Select.test.js
index 4f2152f..f2f8c8d 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/01-select/Tree_Select.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/01-select/Tree_Select.test.js
@@ -15,238 +15,251 @@
  * limitations under the License.
  */
 
-import {jQueryFrameFn, testFrameQuerySelectorFn} from "/script/tobago-test.js";
+import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
 
 QUnit.test("single: select Music, select Mathematics", function (assert) {
-  var musicFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:3\\:select");
-  var mathematicsFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:selectedNodesOutput span");
-  var selectableNoneFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:0");
-  var selectableSingleFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:1");
-  var inputFn = jQueryFrameFn(".tobago-treeSelect input");
+  let musicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:3\\:select");
+  let mathematicsFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectedNodesOutput span");
+  let selectableNoneFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:0");
+  let selectableSingleFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:1");
+  let inputFn = testFrameQuerySelectorFn(".tobago-treeSelect input");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectableNoneFn().prop("checked", true).trigger("change");
+    selectableNoneFn().checked = true;
+    selectableNoneFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn().length, 0);
+    assert.equal(inputFn(), undefined);
   });
   TTT.action(function () {
-    selectableSingleFn().prop("checked", true).trigger("change");
+    selectableSingleFn().checked = true;
+    selectableSingleFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn().length, 0);
+    assert.notEqual(inputFn(), undefined);
   });
   TTT.action(function () {
-    musicFn().prop("checked", true).trigger("change");
+    musicFn().checked = true;
+    musicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Music");
+    assert.equal(outputFn().textContent, "Music");
   });
   TTT.action(function () {
-    mathematicsFn().prop("checked", true).trigger("change");
+    mathematicsFn().checked = true;
+    mathematicsFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Mathematics");
+    assert.equal(outputFn().textContent, "Mathematics");
   });
   TTT.startTest();
 });
 
 QUnit.test("singleLeafOnly: select Classic, select Mathematics", function (assert) {
-  var classicFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:4\\:select");
-  var mathematicsFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:selectedNodesOutput span");
-  var selectableNoneFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:0");
-  var selectableSingleLeafOnlyFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:2");
-  var inputFn = jQueryFrameFn(".tobago-treeSelect input");
+  let classicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:4\\:select");
+  let mathematicsFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectedNodesOutput span");
+  let selectableNoneFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:0");
+  let selectableSingleLeafOnlyFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:2");
+  let inputFn = testFrameQuerySelectorFn(".tobago-treeSelect input");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectableNoneFn().prop("checked", true).trigger("change");
+    selectableNoneFn().checked = true;
+    selectableNoneFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn().length, 0);
+    assert.equal(inputFn(), undefined);
   });
   TTT.action(function () {
-    selectableSingleLeafOnlyFn().prop("checked", true).trigger("change");
+    selectableSingleLeafOnlyFn().checked = true;
+    selectableSingleLeafOnlyFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn().length, 0);
+    assert.notEqual(inputFn(), undefined);
   });
   TTT.action(function () {
-    classicFn().prop("checked", true).trigger("change");
+    classicFn().checked = true;
+    classicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Classic");
+    assert.equal(outputFn().textContent, "Classic");
   });
   TTT.action(function () {
-    mathematicsFn().prop("checked", true).trigger("change");
+    mathematicsFn().checked = true;
+    mathematicsFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Mathematics");
+    assert.equal(outputFn().textContent, "Mathematics");
   });
   TTT.startTest();
 });
 
 QUnit.test("multi: select Music, select Mathematics, deselect Music", function (assert) {
-  var musicFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:3\\:select");
-  var mathematicsFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:selectedNodesOutput span");
-  var selectableNoneFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:0");
-  var selectableMultiFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:3");
-  var inputFn = jQueryFrameFn(".tobago-treeSelect input");
+  let musicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:3\\:select");
+  let mathematicsFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectedNodesOutput span");
+  let selectableNoneFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:0");
+  let selectableMultiFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:3");
+  let inputFn = testFrameQuerySelectorFn(".tobago-treeSelect input");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectableNoneFn().prop("checked", true).trigger("change");
+    selectableNoneFn().checked = true;
+    selectableNoneFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn().length, 0);
+    assert.equal(inputFn(), undefined);
   });
   TTT.action(function () {
-    selectableMultiFn().prop("checked", true).trigger("change");
+    selectableMultiFn().checked = true;
+    selectableMultiFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn().length, 0);
+    assert.notEqual(inputFn(), undefined);
   });
   TTT.action(function () {
-    musicFn().prop("checked", true).trigger("change");
+    musicFn().checked = true;
+    musicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Music");
+    assert.equal(outputFn().textContent, "Music");
   });
   TTT.action(function () {
-    mathematicsFn().prop("checked", true).trigger("change");
+    mathematicsFn().checked = true;
+    mathematicsFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Music, Mathematics");
+    assert.equal(outputFn().textContent, "Music, Mathematics");
   });
   TTT.action(function () {
-    musicFn().prop("checked", false).trigger("change");
+    musicFn().checked = false;
+    musicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Mathematics");
+    assert.equal(outputFn().textContent, "Mathematics");
   });
   TTT.startTest();
 });
 
 QUnit.test("multiLeafOnly: select Classic, select Mathematics, deselect Classic", function
(assert) {
-  var classicFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:4\\:select");
-  var mathematicsFn = jQueryFrameFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:selectedNodesOutput span");
-  var selectableNoneFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:0");
-  var selectableMultiLeafOnlyFn = jQueryFrameFn("#page\\:mainForm\\:selectable\\:\\:4");
-  var inputFn = jQueryFrameFn(".tobago-treeSelect input");
+  let classicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:4\\:select");
+  let mathematicsFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectedNodesOutput span");
+  let selectableNoneFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:0");
+  let selectableMultiLeafOnlyFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:4");
+  let inputFn = testFrameQuerySelectorFn(".tobago-treeSelect input");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    selectableNoneFn().prop("checked", true).trigger("change");
+    selectableNoneFn().checked = true;
+    selectableNoneFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn().length, 0);
+    assert.equal(inputFn(), undefined);
   });
   TTT.action(function () {
-    selectableMultiLeafOnlyFn().prop("checked", true).trigger("change");
+    selectableMultiLeafOnlyFn().checked = true;
+    selectableMultiLeafOnlyFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn().length, 0);
+    assert.notEqual(inputFn(), undefined);
   });
   TTT.action(function () {
-    classicFn().prop("checked", true).trigger("change");
+    classicFn().checked = true;
+    classicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Classic");
+    assert.equal(outputFn().textContent, "Classic");
   });
   TTT.action(function () {
-    mathematicsFn().prop("checked", true).trigger("change");
+    mathematicsFn().checked = true;
+    mathematicsFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Classic, Mathematics");
+    assert.equal(outputFn().textContent, "Classic, Mathematics");
   });
   TTT.action(function () {
-    classicFn().prop("checked", false).trigger("change");
+    classicFn().checked = false;
+    classicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Mathematics");
+    assert.equal(outputFn().textContent, "Mathematics");
   });
   TTT.startTest();
 });
 
 QUnit.test("multiCascade: select Music, select Mathematics, deselect Classic", function (assert)
{
-  var musicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:3\\:select");
-  var classicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:4\\:select");
-  var mathematicsFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:selectedNodesOutput span");
-  var selectableNoneFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:0");
-  var selectableMultiCascadeFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:5");
-  var inputFn = jQueryFrameFn(".tobago-treeSelect input");
+  let musicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:3\\:select");
+  let classicFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:4\\:select");
+  let mathematicsFn = testFrameQuerySelectorFn("#page\\:mainForm\\:categoriesTree\\:9\\:select");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectedNodesOutput span");
+  let selectableNoneFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:0");
+  let selectableMultiCascadeFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectable\\:\\:5");
+  let inputFn = testFrameQuerySelectorFn(".tobago-treeSelect input");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     selectableNoneFn().checked = true;
-
     selectableNoneFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn().length, 0);
+    assert.equal(inputFn(), undefined);
   });
   TTT.action(function () {
     selectableMultiCascadeFn().checked = true;
-
     selectableMultiCascadeFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn().length, 0);
+    assert.notEqual(inputFn(), undefined);
   });
   TTT.action(function () {
     musicFn().checked = true;
-
     musicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse(); // an ajax request is send for every leaf (Music, Classic, Pop,
World)
   TTT.waitMs(2000); // wait for the last ajax
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Music, Classic, Pop, World");
+    assert.equal(outputFn().textContent, "Music, Classic, Pop, World");
   });
   TTT.action(function () {
     mathematicsFn().checked = true;
-
     mathematicsFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Music, Classic, Pop, World, Mathematics");
+    assert.equal(outputFn().textContent, "Music, Classic, Pop, World, Mathematics");
   });
   TTT.action(function () {
     classicFn().checked = false;
-
     classicFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Music, Pop, World, Mathematics");
+    assert.equal(outputFn().textContent, "Music, Pop, World, Mathematics");
   });
   TTT.startTest();
 });


Mime
View raw message