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 Mon, 26 Aug 2019 10:06:39 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 3e048e7  integration tests: remove jQuery
3e048e7 is described below

commit 3e048e75ee931e5d3f83ce6b9d2bd6e3c53b46ee
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Mon Aug 26 11:29:52 2019 +0200

    integration tests: remove jQuery
---
 .../Grid_Layout_Label_Horizontal.test.js           | 110 +++++++++------------
 .../Grid_Layout_Label_Vertical.test.js             |  20 ++--
 .../resources/tobago/test/tobago-test-tool.js      |  23 ++---
 3 files changed, 70 insertions(+), 83 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/10-label-horizontal/Grid_Layout_Label_Horizontal.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/10-label-horizontal/Grid_Layout_Label_Horizontal.test.js
index 38c6840..d84353d 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/10-label-horizontal/Grid_Layout_Label_Horizontal.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/10-label-horizontal/Grid_Layout_Label_Horizontal.test.js
@@ -15,137 +15,125 @@
  * limitations under the License.
  */
 
-import {jQueryFrame} from "/script/tobago-test.js";
+import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
 
 QUnit.test("test CSS of the fields and labels of 'first1'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:first1");
-  var $label = jQueryFrame("#page\\:mainForm\\:first1\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first1");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first1\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "2", "auto", "3", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "1", "auto", "3", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "2", "auto", "3", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "1", "auto", "3", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'last1'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:last1");
-  var $label = jQueryFrame("#page\\:mainForm\\:last1\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last1");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last1\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "3", "auto", "3", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "4", "auto", "3", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "3", "auto", "3", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "4", "auto", "3", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'first2'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:first2");
-  var $label = jQueryFrame("#page\\:mainForm\\:first2\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first2");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first2\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "1", "auto", "5", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "2", "auto", "5", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "1", "auto", "5", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "2", "auto", "5", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'last2'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:last2");
-  var $label = jQueryFrame("#page\\:mainForm\\:last2\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last2");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last2\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "4", "auto", "5", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "3", "auto", "5", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "4", "auto", "5", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "3", "auto", "5", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'first3'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:first3");
-  var $label = jQueryFrame("#page\\:mainForm\\:first3\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first3");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first3\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "2", "span 3", "7", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "1", "auto", "7", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "2", "span 3", "7", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "1", "auto", "7", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'last3'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:last3");
-  var $label = jQueryFrame("#page\\:mainForm\\:last3\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last3");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last3\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "1", "span 3", "8", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "4", "auto", "8", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "1", "span 3", "8", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "4", "auto", "8", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'first4'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:first4");
-  var $label = jQueryFrame("#page\\:mainForm\\:first4\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first4");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first4\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "2", "span 2", "10", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "1", "auto", "10", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "2", "span 2", "10", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "1", "auto", "10", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'last4'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:last4");
-  var $label = jQueryFrame("#page\\:mainForm\\:last4\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last4");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last4\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "1", "span 2", "11", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "3", "auto", "11", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "1", "span 2", "11", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "3", "auto", "11", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'first5'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:first5");
-  var $label = jQueryFrame("#page\\:mainForm\\:first5\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first5");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first5\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "3", "span 2", "13", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "2", "auto", "13", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "3", "span 2", "13", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "2", "auto", "13", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'last5'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:last5");
-  var $label = jQueryFrame("#page\\:mainForm\\:last5\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last5");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last5\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "2", "span 2", "14", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "4", "auto", "14", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "2", "span 2", "14", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "4", "auto", "14", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'first6'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:first6");
-  var $label = jQueryFrame("#page\\:mainForm\\:first6\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first6");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first6\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "2", "span 4", "16", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "1", "auto", "16", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "2", "span 4", "16", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "1", "auto", "16", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'last6'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:last6");
-  var $label = jQueryFrame("#page\\:mainForm\\:last6\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last6");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last6\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "1", "span 4", "17", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "5", "auto", "17", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "1", "span 4", "17", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "5", "auto", "17", "auto");
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/20-label-vertical/Grid_Layout_Label_Vertical.test.js
b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/20-label-vertical/Grid_Layout_Label_Vertical.test.js
index 16a0a80..1b3f759 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/20-label-vertical/Grid_Layout_Label_Vertical.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4600-gridLayout/20-label-vertical/Grid_Layout_Label_Vertical.test.js
@@ -15,27 +15,25 @@
  * limitations under the License.
  */
 
-import {jQueryFrame} from "/script/tobago-test.js";
 import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
+import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
 
 QUnit.test("test CSS of the fields and labels of 'first1'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:first1");
-  var $label = jQueryFrame("#page\\:mainForm\\:first1\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first1");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:first1\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "1", "auto", "2", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "1", "auto", "1", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "1", "auto", "2", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "1", "auto", "1", "auto");
 });
 
 QUnit.test("test CSS of the fields and labels of 'last1'", function (assert) {
-
   assert.expect(8);
 
-  var $field = jQueryFrame("#page\\:mainForm\\:last1");
-  var $label = jQueryFrame("#page\\:mainForm\\:last1\\:\\:label");
+  let fieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last1");
+  let labelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:last1\\:\\:label");
 
-  TobagoTestTool.checkGridCss(assert, $field, "2", "auto", "1", "auto");
-  TobagoTestTool.checkGridCss(assert, $label, "2", "auto", "2", "auto");
+  TobagoTestTool.checkGridCss(assert, fieldFn(), "2", "auto", "1", "auto");
+  TobagoTestTool.checkGridCss(assert, labelFn(), "2", "auto", "2", "auto");
 });
diff --git a/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js
b/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js
index 88f0f15..a2c8601 100644
--- a/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js
+++ b/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js
@@ -29,20 +29,21 @@ TobagoTestTool.stepType = {
 
 TobagoTestTool.msie = navigator.userAgent.indexOf("MSIE") > -1 || navigator.userAgent.indexOf("Trident")
> -1;
 
-TobagoTestTool.COLUMN_START = TobagoTestTool.msie ? "-ms-grid-column" : "grid-column-start";
-TobagoTestTool.COLUMN_END = TobagoTestTool.msie ? "-ms-grid-column-span" : "grid-column-end";
-TobagoTestTool.ROW_START = TobagoTestTool.msie ? "-ms-grid-row" : "grid-row-start";
-TobagoTestTool.ROW_END = TobagoTestTool.msie ? "-ms-grid-row-span" : "grid-row-end";
-
-TobagoTestTool.checkGridCss = function (assert, $element, columnStart, columnEnd, rowStart,
rowEnd) {
-
+TobagoTestTool.checkGridCss = function (assert, element, columnStart, columnEnd, rowStart,
rowEnd) {
   columnEnd = TobagoTestTool.convertGridCss(columnEnd);
   rowEnd = TobagoTestTool.convertGridCss(rowEnd);
 
-  assert.equal($element.css(TobagoTestTool.COLUMN_START), columnStart);
-  assert.equal($element.css(TobagoTestTool.COLUMN_END), columnEnd);
-  assert.equal($element.css(TobagoTestTool.ROW_START), rowStart);
-  assert.equal($element.css(TobagoTestTool.ROW_END), rowEnd);
+  if (TobagoTestTool.msie) {
+    assert.equal(getComputedStyle(element).msGridColumn, columnStart);
+    assert.equal(getComputedStyle(element).msGridColumnSpan, columnEnd);
+    assert.equal(getComputedStyle(element).msGridRow, rowStart);
+    assert.equal(getComputedStyle(element).msGridRowSpan, rowEnd);
+  } else {
+    assert.equal(getComputedStyle(element).gridColumnStart, columnStart);
+    assert.equal(getComputedStyle(element).gridColumnEnd, columnEnd);
+    assert.equal(getComputedStyle(element).gridRowStart, rowStart);
+    assert.equal(getComputedStyle(element).gridRowEnd, rowEnd);
+  }
 };
 
 TobagoTestTool.convertGridCss = function (end) {


Mime
View raw message