You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2021/10/11 12:52:02 UTC
[myfaces-tobago] branch tobago-5.x updated: fix: tobago-test-tool
This is an automated email from the ASF dual-hosted git repository.
hnoeth pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/tobago-5.x by this push:
new 7d5fd92 fix: tobago-test-tool
7d5fd92 is described below
commit 7d5fd92fa0b00b1bb326a8e18ed293ca0d1a62d9
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Mon Oct 11 14:40:22 2021 +0200
fix: tobago-test-tool
* add a substep for event(): wait for negative result of given function
* add comment
---
.../META-INF/resources/tobago/test/tobago-test-tool.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
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 45c47b0..0c7a56c 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
@@ -118,7 +118,7 @@ class JasmineTestTool {
eventType: type,
eventFunc: eventFn,
resultFunc: result,
- substep: 3
+ substep: 4
});
}
@@ -130,6 +130,10 @@ class JasmineTestTool {
});
}
+ /**
+ * Wait till the given function is 'true'.
+ * @param fn given function
+ */
wait(fn) {
this.steps.push({
type: "wait",
@@ -187,6 +191,13 @@ class JasmineTestTool {
} else if (nextStep.type === "setup" && nextStep.substep === 1) {
console.debug("[JasmineTestTool] setup/1-step: wait for " + nextStep.startConditionFunc);
waitFor(nextStep.startConditionFunc, nextStep);
+ } else if (nextStep.type === "event" && nextStep.substep === 4) {
+ console.debug("[JasmineTestTool] event/4-step: wait for negative result of: " + nextStep.resultFunc);
+ if (!nextStep.resultFunc()) {
+ nextStep.substep--;
+ resetTimeout();
+ }
+ window.setTimeout(cycle, 50);
} else if (nextStep.type === "event" && nextStep.substep === 3) {
console.debug("[JasmineTestTool] event/3-step: " + nextStep.resultFunc);
if (nextStep.resultFunc()) {