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 16:59:27 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 66bbd86  fix integration tests
66bbd86 is described below

commit 66bbd864ac11e020f3cf771aea16457fd399ba33
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Fri Aug 16 18:59:18 2019 +0200

    fix integration tests
---
 .../10-selectBooleanCheckbox/Checkbox.test.js      | 108 +++++++++++----------
 .../030-select/20-selectOneChoice/Dropdown.test.js |  62 ++++++------
 .../030-select/30-selectOneRadio/Radio.test.js     |  88 +++++++++--------
 .../030-select/40-selectOneListbox/Listbox.test.js |  82 ++++++++--------
 .../50-selectManyCheckbox/Multi_Checkbox.test.js   | 104 ++++++++++----------
 .../src/main/webapp/script/tobago-test.js          |   8 +-
 6 files changed, 240 insertions(+), 212 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/Checkbox.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/Checkbox.test.js
index c36d3cd..94f1905 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/Checkbox.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/Checkbox.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/030-select/20-selectOneChoice/Dropdown.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/Dropdown.test.js
index a13693f..e472c2a 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/Dropdown.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/Dropdown.test.js
@@ -15,16 +15,16 @@
  * limitations under the License.
  */
 
-import {jQueryFrameFn} from "/script/tobago-test.js";
+import {jQueryFrameFn, testFrameQuerySelectorAllFn, testFrameQuerySelectorFn} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
 
 QUnit.test("submit: Alice", function (assert) {
-  var aliceFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Alice')");
-  var bobFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Bob')");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:outputPerson span");
+  let aliceFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Alice')");
+  let bobFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Bob')");
+  let submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
+  let outputFn = jQueryFrameFn("#page\\:mainForm\\:outputPerson span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     aliceFn().prop("selected", true);
     bobFn().prop("selected", false);
@@ -39,12 +39,12 @@ QUnit.test("submit: Alice", function (assert) {
 });
 
 QUnit.test("submit: Bob", function (assert) {
-  var aliceFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Alice')");
-  var bobFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Bob')");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:outputPerson span");
+  let aliceFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Alice')");
+  let bobFn = jQueryFrameFn("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Bob')");
+  let submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
+  let outputFn = jQueryFrameFn("#page\\:mainForm\\:outputPerson span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     aliceFn().prop("selected", false);
     bobFn().prop("selected", true);
@@ -58,39 +58,43 @@ QUnit.test("submit: Bob", function (assert) {
 });
 
 QUnit.test("ajax: select Mars", function (assert) {
-  var marsFn = jQueryFrameFn("#page\\:mainForm\\:selectPlanet\\:\\:field option:contains('Mars')");
-  var jupiterFn = jQueryFrameFn("#page\\:mainForm\\:selectPlanet\\:\\:field option:contains('Jupiter')");
-  var moonsFn = jQueryFrameFn("#page\\:mainForm\\:moonbox\\:\\:field option");
+  let planetFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectPlanet\\:\\:field");
+  let marsOptionFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectPlanet\\:\\:field
option[value='1']");
+  let jupiterOptionFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectPlanet\\:\\:field
option[value='2']");
+  let moonsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:moonbox\\:\\:field option");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    jupiterFn().prop("selected", false);
-    marsFn().prop("selected", true).trigger("change");
+    jupiterOptionFn().selected = false;
+    marsOptionFn().selected = true;
+    planetFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(2, function () {
-    assert.equal(moonsFn().eq(0).text().trim(), "Phobos");
-    assert.equal(moonsFn().eq(1).text().trim(), "Deimos");
+    assert.equal(moonsFn().item(0).text, "Phobos");
+    assert.equal(moonsFn().item(1).text, "Deimos");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select Jupiter", function (assert) {
-  var marsFn = jQueryFrameFn("#page\\:mainForm\\:selectPlanet\\:\\:field option:contains('Mars')");
-  var jupiterFn = jQueryFrameFn("#page\\:mainForm\\:selectPlanet\\:\\:field option:contains('Jupiter')");
-  var moonsFn = jQueryFrameFn("#page\\:mainForm\\:moonbox\\:\\:field option");
+  let planetFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectPlanet\\:\\:field");
+  let marsOptionFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectPlanet\\:\\:field
option[value='1']");
+  let jupiterOptionFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectPlanet\\:\\:field
option[value='2']");
+  let moonsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:moonbox\\:\\:field option");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    marsFn().prop("selected", false);
-    jupiterFn().prop("selected", true).trigger("change");
+    marsOptionFn().selected = false;
+    jupiterOptionFn().selected = true;
+    planetFn().dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(4, function () {
-    assert.equal(moonsFn().eq(0).text().trim(), "Europa");
-    assert.equal(moonsFn().eq(1).text().trim(), "Ganymed");
-    assert.equal(moonsFn().eq(2).text().trim(), "Io");
-    assert.equal(moonsFn().eq(3).text().trim(), "Kallisto");
+    assert.equal(moonsFn().item(0).text, "Europa");
+    assert.equal(moonsFn().item(1).text, "Ganymed");
+    assert.equal(moonsFn().item(2).text, "Io");
+    assert.equal(moonsFn().item(3).text, "Kallisto");
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/Radio.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/Radio.test.js
index 29f59df..b88361e 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/Radio.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/Radio.test.js
@@ -15,89 +15,91 @@
  * 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("submit: Addition (2 + 4)", function (assert) {
-  var number1Fn = jQueryFrameFn("#page\\:mainForm\\:selectNum1 input");
-  var number2Fn = jQueryFrameFn("#page\\:mainForm\\:selectNum2 input");
-  var submitAddFn = jQueryFrameFn("#page\\:mainForm\\:submitAdd");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:resultOutput span");
+  let number1Fn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:selectNum1 input");
+  let number2Fn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:selectNum2 input");
+  let submitAddFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submitAdd");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:resultOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    number1Fn().eq(0).prop("checked", false);
-    number1Fn().eq(1).prop("checked", true); // Select 2
-    number1Fn().eq(2).prop("checked", false);
-    number2Fn().eq(0).prop("checked", false);
-    number2Fn().eq(1).prop("checked", false);
-    number2Fn().eq(2).prop("checked", true); // Select 4
+    number1Fn().item(0).checked = false;
+    number1Fn().item(1).checked = true; // Select 2
+    number1Fn().item(2).checked = false;
+    number2Fn().item(0).checked = false;
+    number2Fn().item(1).checked = false;
+    number2Fn().item(2).checked = true; // Select 4
     submitAddFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "6");
+    assert.equal(outputFn().textContent, "6");
   });
   TTT.startTest();
 });
 
 QUnit.test("submit: Subtraction (4 - 1)", function (assert) {
-  var number1Fn = jQueryFrameFn("#page\\:mainForm\\:selectNum1 input");
-  var number2Fn = jQueryFrameFn("#page\\:mainForm\\:selectNum2 input");
-  var submitSubFn = jQueryFrameFn("#page\\:mainForm\\:submitSub");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:resultOutput span");
+  let number1Fn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:selectNum1 input");
+  let number2Fn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:selectNum2 input");
+  let submitSubFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submitSub");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:resultOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    number1Fn().eq(0).prop("checked", false);
-    number1Fn().eq(1).prop("checked", false);
-    number1Fn().eq(2).prop("checked", true); // Select 4
-    number2Fn().eq(0).prop("checked", true); // Select 1
-    number2Fn().eq(1).prop("checked", false);
-    number2Fn().eq(2).prop("checked", false);
+    number1Fn().item(0).checked = false;
+    number1Fn().item(1).checked = false;
+    number1Fn().item(2).checked = true; // Select 4
+    number2Fn().item(0).checked = true; // Select 1
+    number2Fn().item(1).checked = false;
+    number2Fn().item(2).checked = false;
     submitSubFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "3");
+    assert.equal(outputFn().textContent, "3");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select Mars", function (assert) {
-  var planetFn = jQueryFrameFn("#page\\:mainForm\\:selectPlanet input");
-  var moonsFn = jQueryFrameFn("#page\\:mainForm\\:moonradio label.form-check-label");
+  let planetFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:selectPlanet input");
+  let moonsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:moonradio label.form-check-label");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    planetFn().eq(0).prop("checked", false);
-    planetFn().eq(2).prop("checked", false);
-    planetFn().eq(1).prop("checked", true).trigger("change"); // Mars.
+    planetFn().item(0).checked = false;
+    planetFn().item(2).checked = false;
+    planetFn().item(1).checked = true; // Mars.
+    planetFn().item(1).dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(2, function () {
-    assert.equal(moonsFn().eq(0).text(), "Phobos");
-    assert.equal(moonsFn().eq(1).text(), "Deimos");
+    assert.equal(moonsFn().item(0).textContent, "Phobos");
+    assert.equal(moonsFn().item(1).textContent, "Deimos");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select Jupiter", function (assert) {
-  var planetFn = jQueryFrameFn("#page\\:mainForm\\:selectPlanet input");
-  var moonsFn = jQueryFrameFn("#page\\:mainForm\\:moonradio label.form-check-label");
+  let planetFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:selectPlanet input");
+  let moonsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:moonradio label.form-check-label");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    planetFn().eq(0).prop("checked", false);
-    planetFn().eq(1).prop("checked", false);
-    planetFn().eq(2).prop("checked", true).trigger("change"); // Jupiter.
+    planetFn().item(0).checked = false;
+    planetFn().item(1).checked = false;
+    planetFn().item(2).checked = true; // Jupiter.
+    planetFn().item(2).dispatchEvent(new Event('change'));
   });
   TTT.waitForResponse();
   TTT.asserts(4, function () {
-    assert.equal(moonsFn().eq(0).text(), "Europa");
-    assert.equal(moonsFn().eq(1).text(), "Ganymed");
-    assert.equal(moonsFn().eq(2).text(), "Io");
-    assert.equal(moonsFn().eq(3).text(), "Kallisto");
+    assert.equal(moonsFn().item(0).textContent, "Europa");
+    assert.equal(moonsFn().item(1).textContent, "Ganymed");
+    assert.equal(moonsFn().item(2).textContent, "Io");
+    assert.equal(moonsFn().item(3).textContent, "Kallisto");
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/Listbox.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/Listbox.test.js
index 4c574db..1dd4d64 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/Listbox.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/Listbox.test.js
@@ -15,86 +15,90 @@
  * 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("submit: select 'Nile'", function (assert) {
-  var riversFn = jQueryFrameFn("#page\\:mainForm\\:riverList option");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:riverSubmit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:riverOutput span");
+  let riversFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:riverList option");
+  let submitFn = testFrameQuerySelectorFn("#page\\:mainForm\\:riverSubmit");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:riverOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    riversFn().eq(0).prop("selected", true); // Nile
-    riversFn().eq(1).prop("selected", false); // Amazon
-    riversFn().eq(2).prop("selected", false); // Yangtze
-    riversFn().eq(3).prop("selected", false); // Yellow River
-    riversFn().eq(4).prop("selected", false); // Paraná River
+    riversFn().item(0).selected = true; // Nile
+    riversFn().item(1).selected = false; // Amazon
+    riversFn().item(2).selected = false; // Yangtze
+    riversFn().item(3).selected = false; // Yellow River
+    riversFn().item(4).selected = false; // Paraná River
     submitFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "6853 km");
+    assert.equal(outputFn().textContent, "6853 km");
   });
   TTT.startTest();
 });
 
 QUnit.test("submit: select 'Yangtze'", function (assert) {
-  var riversFn = jQueryFrameFn("#page\\:mainForm\\:riverList option");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:riverSubmit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:riverOutput span");
+  let riversFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:riverList option");
+  let submitFn = testFrameQuerySelectorFn("#page\\:mainForm\\:riverSubmit");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:riverOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    riversFn().eq(0).prop("selected", false); // Nile
-    riversFn().eq(1).prop("selected", false); // Amazon
-    riversFn().eq(2).prop("selected", true); // Yangtze
-    riversFn().eq(3).prop("selected", false); // Yellow River
-    riversFn().eq(4).prop("selected", false); // Paraná River
+    riversFn().item(0).selected = false; // Nile
+    riversFn().item(1).selected = false; // Amazon
+    riversFn().item(2).selected = true; // Yangtze
+    riversFn().item(3).selected = false; // Yellow River
+    riversFn().item(4).selected = false; // Paraná River
     submitFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "6300 km");
+    assert.equal(outputFn().textContent, "6300 km");
 
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select Everest", function (assert) {
-  var mountainsFn = jQueryFrameFn("#page\\:mainForm\\:mountainList option");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:selectedMountain span");
+  let mountainListFn = testFrameQuerySelectorFn("#page\\:mainForm\\:mountainList\\:\\:field");
+  let mountainsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:mountainList option");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectedMountain span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    mountainsFn().eq(1).prop("selected", false);
-    mountainsFn().eq(2).prop("selected", false);
-    mountainsFn().eq(3).prop("selected", false);
-    mountainsFn().eq(4).prop("selected", false);
-    mountainsFn().eq(0).prop("selected", true).trigger("change"); // Everest
+    mountainsFn().item(1).selected = false;
+    mountainsFn().item(2).selected = false;
+    mountainsFn().item(3).selected = false;
+    mountainsFn().item(4).selected = false;
+    mountainsFn().item(0).selected = true; // Everest
+    mountainListFn().dispatchEvent(new Event('change')); // Everest
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "8848 m");
+    assert.equal(outputFn().textContent, "8848 m");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: select Makalu", function (assert) {
-  var mountainsFn = jQueryFrameFn("#page\\:mainForm\\:mountainList option");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:selectedMountain span");
+  let mountainListFn = testFrameQuerySelectorFn("#page\\:mainForm\\:mountainList\\:\\:field");
+  let mountainsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:mountainList option");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectedMountain span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    mountainsFn().eq(0).prop("selected", false);
-    mountainsFn().eq(1).prop("selected", false);
-    mountainsFn().eq(2).prop("selected", false);
-    mountainsFn().eq(3).prop("selected", false);
-    mountainsFn().eq(4).prop("selected", true).trigger("change"); // Everest
+    mountainsFn().item(0).selected = false;
+    mountainsFn().item(1).selected = false;
+    mountainsFn().item(2).selected = false;
+    mountainsFn().item(3).selected = false;
+    mountainsFn().item(4).selected = true; // Everest
+    mountainListFn().dispatchEvent(new Event('change')); // Everest
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "8481 m");
+    assert.equal(outputFn().textContent, "8481 m");
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/Multi_Checkbox.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/Multi_Checkbox.test.js
index 300fb7d..e41bc5f 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/Multi_Checkbox.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/Multi_Checkbox.test.js
@@ -15,111 +15,117 @@
  * 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("submit: select cat", function (assert) {
-  var animalsFn = jQueryFrameFn("#page\\:mainForm\\:animals input");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:animalsOutput span");
+  let animalsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:animals input");
+  let submitFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submit");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:animalsOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    animalsFn().eq(0).prop("checked", true);
-    animalsFn().eq(1).prop("checked", false);
-    animalsFn().eq(2).prop("checked", false);
-    animalsFn().eq(3).prop("checked", false);
+    animalsFn().item(0).checked = true;
+    animalsFn().item(1).checked = false;
+    animalsFn().item(2).checked = false;
+    animalsFn().item(3).checked = false;
     submitFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Cat ");
+    assert.equal(outputFn().textContent, "Cat ");
   });
   TTT.startTest();
 });
 
 QUnit.test("submit: select fox and rabbit", function (assert) {
-  var animalsFn = jQueryFrameFn("#page\\:mainForm\\:animals input");
-  var submitFn = jQueryFrameFn("#page\\:mainForm\\:submit");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:animalsOutput span");
+  let animalsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:animals input");
+  let submitFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submit");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:animalsOutput span");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    animalsFn().eq(0).prop("checked", false);
-    animalsFn().eq(1).prop("checked", false);
-    animalsFn().eq(2).prop("checked", true);
-    animalsFn().eq(3).prop("checked", true);
+    animalsFn().item(0).checked = false;
+    animalsFn().item(1).checked = false;
+    animalsFn().item(2).checked = true;
+    animalsFn().item(3).checked = true;
     submitFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), "Fox Rabbit ");
+    assert.equal(outputFn().textContent, "Fox Rabbit ");
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: click 'Two'", function (assert) {
-  var number2Fn = jQueryFrameFn("#page\\:mainForm\\:numbers\\:\\:1");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:resultOutput span");
-  var newOutputValue;
+  let number2Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:numbers\\:\\:1");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:resultOutput span");
+  let newOutputValue;
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    if (number2Fn().prop("checked")) {
-      newOutputValue = parseInt(outputFn().text()) - 2;
-      number2Fn().prop("checked", false).trigger("change");
+    if (number2Fn().checked) {
+      newOutputValue = parseInt(outputFn().textContent) - 2;
+      number2Fn().checked = false;
+      number2Fn().dispatchEvent(new Event('change'));
     } else {
-      newOutputValue = parseInt(outputFn().text()) + 2;
-      number2Fn().prop("checked", true).trigger("change");
+      newOutputValue = parseInt(outputFn().textContent) + 2;
+      number2Fn().checked = true;
+      number2Fn().dispatchEvent(new Event('change'));
     }
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), newOutputValue);
+    assert.equal(outputFn().textContent, newOutputValue);
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: click 'Three'", function (assert) {
-  var number3Fn = jQueryFrameFn("#page\\:mainForm\\:numbers\\:\\:2");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:resultOutput span");
-  var newOutputValue;
+  let number3Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:numbers\\:\\:2");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:resultOutput span");
+  let newOutputValue;
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    if (number3Fn().prop("checked")) {
-      newOutputValue = parseInt(outputFn().text()) - 3;
-      number3Fn().prop("checked", false).trigger("change");
+    if (number3Fn().checked) {
+      newOutputValue = parseInt(outputFn().textContent) - 3;
+      number3Fn().checked = false;
+      number3Fn().dispatchEvent(new Event('change'));
     } else {
-      newOutputValue = parseInt(outputFn().text()) + 3;
-      number3Fn().prop("checked", true).trigger("change");
+      newOutputValue = parseInt(outputFn().textContent) + 3;
+      number3Fn().checked = true;
+      number3Fn().dispatchEvent(new Event('change'));
     }
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), newOutputValue);
+    assert.equal(outputFn().textContent, newOutputValue);
   });
   TTT.startTest();
 });
 
 QUnit.test("ajax: click 'Two'", function (assert) {
-  var number2Fn = jQueryFrameFn("#page\\:mainForm\\:numbers\\:\\:1");
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:resultOutput span");
-  var newOutputValue;
+  let number2Fn = testFrameQuerySelectorFn("#page\\:mainForm\\:numbers\\:\\:1");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:resultOutput span");
+  let newOutputValue;
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    if (number2Fn().prop("checked")) {
-      newOutputValue = parseInt(outputFn().text()) - 2;
-      number2Fn().prop("checked", false).trigger("change");
+    if (number2Fn().checked) {
+      newOutputValue = parseInt(outputFn().textContent) - 2;
+      number2Fn().checked = false;
+      number2Fn().dispatchEvent(new Event('change'));
     } else {
-      newOutputValue = parseInt(outputFn().text()) + 2;
-      number2Fn().prop("checked", true).trigger("change");
+      newOutputValue = parseInt(outputFn().textContent) + 2;
+      number2Fn().checked = true;
+      number2Fn().dispatchEvent(new Event('change'));
     }
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(outputFn().text(), newOutputValue);
+    assert.equal(outputFn().textContent, newOutputValue);
   });
   TTT.startTest();
 });
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 c25172b..60b4edf 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
@@ -31,7 +31,13 @@ function testFrameQuerySelectorFn(expression) {
   }
 }
 
-export {jQueryFrame, jQueryFrameFn, testFrameQuerySelectorFn};
+function testFrameQuerySelectorAllFn(expression) {
+  return function () {
+    return document.getElementById("page:testframe").contentWindow.document.querySelectorAll(expression);
+  }
+}
+
+export {jQueryFrame, jQueryFrameFn, testFrameQuerySelectorFn, testFrameQuerySelectorAllFn};
 
 QUnit.test("wait for test", function (assert) {
   var done = assert.async();


Mime
View raw message