You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2021/12/01 14:22:40 UTC
[myfaces-tobago] branch tobago-5.x updated (5795326 -> 8ad917e)
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a change to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.
from 5795326 build(deps-dev): bump postcss from 8.4.1 to 8.4.4 in /tobago-theme
new fbecc0e test(message-layout): Fix multiple errors.
new 8ad917e test(Date.test.js): implemented tests.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../webapp/content/900-test/1100-date/Date.test.js | 131 +++++++++++++++++++++
.../webapp/content/900-test/1100-date/Date.xhtml | 10 +-
.../500-message-layout/message-layout.test.js | 14 +--
3 files changed, 146 insertions(+), 9 deletions(-)
create mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.test.js
[myfaces-tobago] 02/02: test(Date.test.js): implemented tests.
Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit 8ad917e196e854a77cf8bca11c510080c8c22346
Author: lennox_2019 <le...@web.de>
AuthorDate: Wed Dec 1 09:07:26 2021 +0100
test(Date.test.js): implemented tests.
---
.../webapp/content/900-test/1100-date/Date.test.js | 131 +++++++++++++++++++++
.../webapp/content/900-test/1100-date/Date.xhtml | 10 +-
2 files changed, 139 insertions(+), 2 deletions(-)
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.test.js
new file mode 100644
index 0000000..7f702f0
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.test.js
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {querySelectorFn} from "/script/tobago-test.js";
+import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
+
+it("#1 model=java.time.LocalDate", function (done) {
+ let inputFieldFn = querySelectorFn("#page\\:mainForm\\:j_id_2f\\:localDate\\:\\:field");
+ let outPutFn = querySelectorFn("#page\\:mainForm\\:j_id_2f\\:j_id_2i .form-control-plaintext");
+ let submitButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2f\\:localDateButton");
+ let resetButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2c\\:j_id_2d");
+ const date = "2020-07-07";
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => outPutFn().textContent !== null,
+ null, "click", resetButtonFn);
+ test.do(() => inputFieldFn().value = date);
+ test.event("click", submitButtonFn, () => outPutFn().textContent !== "");
+ test.do(() => expect(outPutFn().textContent === date));
+ test.start();
+});
+
+it("#2 model=java.time.LocalTime", function (done) {
+ let inputFieldFn = querySelectorFn("#page\\:mainForm\\:j_id_2k\\:localTime\\:\\:field");
+ let outPutFn = querySelectorFn("#page\\:mainForm\\:j_id_2k\\:j_id_2n .form-control-plaintext");
+ let submitButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2k\\:localTimeButton");
+ let resetButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2c\\:j_id_2d");
+ const time = "07:07";
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => outPutFn().textContent !== null,
+ null, "click", resetButtonFn);
+ test.do(() => inputFieldFn().value = time);
+ test.event("click", submitButtonFn, () => outPutFn().textContent !== "");
+ test.do(() => expect(outPutFn().textContent === time));
+ test.start();
+});
+
+it("#3 model=java.time.LocalTime step=1", function (done) {
+ let inputFieldFn = querySelectorFn("#page\\:mainForm\\:j_id_2p\\:localTimeStepA\\:\\:field");
+ let outPutFn = querySelectorFn("#page\\:mainForm\\:j_id_2p\\:j_id_2s .form-control-plaintext");
+ let submitButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2p\\:localTimeButtonStepA");
+ let resetButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2c\\:j_id_2d");
+ const time = "07:07:07";
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => outPutFn().textContent !== null,
+ null, "click", resetButtonFn);
+ test.do(() => inputFieldFn().value = time);
+ test.event("click", submitButtonFn, () => outPutFn().textContent !== "");
+ test.do(() => expect(outPutFn().textContent === time));
+ test.start();
+});
+
+it("#4 model=java.time.LocalTime step=0.001", function (done) {
+ let inputFieldFn = querySelectorFn("#page\\:mainForm\\:j_id_2u\\:localTimeStepB\\:\\:field");
+ let outPutFn = querySelectorFn("#page\\:mainForm\\:j_id_2u\\:j_id_2x .form-control-plaintext");
+ let submitButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2u\\:localTimeButtonStepB");
+ let resetButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2c\\:j_id_2d");
+ const time = "07:07:07.007";
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => outPutFn().textContent !== null,
+ null, "click", resetButtonFn);
+ test.do(() => inputFieldFn().value = time);
+ test.event("click", submitButtonFn, () => outPutFn().textContent !== "");
+ test.do(() => expect(outPutFn().textContent === time));
+ test.start();
+});
+
+it("#5 model=java.time.LocalDateTime", function (done) {
+ let inputFieldFn = querySelectorFn("#page\\:mainForm\\:j_id_2z\\:localDateTime\\:\\:field");
+ let outPutFn = querySelectorFn("#page\\:mainForm\\:j_id_2z\\:j_id_32 .form-control-plaintext");
+ let submitButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2z\\:localDateTimeButton");
+ let resetButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2z\\:j_id_2d");
+ const time = "2020-07-07T07:07";
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => outPutFn().textContent !== null,
+ null, "click", resetButtonFn);
+ test.do(() => inputFieldFn().value = time);
+ test.event("click", submitButtonFn, () => outPutFn().textContent !== "");
+ test.do(() => expect(outPutFn().textContent === time));
+ test.start();
+});
+
+it("#6 model=java.time.LocalDateTime step=1", function (done) {
+ let inputFieldFn = querySelectorFn("#page\\:mainForm\\:j_id_34\\:localDateTimeStepA\\:\\:field");
+ let outPutFn = querySelectorFn("#page\\:mainForm\\:j_id_34\\:j_id_37 .form-control-plaintext");
+ let submitButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_34\\:localDateTimeButtonStepA");
+ let resetButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2z\\:j_id_2d");
+ const time = "2020-07-07T07:07:07";
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => outPutFn().textContent !== null,
+ null, "click", resetButtonFn);
+ test.do(() => inputFieldFn().value = time);
+ test.event("click", submitButtonFn, () => outPutFn().textContent !== "");
+ test.do(() => expect(outPutFn().textContent === time));
+ test.start();
+});
+
+it("#7 model=java.time.LocalDateTime step=0.001", function (done) {
+ let inputFieldFn = querySelectorFn("#page\\:mainForm\\:j_id_39\\:localDateTimeStepB\\:\\:field");
+ let outPutFn = querySelectorFn("#page\\:mainForm\\:j_id_39\\:j_id_3c .form-control-plaintext");
+ let submitButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_39\\:localDateTimeButtonStepB");
+ let resetButtonFn = querySelectorFn("#page\\:mainForm\\:j_id_2z\\:j_id_2d");
+ const time = "2020-07-07T07:07:07.007";
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => outPutFn().textContent !== null,
+ null, "click", resetButtonFn);
+ test.do(() => inputFieldFn().value = time);
+ test.event("click", submitButtonFn, () => outPutFn().textContent !== "");
+ test.do(() => expect(outPutFn().textContent === time));
+ test.start();
+});
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.xhtml
index 99bb008..e0c4a44 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/1100-date/Date.xhtml
@@ -22,6 +22,10 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
+ <tc:form>
+ <tc:button label="Reset"></tc:button>
+ </tc:form>
+
<tc:segmentLayout large="6seg 6seg" medium="12seg">
<tc:form>
@@ -42,7 +46,8 @@
<tc:form>
<tc:box label="#3 model=java.time.LocalTime step=1">
- <tc:date id="localTimeStepA" label="LocalTime" value="#{dateTestController.localTimeStepA}" step="1" required="true"/>
+ <tc:date id="localTimeStepA" label="LocalTime" value="#{dateTestController.localTimeStepA}" step="1"
+ required="true"/>
<tc:out label="Output" value="#{dateTestController.localTimeStepA}">
<f:convertDateTime pattern="hh:mm:ss" type="localTime"/>
</tc:out>
@@ -52,7 +57,8 @@
<tc:form>
<tc:box label="#4 model=java.time.LocalTime step=0.001">
- <tc:date id="localTimeStepB" label="LocalTime" value="#{dateTestController.localTimeStepB}" step="0.001" required="true"/>
+ <tc:date id="localTimeStepB" label="LocalTime" value="#{dateTestController.localTimeStepB}" step="0.001"
+ required="true"/>
<tc:out label="Output" value="#{dateTestController.localTimeStepB}">
<f:convertDateTime pattern="hh:mm:ss.SSS" type="localDateTime"/>
</tc:out>
[myfaces-tobago] 01/02: test(message-layout): Fix multiple errors.
Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit fbecc0eb1d783080cb1f143c0bea703829218291
Author: lennox_2019 <le...@web.de>
AuthorDate: Thu Nov 18 12:12:12 2021 +0100
test(message-layout): Fix multiple errors.
---
.../500-message-layout/message-layout.test.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/4800-labelLayout/500-message-layout/message-layout.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/4800-labelLayout/500-message-layout/message-layout.test.js
index 0a9d230..fe77c9a 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/4800-labelLayout/500-message-layout/message-layout.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/4800-labelLayout/500-message-layout/message-layout.test.js
@@ -20,11 +20,11 @@ import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
import {elementByIdFn, querySelectorAllFn, querySelectorFn} from "/script/tobago-test.js";
it("Input", function (done) {
- const alertsFn = querySelectorAllFn(".tobago-messages .alert");
+ const alertsFn = querySelectorAllFn("tobago-messages .alert");
const submitFn = elementByIdFn("page:mainForm:submit");
const compareFn = elementByIdFn("page:mainForm:inCompare");
const labelFn = querySelectorFn("#page\\:mainForm\\:in label");
- const inputFn = querySelectorFn("#page\\:mainForm\\:in input");
+ const inputFn = querySelectorFn("#page\\:mainForm\\:in\\:\\:field");
const popoverFn = querySelectorFn("#page\\:mainForm\\:in tobago-popover");
const test = new JasmineTestTool(done);
@@ -36,7 +36,7 @@ it("Input", function (done) {
});
it("Input Group", function (done) {
- const alertsFn = querySelectorAllFn(".tobago-messages .alert");
+ const alertsFn = querySelectorAllFn("tobago-messages .alert");
const submitFn = elementByIdFn("page:mainForm:submit");
const compareFn = elementByIdFn("page:mainForm:inputGroupCompare");
const labelFn = querySelectorFn("#page\\:mainForm\\:inputGroup label");
@@ -52,11 +52,11 @@ it("Input Group", function (done) {
});
it("Date", function (done) {
- const alertsFn = querySelectorAllFn(".tobago-messages .alert");
+ const alertsFn = querySelectorAllFn("tobago-messages .alert");
const submitFn = elementByIdFn("page:mainForm:submit");
const compareFn = elementByIdFn("page:mainForm:dateCompare");
const labelFn = querySelectorFn("#page\\:mainForm\\:date label");
- const inputFn = querySelectorFn("#page\\:mainForm\\:date input");
+ const inputFn = querySelectorFn("#page\\:mainForm\\:date\\:\\:field");
const popoverFn = querySelectorFn("#page\\:mainForm\\:date tobago-popover");
const test = new JasmineTestTool(done);
@@ -68,11 +68,11 @@ it("Date", function (done) {
});
it("Shuttle", function (done) {
- const alertsFn = querySelectorAllFn(".tobago-messages .alert");
+ const alertsFn = querySelectorAllFn("tobago-messages .alert");
const submitFn = elementByIdFn("page:mainForm:submit");
const compareFn = elementByIdFn("page:mainForm:shuttleCompare");
const labelFn = querySelectorFn("#page\\:mainForm\\:shuttle label");
- const inputFn = querySelectorFn("#page\\:mainForm\\:shuttle .tobago-selectManyShuttle");
+ const inputFn = querySelectorFn("#page\\:mainForm\\:shuttle .tobago-body");
const popoverFn = querySelectorFn("#page\\:mainForm\\:shuttle tobago-popover");
const test = new JasmineTestTool(done);