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 Fri, 23 Aug 2019 12:31:02 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 a75c710  integration tests: remove jQuery
a75c710 is described below

commit a75c710184b4ae46ebe9b72b5fa357a382a5ac1b
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Fri Aug 23 14:09:19 2019 +0200

    integration tests: remove jQuery
---
 .../090-tree/01-select/Tree_Select.test.js         | 20 ++---
 .../15-suggest-method/Suggest_Method.test.js       | 36 ++++----
 .../4600-gridLayout/90-style-tag/Style_Tag.test.js | 12 +--
 .../content/40-test/4950-severity/Severity.test.js | 38 ++++-----
 .../RendererBase_GetCurrentValue.test.js           |  6 +-
 .../content/40-test/6000-event/Event.test.js       | 99 +++++++++++-----------
 6 files changed, 105 insertions(+), 106 deletions(-)

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 f2f8c8d..6ae2232 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
@@ -33,7 +33,7 @@ QUnit.test("single: select Music, select Mathematics", function (assert)
{
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn(), undefined);
+    assert.equal(inputFn(), null);
   });
   TTT.action(function () {
     selectableSingleFn().checked = true;
@@ -41,7 +41,7 @@ QUnit.test("single: select Music, select Mathematics", function (assert)
{
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn(), undefined);
+    assert.notEqual(inputFn(), null);
   });
   TTT.action(function () {
     musicFn().checked = true;
@@ -77,7 +77,7 @@ QUnit.test("singleLeafOnly: select Classic, select Mathematics", function
(asser
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn(), undefined);
+    assert.equal(inputFn(), null);
   });
   TTT.action(function () {
     selectableSingleLeafOnlyFn().checked = true;
@@ -85,7 +85,7 @@ QUnit.test("singleLeafOnly: select Classic, select Mathematics", function
(asser
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn(), undefined);
+    assert.notEqual(inputFn(), null);
   });
   TTT.action(function () {
     classicFn().checked = true;
@@ -121,7 +121,7 @@ QUnit.test("multi: select Music, select Mathematics, deselect Music",
function (
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn(), undefined);
+    assert.equal(inputFn(), null);
   });
   TTT.action(function () {
     selectableMultiFn().checked = true;
@@ -129,7 +129,7 @@ QUnit.test("multi: select Music, select Mathematics, deselect Music",
function (
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn(), undefined);
+    assert.notEqual(inputFn(), null);
   });
   TTT.action(function () {
     musicFn().checked = true;
@@ -173,7 +173,7 @@ QUnit.test("multiLeafOnly: select Classic, select Mathematics, deselect
Classic"
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn(), undefined);
+    assert.equal(inputFn(), null);
   });
   TTT.action(function () {
     selectableMultiLeafOnlyFn().checked = true;
@@ -181,7 +181,7 @@ QUnit.test("multiLeafOnly: select Classic, select Mathematics, deselect
Classic"
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn(), undefined);
+    assert.notEqual(inputFn(), null);
   });
   TTT.action(function () {
     classicFn().checked = true;
@@ -226,7 +226,7 @@ QUnit.test("multiCascade: select Music, select Mathematics, deselect Classic",
f
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.equal(inputFn(), undefined);
+    assert.equal(inputFn(), null);
   });
   TTT.action(function () {
     selectableMultiCascadeFn().checked = true;
@@ -234,7 +234,7 @@ QUnit.test("multiCascade: select Music, select Mathematics, deselect Classic",
f
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.notEqual(inputFn(), undefined);
+    assert.notEqual(inputFn(), null);
   });
   TTT.action(function () {
     musicFn().checked = true;
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/35-deprecated/15-suggest-method/Suggest_Method.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/35-deprecated/15-suggest-method/Suggest_Method.test.js
index f1dd79d..69baf98 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/35-deprecated/15-suggest-method/Suggest_Method.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/35-deprecated/15-suggest-method/Suggest_Method.test.js
@@ -15,46 +15,48 @@
  * limitations under the License.
  */
 
-import {jQueryFrame, 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("Deprecated: 'Ma'", function (assert) {
-  var inputString = "Ma";
-  var expectedLength = 4;
+  let inputString = "Ma";
+  let expectedLength = 4;
 
-  var inFn = jQueryFrameFn("#page\\:mainForm\\:deprecated\\:\\:field");
-  var suggestionsFn = getSuggestions("#page\\:mainForm\\:deprecated");
+  let inFn = testFrameQuerySelectorFn("#page\\:mainForm\\:deprecated\\:\\:field");
+  let suggestionsFn = getSuggestions("#page\\:mainForm\\:deprecated");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    inFn().val(inputString).trigger('input');
+    inFn().value = inputString;
+    inFn().dispatchEvent(new Event('input'));
   });
   TTT.waitForResponse();
   TTT.asserts(expectedLength + 1, function () {
     assert.equal(suggestionsFn().length, expectedLength);
     for (let i = 0; i < expectedLength; i++) {
-      assert.ok(suggestionsFn().eq(i).find("strong").text().toUpperCase().indexOf(inputString.toUpperCase())
>= 0);
+      assert.ok(suggestionsFn().item(i).querySelector("strong").textContent.toUpperCase().indexOf(inputString.toUpperCase())
>= 0);
     }
   });
   TTT.startTest();
 });
 
 QUnit.test("Replacement: 'Ma'", function (assert) {
-  var inputString = "Ma";
-  var expectedLength = 4;
+  let inputString = "Ma";
+  let expectedLength = 4;
 
-  var inFn = jQueryFrameFn("#page\\:mainForm\\:replacement\\:\\:field");
-  var suggestionsFn = getSuggestions("#page\\:mainForm\\:replacement");
+  let inFn = testFrameQuerySelectorFn("#page\\:mainForm\\:replacement\\:\\:field");
+  let suggestionsFn = getSuggestions("#page\\:mainForm\\:replacement");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
-    inFn().val(inputString).trigger('input');
+    inFn().value = inputString;
+    inFn().dispatchEvent(new Event('input'));
   });
   TTT.waitForResponse();
   TTT.asserts(expectedLength + 1, function () {
     assert.equal(suggestionsFn().length, expectedLength);
     for (let i = 0; i < expectedLength; i++) {
-      assert.ok(suggestionsFn().eq(i).find("strong").text().toUpperCase().indexOf(inputString.toUpperCase())
>= 0);
+      assert.ok(suggestionsFn().item(i).querySelector("strong").textContent.toUpperCase().indexOf(inputString.toUpperCase())
>= 0);
     }
   });
   TTT.startTest();
@@ -65,6 +67,6 @@ function escapeClientId(clientId) {
 }
 
 function getSuggestions(id) {
-  return jQueryFrameFn(escapeClientId(
-      jQueryFrame(id + " tobago-suggest").attr("id") + "::popup") + " .tt-suggestion");
+  return testFrameQuerySelectorAllFn(escapeClientId(
+      testFrameQuerySelectorFn(id + " tobago-suggest")().id + "::popup") + " .tt-suggestion");
 }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/90-style-tag/Style_Tag.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/90-style-tag/Style_Tag.test.js
index 82580bc..361a35a 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/90-style-tag/Style_Tag.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/90-style-tag/Style_Tag.test.js
@@ -15,23 +15,23 @@
  * 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("Style tag inside grid layout", function (assert) {
-  var outputFn = jQueryFrameFn("#page\\:mainForm\\:output .tobago-out");
-  var buttonFn = jQueryFrameFn("#page\\:mainForm\\:submitButton");
+  let outputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:output .tobago-out");
+  let buttonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submitButton");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.asserts(1, function () {
-    assert.ok(outputFn().hasClass("text-warning"));
+    assert.ok(outputFn().classList.contains("text-warning"));
   });
   TTT.action(function () {
     buttonFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(1, function () {
-    assert.ok(outputFn().hasClass("text-warning"));
+    assert.ok(outputFn().classList.contains("text-warning"));
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4950-severity/Severity.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4950-severity/Severity.test.js
index 5c295ea..5e9409e 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4950-severity/Severity.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4950-severity/Severity.test.js
@@ -15,35 +15,35 @@
  * 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("Check severity CSS classes", function (assert) {
-  var submitButtonFn = jQueryFrameFn("#page\\:mainForm\\:submit");
-  var fatalInputFieldFn = jQueryFrameFn("#page\\:mainForm\\:fatal\\:\\:field");
-  var errorInputFieldFn = jQueryFrameFn("#page\\:mainForm\\:error\\:\\:field");
-  var warnInputFieldFn = jQueryFrameFn("#page\\:mainForm\\:warn\\:\\:field");
-  var infoInputFieldFn = jQueryFrameFn("#page\\:mainForm\\:info\\:\\:field");
-  var fatalButtonFn = jQueryFrameFn("#page\\:mainForm\\:fatal .tobago-messages-button");
-  var errorButtonFn = jQueryFrameFn("#page\\:mainForm\\:error .tobago-messages-button");
-  var warnButtonFn = jQueryFrameFn("#page\\:mainForm\\:warn .tobago-messages-button");
-  var infoButtonFn = jQueryFrameFn("#page\\:mainForm\\:info .tobago-messages-button");
+  let submitButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:submit");
+  let fatalInputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:fatal\\:\\:field");
+  let errorInputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:error\\:\\:field");
+  let warnInputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:warn\\:\\:field");
+  let infoInputFieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:info\\:\\:field");
+  let fatalButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:fatal .tobago-messages-button");
+  let errorButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:error .tobago-messages-button");
+  let warnButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:warn .tobago-messages-button");
+  let infoButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:info .tobago-messages-button");
 
-  var TTT = new TobagoTestTool(assert);
+  let TTT = new TobagoTestTool(assert);
   TTT.action(function () {
     submitButtonFn().click();
   });
   TTT.waitForResponse();
   TTT.asserts(8, function () {
-    assert.ok(fatalInputFieldFn().hasClass("border-danger"));
-    assert.ok(errorInputFieldFn().hasClass("border-danger"));
-    assert.ok(warnInputFieldFn().hasClass("border-warning"));
-    assert.ok(infoInputFieldFn().hasClass("border-info"));
+    assert.ok(fatalInputFieldFn().classList.contains("border-danger"));
+    assert.ok(errorInputFieldFn().classList.contains("border-danger"));
+    assert.ok(warnInputFieldFn().classList.contains("border-warning"));
+    assert.ok(infoInputFieldFn().classList.contains("border-info"));
 
-    assert.ok(fatalButtonFn().hasClass("btn-danger"));
-    assert.ok(errorButtonFn().hasClass("btn-danger"));
-    assert.ok(warnButtonFn().hasClass("btn-warning"));
-    assert.ok(infoButtonFn().hasClass("btn-info"));
+    assert.ok(fatalButtonFn().classList.contains("btn-danger"));
+    assert.ok(errorButtonFn().classList.contains("btn-danger"));
+    assert.ok(warnButtonFn().classList.contains("btn-warning"));
+    assert.ok(infoButtonFn().classList.contains("btn-info"));
   });
   TTT.startTest();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/RendererBase_GetCurrentValue.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/RendererBase_GetCurrentValue.test.js
index a646754..92f38d1 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/RendererBase_GetCurrentValue.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/10-rendererBase-getCurrentValue/RendererBase_GetCurrentValue.test.js
@@ -15,11 +15,11 @@
  * limitations under the License.
  */
 
-import {jQueryFrame} from "/script/tobago-test.js";
+import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
 
 function test(assert, idSuffix, expectedText) {
-  var $out = jQueryFrame("#page\\:mainForm\\:" + idSuffix);
-  assert.equal($out.text().trim(), expectedText);
+  let outFn = testFrameQuerySelectorFn("#page\\:mainForm\\:" + idSuffix);
+  assert.equal(outFn().textContent.trim(), expectedText);
 }
 
 QUnit.test("formatted values: out string", function (assert) {
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/Event.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/Event.test.js
index f282b16..afa7a5c 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/Event.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/Event.test.js
@@ -15,77 +15,72 @@
  * limitations under the License.
  */
 
-import {jQueryFrame, 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("tc:button", function (assert) {
-  var eventNames = ["click", "dblclick", "focus", "blur"];
-  var eventComponentFn = jQueryFrameFn("#page\\:mainForm\\:buttonevent");
-  var ajaxComponentFn = jQueryFrameFn("#page\\:mainForm\\:buttonajax");
+  let eventNames = ["click", "dblclick", "focus", "blur"];
+  let eventComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:buttonevent");
+  let ajaxComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:buttonajax");
   testEvent(assert, "button", eventNames, eventComponentFn, ajaxComponentFn, null);
 });
 
 QUnit.test("tc:in", function (assert) {
-  var eventNames = ["change", "click", "dblclick", "focus", "blur"];
-  var eventComponentFn = jQueryFrameFn("#page\\:mainForm\\:inevent\\:\\:field");
-  var ajaxComponentFn = jQueryFrameFn("#page\\:mainForm\\:inajax\\:\\:field");
-  var changeValue = function (componentFn) {
-    var oldValue = componentFn().val();
-    var newValue = "hello";
+  let eventNames = ["change", "click", "dblclick", "focus", "blur"];
+  let eventComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:inevent\\:\\:field");
+  let ajaxComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:inajax\\:\\:field");
+  let changeValue = function (componentFn) {
+    let oldValue = componentFn().value;
+    let newValue = "hello";
     if (oldValue === "hello") {
       newValue = "hello there!"
     }
-    componentFn().val(newValue);
+    componentFn().value = newValue;
   };
   testEvent(assert, "in", eventNames, eventComponentFn, ajaxComponentFn, changeValue);
 });
 
 QUnit.test("tc:row", function (assert) {
-  var eventNames = ["click", "dblclick"];
-  var eventComponentFn = jQueryFrameFn("#page\\:mainForm\\:sheetevent\\:0\\:selectPlanet");
-  var ajaxComponentFn = jQueryFrameFn("#page\\:mainForm\\:sheetajax\\:0\\:selectPlanet");
+  let eventNames = ["click", "dblclick"];
+  let eventComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:sheetevent\\:0\\:selectPlanet");
+  let ajaxComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:sheetajax\\:0\\:selectPlanet");
   testEvent(assert, "row", eventNames, eventComponentFn, ajaxComponentFn, null);
 });
 
 QUnit.test("tc:selectBooleanCheckbox", function (assert) {
-  var eventNames = ["change", "click", "dblclick", "focus", "blur"];
-  var eventComponentFn = jQueryFrameFn("#page\\:mainForm\\:selectBooleanCheckboxevent\\:\\:field");
-  var ajaxComponentFn = jQueryFrameFn("#page\\:mainForm\\:selectBooleanCheckboxajax\\:\\:field");
-  var changeValue = function (componentFn) {
-    var currentEvent = jQueryFrame("#page\\:mainForm\\:outEventName span").text();
-    if (currentEvent !== "click") {
-      componentFn().prop("checked", !componentFn().prop("checked"));
-    }
+  let eventNames = ["change", "click", "dblclick", "focus", "blur"];
+  let eventComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectBooleanCheckboxevent\\:\\:field");
+  let ajaxComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:selectBooleanCheckboxajax\\:\\:field");
+  let changeValue = function (componentFn) {
+    componentFn().checked = !componentFn().checked;
   };
   testEvent(assert, "selectBooleanCheckbox", eventNames, eventComponentFn, ajaxComponentFn,
changeValue);
 });
 
 QUnit.test("tc:textarea", function (assert) {
-  var eventNames = ["change", "click", "dblclick", "focus", "blur"];
-  var eventComponentFn = jQueryFrameFn("#page\\:mainForm\\:textareaevent\\:\\:field");
-  var ajaxComponentFn = jQueryFrameFn("#page\\:mainForm\\:textareaajax\\:\\:field");
-  var changeValue = function (componentFn) {
-    var oldValue = componentFn().val();
-    var newValue = "hello";
+  let eventNames = ["change", "click", "dblclick", "focus", "blur"];
+  let eventComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:textareaevent\\:\\:field");
+  let ajaxComponentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:textareaajax\\:\\:field");
+  let changeValue = function (componentFn) {
+    let oldValue = componentFn().value;
+    let newValue = "hello";
     if (oldValue === "hello") {
       newValue = "hello there!"
     }
-    componentFn().val(newValue);
+    componentFn().value = newValue;
   };
   testEvent(assert, "textarea", eventNames, eventComponentFn, ajaxComponentFn, changeValue);
 });
 
 function testEvent(assert, componentName, eventNames, eventComponentFn, ajaxComponentFn,
changeValueFunc) {
-  var oldActionCount;
-  var oldActionListenerCount;
-  var oldAjaxListenerCount;
-  var oldValueChangeListenerCount;
-  var oldTimestamp;
-
-  var TTT = new TobagoTestTool(assert);
-  for (var i = 0; i < eventNames.length; i++) {
-    // need 'let' here, otherwise all tests are executed with last eventName in array
-    // also work in IE11
+  let oldActionCount;
+  let oldActionListenerCount;
+  let oldAjaxListenerCount;
+  let oldValueChangeListenerCount;
+  let oldTimestamp;
+
+  let TTT = new TobagoTestTool(assert);
+  for (let i = 0; i < eventNames.length; i++) {
     let eventName = eventNames[i];
 
     TTT.action(function () {
@@ -102,7 +97,7 @@ function testEvent(assert, componentName, eventNames, eventComponentFn,
ajaxComp
       if (changeValueFunc !== null) {
         changeValueFunc(eventComponentFn);
       }
-      eventComponentFn().trigger(eventName);
+      eventComponentFn().dispatchEvent(new Event(eventName));
     });
     TTT.waitForResponse();
     TTT.asserts(5, function () {
@@ -128,7 +123,7 @@ function testEvent(assert, componentName, eventNames, eventComponentFn,
ajaxComp
       if (changeValueFunc !== null) {
         changeValueFunc(ajaxComponentFn);
       }
-      ajaxComponentFn().trigger(eventName);
+      ajaxComponentFn().dispatchEvent(new Event(eventName));
     });
     TTT.waitForResponse();
     TTT.asserts(5, function () {
@@ -149,12 +144,14 @@ function testEvent(assert, componentName, eventNames, eventComponentFn,
ajaxComp
 }
 
 function activateComponent(componentName, eventName) {
-  jQueryFrame("#page\\:mainForm\\:componentTable .tobago-sheet-row").each(function () {
-    if (jQuery(this).find("td").eq(0).find(".tobago-out").text() === componentName) {
-      jQuery(this).find("button").each(function () {
-        var id = jQuery(this).attr("id");
+  const rows = testFrameQuerySelectorAllFn("#page\\:mainForm\\:componentTable .tobago-sheet-row")();
+  Array.prototype.forEach.call(rows, function (element, i) {
+    if (element.querySelectorAll("td").item(0).querySelector(".tobago-out").textContent ===
componentName) {
+      const buttons = element.querySelectorAll("button");
+      Array.prototype.forEach.call(buttons, function (element, i) {
+        let id = element.getAttribute("id");
         if (id !== undefined && id.indexOf(eventName + "Behavior") >= 0) {
-          this.click();
+          element.click();
         }
       });
     }
@@ -162,21 +159,21 @@ function activateComponent(componentName, eventName) {
 }
 
 function getActionCount() {
-  return parseInt(jQueryFrame("#page\\:mainForm\\:inAction\\:\\:field").val());
+  return parseInt(testFrameQuerySelectorFn("#page\\:mainForm\\:inAction\\:\\:field")().value);
 }
 
 function getActionListenerCount() {
-  return parseInt(jQueryFrame("#page\\:mainForm\\:inActionListener\\:\\:field").val());
+  return parseInt(testFrameQuerySelectorFn("#page\\:mainForm\\:inActionListener\\:\\:field")().value);
 }
 
 function getAjaxListenerCount() {
-  return parseInt(jQueryFrame("#page\\:mainForm\\:inAjaxListener\\:\\:field").val());
+  return parseInt(testFrameQuerySelectorFn("#page\\:mainForm\\:inAjaxListener\\:\\:field")().value);
 }
 
 function getValueChangeListenerCount() {
-  return parseInt(jQueryFrame("#page\\:mainForm\\:inValueChangeListener\\:\\:field").val());
+  return parseInt(testFrameQuerySelectorFn("#page\\:mainForm\\:inValueChangeListener\\:\\:field")().value);
 }
 
 function getTimestamp() {
-  return parseInt(jQueryFrame("#page\\:mainForm\\:inTimestamp\\:\\:field").val());
+  return parseInt(testFrameQuerySelectorFn("#page\\:mainForm\\:inTimestamp\\:\\:field")().value);
 }


Mime
View raw message