@gregoriusrippenstein/erlang-red-unittest 0.21.0 → 0.21.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/assert values/ignores failures if requested and boolean not-equal test.json +1 -0
- package/examples/catch/catch all in group except those handler elsewhere.json +1 -1
- package/examples/catch/deal with it yourself.json +1 -1
- package/examples/catch/don't catch if the node isn't selected.json +1 -1
- package/examples/change/set functionality.json +1 -1
- package/examples/complete/split node.json +1 -1
- package/examples/debug/Jsonata expressions in output field.json +1 -0
- package/examples/debug/ensure debug messages are generated.json +1 -1
- package/examples/debug/handle largish json files as content.json +1 -1
- package/examples/debug/status message counter.json +1 -1
- package/examples/debug/type hadling of JSONata results (ered).json +1 -0
- package/examples/debug/type hadling of JSONata results (node-red).json +1 -0
- package/examples/delay/respect the reset flag and dont pass on the reset msg.json +1 -0
- package/examples/exec/handle multiple process at once (ered).json +1 -0
- package/examples/exec/handle multiple process at once (nred).json +1 -0
- package/examples/exec/support timeout specification (ered).json +1 -0
- package/examples/exec/support timeout specification (nred).json +1 -0
- package/examples/exec/synchronised execution (ered).json +1 -0
- package/examples/exec/synchronised execution (nred).json +1 -0
- package/examples/file in/basic functionality of being able to read a file.json +1 -1
- package/examples/file in/will accept file name from msg obj.json +1 -1
- package/examples/filter/ignore initial value.json +1 -1
- package/examples/filter/post if value changed.json +1 -1
- package/examples/flowhubpull/retrieve flow id.json +1 -1
- package/examples/function/divide by zero throws kills node.json +1 -1
- package/examples/function/ensure /"on stop/" code is executed.json" +1 -1
- package/examples/function/function and module work together.json +1 -1
- package/examples/function/handle corrupt code.json +1 -1
- package/examples/function/set node context.json +1 -1
- package/examples/function/support timeout setting.json +1 -1
- package/examples/function/supports completed node.json +1 -1
- package/examples/http/Dynamic Routing.json +1 -1
- package/examples/http/POST & GET have different endpoints.json +1 -1
- package/examples/http/dynamic redirect.json +1 -1
- package/examples/http/have params in the path.json +1 -1
- package/examples/http/http static routing.json +1 -1
- package/examples/http/multiple endpoints don't all get the request.json +1 -1
- package/examples/http/nodes should be able to handle requests.json +1 -1
- package/examples/http/post requests - json content.json +1 -1
- package/examples/http/request parses JSON conent.json +1 -1
- package/examples/http/set content type.json +1 -1
- package/examples/http/support query string on get request.json +1 -1
- package/examples/inject/repeat interval.json +1 -1
- package/examples/inject/trigger after - does not trigger.json +1 -1
- package/examples/inject/unsupported JSONata function.json +1 -1
- package/examples/join/manual config with count & nested property name.json +1 -1
- package/examples/json/parse example json content.json +1 -1
- package/examples/json/raise exception if content not valid.json +1 -1
- package/examples/json/support prettify json content.json +1 -1
- package/examples/link nodes/across flow tabs.json +1 -1
- package/examples/link nodes/cascading link calls.json +1 -1
- package/examples/markdown/allow for inline html.json +1 -1
- package/examples/markdown/convert markdown to html.json +1 -1
- package/examples/markdown/support code block.json +1 -1
- package/examples/mqtt/auto-(re)connect.json +1 -1
- package/examples/range/basic examples.json +1 -1
- package/examples/split/Array type.json +1 -1
- package/examples/split/binary type.json +1 -1
- package/examples/split/work with binary data as string data (ered).json +1 -0
- package/examples/split/work with binary data as string data (nred).json +1 -0
- package/examples/statemachine/exception if no action to perform.json +1 -1
- package/examples/status/basic working version.json +1 -1
- package/examples/status/only one message per status value.json +1 -1
- package/examples/switch/JSONata undefined value & exceptions.json +1 -1
- package/examples/switch/post debug on JSONata exception.json +1 -1
- package/examples/switch/raise exception if JSONata has exception.json +1 -1
- package/examples/tcp/Bad value on output port (3425).json +1 -1
- package/examples/tcp/multiple tcp in connectors (1194).json +1 -1
- package/examples/template/support mustache template.json +1 -1
- package/nodes/ut-assert-debug.js +239 -2
- package/package.json +3 -2
- package/plugins/sidebar.html +79 -13
- package/priv/testdata/helloworld.txt +1 -0
- package/priv/testdata/test.json +126 -0
- package/examples/.core/assert values ignores failures if requested.json +0 -1
- package/examples/debug/handling of Jsonata expressions.json +0 -1
- package/examples/debug/type hadling of JSONata reslults (ered).json +0 -1
- package/examples/debug/type hadling of JSONata reslults (node-red).json +0 -1
- package/examples/exec/handle multiple process at once.json +0 -1
- package/examples/exec/support timeout specification.json +0 -1
- package/examples/exec/synchronised execution.json +0 -1
- package/examples/split/work with binary data as string data.json +0 -1
- /package/examples/comment/{what is there to test?.json → what is there to test-.json} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"069552b2eb6bce48","type":"tab","label":"[tcp] Bad value on output port (3425)","disabled":false,"info":"## gen_tcp:send(...) and numbers\n\nThere is a spot in the [connector code](https://github.com/gorenje/erlang-red/blob/dba90f15888503b4606cb41ac675878d16684841/src/ered_tcp_connector.erl#L39-L50) that highlights a minor issue with `gen_tcp:send/2` and numbers.\n\nThis test uses the connector code but the problem applies equally to the [listener code](https://github.com/gorenje/erlang-red/blob/dba90f15888503b4606cb41ac675878d16684841/src/ered_tcp_listener.erl#L52-L63).\n\nThe problem arises - for me - when using numbers, a single number. In particular it seems to be negative integer values that cause the issue:\n\n```\n08:47:02.788 [error] Bad value on output port 'tcp_inet'\n```\n\n[Stackoverflow](https://stackoverflow.com/questions/38750444/bad-value-on-output-port-tcp-inet) has many suggestions:\n\n> In my phoenix api that I had deployed to heroku. In my case, I was setting response headers with an atom. Once I changed the atom to a binary everything started working fine again.\n\nBut for me it was single numbers that caused the issues, not http headers.\n\nThis flow test demonstrates this. The value -12 will generates the error and the value 12 will not - both are numbers NOT strings.\n\n## What does this test do?\n\nFirst a <a class=\"ahl-node-only\" data-ids=\"7bec330797c929e4\">server on port 3425</a> is started, waiting for connections. Then a <a class=\"ahl-node-only\" data-ids=\"9d73ad81e2ed993c\">tcp request</a> node connects to the server.\n\nWhen it does, it will send the messages that have been sent to it, in this case we have three messages consisting of the value 12 and -12.\n\nThe <a class=\"ahl-node-only\" data-ids=\"6d6da201565de404,46385dd6aa371f45,6b30b8d45824c2ea\">delay nodes</a> ensure that the messages are sent in the order 12, -12 and 12.\n\nThe test is triggered by the <a class=\"ahl-node-only\" data-ids=\"146eaf26868b802c\">inject node</a> which in turn triggers the three messages.\n\nThe <a class=\"ahl-node-only\" data-ids=\"f0e3314691d12a74,046d9545fe9ab505\">join nodes</a> show that only two messages go through, with the third (-12) being lost on the way. This demonstrates that the tcp connection isn't actually closed and continues to function.\n\n## Why is this an issue?\n\nRandom errors are annoying and tracking this one down took a while. However there is nothing that can really be done. Since the value is set by the payload and the payload on a message can be anything, this can happen at any time - day or night.\n\nThe context of the message would be important to know - what is the meaning of a negative integer value being sent over a tcp connection?\n\nSince there isn't a general answer to that question, there isn't much that can be done - generally.\n\nPerhaps raising a debug message in the panel would be the best thing to do at this stage.\n\nAnnoyingly the error generated isn't an exception and cannot be captured, it seems more to be a warning than an error. As pointed out, the tcp connection isn't closed.\n\n","env":[{"name":"ERED_NOT_EUNIT","value":"true","type":"bool"},{"name":"ERED_PENDING","value":"false","type":"bool"}]},{"id":"7bec330797c929e4","type":"tcp request","z":"069552b2eb6bce48","name":"","server":"localhost","port":"3425","out":"time","ret":"string","splitc":"200000","newline":"","trim":false,"tls":"","x":839,"y":507,"wires":[[]]},{"id":"6d6da201565de404","type":"delay","z":"069552b2eb6bce48","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":599,"y":433,"wires":[["7bec330797c929e4"]]},{"id":"46385dd6aa371f45","type":"delay","z":"069552b2eb6bce48","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":599,"y":507,"wires":[["7bec330797c929e4"]]},{"id":"6b30b8d45824c2ea","type":"delay","z":"069552b2eb6bce48","name":"","pauseType":"delay","timeout":"600","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":599,"y":590,"wires":[["7bec330797c929e4"]]},{"id":"df1995777960982d","type":"switch","z":"069552b2eb6bce48","name":"only data packets","property":"_session.status","propertyType":"msg","rules":[{"t":"
|
|
1
|
+
[{"id":"069552b2eb6bce48","type":"tab","label":"[tcp] Bad value on output port (3425)","disabled":false,"info":"## gen_tcp:send(...) and numbers\n\nThere is a spot in the [connector code](https://github.com/gorenje/erlang-red/blob/dba90f15888503b4606cb41ac675878d16684841/src/ered_tcp_connector.erl#L39-L50) that highlights a minor issue with `gen_tcp:send/2` and numbers.\n\nThis test uses the connector code but the problem applies equally to the [listener code](https://github.com/gorenje/erlang-red/blob/dba90f15888503b4606cb41ac675878d16684841/src/ered_tcp_listener.erl#L52-L63).\n\nThe problem arises - for me - when using numbers, a single number. In particular it seems to be negative integer values that cause the issue:\n\n```\n08:47:02.788 [error] Bad value on output port 'tcp_inet'\n```\n\n[Stackoverflow](https://stackoverflow.com/questions/38750444/bad-value-on-output-port-tcp-inet) has many suggestions:\n\n> In my phoenix api that I had deployed to heroku. In my case, I was setting response headers with an atom. Once I changed the atom to a binary everything started working fine again.\n\nBut for me it was single numbers that caused the issues, not http headers.\n\nThis flow test demonstrates this. The value -12 will generates the error and the value 12 will not - both are numbers NOT strings.\n\n## What does this test do?\n\nFirst a <a class=\"ahl-node-only\" data-ids=\"7bec330797c929e4\">server on port 3425</a> is started, waiting for connections. Then a <a class=\"ahl-node-only\" data-ids=\"9d73ad81e2ed993c\">tcp request</a> node connects to the server.\n\nWhen it does, it will send the messages that have been sent to it, in this case we have three messages consisting of the value 12 and -12.\n\nThe <a class=\"ahl-node-only\" data-ids=\"6d6da201565de404,46385dd6aa371f45,6b30b8d45824c2ea\">delay nodes</a> ensure that the messages are sent in the order 12, -12 and 12.\n\nThe test is triggered by the <a class=\"ahl-node-only\" data-ids=\"146eaf26868b802c\">inject node</a> which in turn triggers the three messages.\n\nThe <a class=\"ahl-node-only\" data-ids=\"f0e3314691d12a74,046d9545fe9ab505\">join nodes</a> show that only two messages go through, with the third (-12) being lost on the way. This demonstrates that the tcp connection isn't actually closed and continues to function.\n\n## Why is this an issue?\n\nRandom errors are annoying and tracking this one down took a while. However there is nothing that can really be done. Since the value is set by the payload and the payload on a message can be anything, this can happen at any time - day or night.\n\nThe context of the message would be important to know - what is the meaning of a negative integer value being sent over a tcp connection?\n\nSince there isn't a general answer to that question, there isn't much that can be done - generally.\n\nPerhaps raising a debug message in the panel would be the best thing to do at this stage.\n\nAnnoyingly the error generated isn't an exception and cannot be captured, it seems more to be a warning than an error. As pointed out, the tcp connection isn't closed.\n\n","env":[{"name":"ERED_NOT_EUNIT","value":"true","type":"bool"},{"name":"ERED_PENDING","value":"false","type":"bool"}]},{"id":"7bec330797c929e4","type":"tcp request","z":"069552b2eb6bce48","name":"","server":"localhost","port":"3425","out":"time","ret":"string","splitc":"200000","newline":"","trim":false,"tls":"","x":839,"y":507,"wires":[[]]},{"id":"6d6da201565de404","type":"delay","z":"069552b2eb6bce48","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":599,"y":433,"wires":[["7bec330797c929e4"]]},{"id":"46385dd6aa371f45","type":"delay","z":"069552b2eb6bce48","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":599,"y":507,"wires":[["7bec330797c929e4"]]},{"id":"6b30b8d45824c2ea","type":"delay","z":"069552b2eb6bce48","name":"","pauseType":"delay","timeout":"600","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":599,"y":590,"wires":[["7bec330797c929e4"]]},{"id":"df1995777960982d","type":"switch","z":"069552b2eb6bce48","name":"only data packets","property":"_session.status","propertyType":"msg","rules":[{"t":"neq","v":"connected","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":1077,"y":565,"wires":[["dd3a799aef6166c9"]]},{"id":"508ebb98927e404f","type":"change","z":"069552b2eb6bce48","name":"payload = 12","rules":[{"p":"payload","pt":"msg","t":"set","to":"12","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":398,"y":433,"wires":[["6d6da201565de404"]]},{"id":"53749a8b6ce5c205","type":"change","z":"069552b2eb6bce48","name":"payload = 12","rules":[{"p":"payload","pt":"msg","t":"set","to":"12","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":398,"y":590,"wires":[["6b30b8d45824c2ea"]]},{"id":"25d8b0221cd42ca2","type":"change","z":"069552b2eb6bce48","name":"payload = -12","rules":[{"p":"payload","pt":"msg","t":"set","to":"-12","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":388,"y":507,"wires":[["46385dd6aa371f45"]]},{"id":"146eaf26868b802c","type":"inject","z":"069552b2eb6bce48","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":128,"y":507,"wires":[["508ebb98927e404f","25d8b0221cd42ca2","53749a8b6ce5c205"]]},{"id":"dd3a799aef6166c9","type":"ut-assert-success","z":"069552b2eb6bce48","name":"","count":"2","x":1341,"y":565,"wires":[]},{"id":"9d73ad81e2ed993c","type":"tcp in","z":"069552b2eb6bce48","name":"","server":"server","host":"","port":"3425","datamode":"stream","datatype":"utf8","newline":"","topic":"","trim":false,"base64":false,"tls":"","x":843,"y":607,"wires":[["df1995777960982d"]]}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"c381b5135cc947cd","type":"tab","label":"[tcp] multiple tcp in connectors (1194)","disabled":false,"info":"## Tcp in connect-to nodes\n\nStarting a tcp service, for example, using netcat `(while date ; do sleep 1 ; done) | nc -lk -p 9393` will cause all three connect to tcp in nodes to receive data.\n\nEach tcp in node will receive the *same* data from the from the host. That is because there is only one connection being maintained. \n\nErlang Red maintains single connections for multiple tcp nodes. Even when multiple tcp in nodes access the same connection, each will receive the same data instead of one connecting to the service and the other nodes not being able to connect.\n\nThis differs to original Node-RED behaviour that will connect a random tcp in node to the service and have it uniquely receive all the data. \n\nNode-RED [forum question](https://discourse.nodered.org/t/tcp-in-nodes-connecting-to-same-host/97975).\n\n\n\n","env":[{"name":"ERED_PENDING","
|
|
1
|
+
[{"id":"c381b5135cc947cd","type":"tab","label":"[tcp] multiple tcp in connectors (1194)","disabled":false,"info":"## Tcp in connect-to nodes\n\nStarting a tcp service, for example, using netcat `(while date ; do sleep 1 ; done) | nc -lk -p 9393` will cause all three connect to tcp in nodes to receive data.\n\nEach tcp in node will receive the *same* data from the from the host. That is because there is only one connection being maintained. \n\nErlang Red maintains single connections for multiple tcp nodes. Even when multiple tcp in nodes access the same connection, each will receive the same data instead of one connecting to the service and the other nodes not being able to connect.\n\nThis differs to original Node-RED behaviour that will connect a random tcp in node to the service and have it uniquely receive all the data. \n\nNode-RED [forum question](https://discourse.nodered.org/t/tcp-in-nodes-connecting-to-same-host/97975).\n\n\n\n","env":[{"name":"ERED_PENDING","value":"false","type":"bool"},{"name":"ERED_NOT_EUNIT","value":"true","type":"bool"},{"name":"NRED_PENDING","value":"true","type":"bool"}]},{"id":"564114edd5ba0caf","type":"group","z":"c381b5135cc947cd","style":{"color":"#a4a4a4","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","stroke":"#999999","stroke-opacity":"1"},"nodes":["91ea2827b42734f8","51db6f4e4fabe23e","79a3014b85623de5","8197f5db17d5faa6","6a9c6712d23a8ad9","19b359dc5d9c62d5","29a165c172dd6099","4d2e899d7a424d69","af91f00ddcc05b87"],"x":239,"y":186.875,"w":1295,"h":313.625},{"id":"91ea2827b42734f8","type":"tcp in","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"","server":"server","host":"","port":"1194","datamode":"stream","datatype":"utf8","newline":"","topic":"","trim":true,"base64":false,"tls":"","x":504,"y":343.6875,"wires":[["29a165c172dd6099"]]},{"id":"51db6f4e4fabe23e","type":"tcp in","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"","server":"server","host":"","port":"1194","datamode":"stream","datatype":"utf8","newline":"","topic":"","trim":true,"base64":false,"tls":"","x":685,"y":459.5,"wires":[["19b359dc5d9c62d5"]]},{"id":"eae4f7026d63b109","type":"tcp request","z":"c381b5135cc947cd","name":"","server":"localhost","port":"1194","out":"time","ret":"string","splitc":"3000","newline":"","trim":false,"tls":"","x":1290,"y":579.75,"wires":[[]]},{"id":"dc60341617690980","type":"inject","z":"c381b5135cc947cd","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"\" & $millis()","payloadType":"jsonata","x":919,"y":725,"wires":[["eae4f7026d63b109"]]},{"id":"f85b44b70643d362","type":"inject","z":"c381b5135cc947cd","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"\" & $millis()","payloadType":"jsonata","x":785,"y":688.6875,"wires":[["eae4f7026d63b109"]]},{"id":"a74eb5d8b2fc9c56","type":"inject","z":"c381b5135cc947cd","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"\" & $millis()","payloadType":"jsonata","x":651,"y":652.375,"wires":[["eae4f7026d63b109"]]},{"id":"97e3ad43a22731af","type":"inject","z":"c381b5135cc947cd","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"\" & $millis()","payloadType":"jsonata","x":517,"y":616.0625,"wires":[["eae4f7026d63b109"]]},{"id":"c741b86b0ddfdf7d","type":"inject","z":"c381b5135cc947cd","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"\" & $millis()","payloadType":"jsonata","x":383,"y":579.75,"wires":[["eae4f7026d63b109"]]},{"id":"79a3014b85623de5","type":"ut-assert-success","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"","count":"5","x":1039,"y":227.875,"wires":[]},{"id":"8197f5db17d5faa6","type":"ut-assert-success","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"","count":"5","x":1232,"y":266,"wires":[]},{"id":"6a9c6712d23a8ad9","type":"ut-assert-success","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"","count":"5","x":1418,"y":304,"wires":[]},{"id":"19b359dc5d9c62d5","type":"switch","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"only data packets","property":"_session.status","propertyType":"msg","rules":[{"t":"neq","v":"connected","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":911,"y":304,"wires":[["6a9c6712d23a8ad9"]]},{"id":"29a165c172dd6099","type":"switch","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"only data packets","property":"_session.status","propertyType":"msg","rules":[{"t":"neq","v":"connected","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":842,"y":266,"wires":[["8197f5db17d5faa6"]]},{"id":"4d2e899d7a424d69","type":"switch","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"only data packets","property":"_session.status","propertyType":"msg","rules":[{"t":"neq","v":"connected","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":797,"y":227.875,"wires":[["79a3014b85623de5"]]},{"id":"af91f00ddcc05b87","type":"tcp in","z":"c381b5135cc947cd","g":"564114edd5ba0caf","name":"","server":"server","host":"","port":"1194","datamode":"stream","datatype":"utf8","newline":"","topic":"","trim":true,"base64":false,"tls":"","x":325,"y":229,"wires":[["4d2e899d7a424d69"]]}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"08183069b5f8ef9c","type":"tab","label":"[template] support mustache template","disabled":false,"info":"Basic support mustache templating using [bbmustache](https://github.com/soranoba/bbmustache).","env":[]},{"id":"bc81e6748b3aeb9c","type":"inject","z":"08183069b5f8ef9c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"<b>hello world</b>","payloadType":"str","x":608,"y":882,"wires":[["44c609fe82ebf669","8e84e08b55c84671","f1d52f3c187a674e"]]},{"id":"44c609fe82ebf669","type":"template","z":"08183069b5f8ef9c","name":"double {{ .. }}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{payload}} !","output":"str","x":866,"y":882,"wires":[["781a45ccaa1bf83f"]]},{"id":"781a45ccaa1bf83f","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","rules":[{"
|
|
1
|
+
[{"id":"08183069b5f8ef9c","type":"tab","label":"[template] support mustache template","disabled":false,"info":"Basic support mustache templating using [bbmustache](https://github.com/soranoba/bbmustache).","env":[]},{"id":"bc81e6748b3aeb9c","type":"inject","z":"08183069b5f8ef9c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"<b>hello world</b>","payloadType":"str","x":608,"y":882,"wires":[["44c609fe82ebf669","8e84e08b55c84671","f1d52f3c187a674e"]]},{"id":"44c609fe82ebf669","type":"template","z":"08183069b5f8ef9c","name":"double {{ .. }}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{payload}} !","output":"str","x":866,"y":882,"wires":[["781a45ccaa1bf83f"]]},{"id":"781a45ccaa1bf83f","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: <b>hello world</b> !","tot":"str"}],"x":1102,"y":882,"wires":[[]]},{"id":"8e84e08b55c84671","type":"template","z":"08183069b5f8ef9c","name":"triple {{{ .. }}}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{{payload}}} !","output":"str","x":866,"y":958,"wires":[["74f729fd37514cd4"]]},{"id":"74f729fd37514cd4","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"This is the payload: <b>hello world</b> !","tot":"str"}],"x":1102,"y":1017,"wires":[[]]},{"id":"f1d52f3c187a674e","type":"template","z":"08183069b5f8ef9c","name":"single { .. }","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {payload} !","output":"str","x":866,"y":813,"wires":[["cc3819b467390aab"]]},{"id":"cc3819b467390aab","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","rules":[{"p":"payload","pt":"msg","t":"eql","to":"This is the payload: {payload} !","tot":"str"}],"x":1102,"y":773,"wires":[[]]}]
|
package/nodes/ut-assert-debug.js
CHANGED
|
@@ -68,6 +68,196 @@ module.exports = function(RED) {
|
|
|
68
68
|
RED.nodes.registerType("ut-assert-debug", Coreut_assert_debugFunctionality);
|
|
69
69
|
|
|
70
70
|
// Backend endpoints
|
|
71
|
+
RED.httpAdmin.post("/UnitTesting/:flowid/testworkspace",
|
|
72
|
+
RED.auth.needsPermission("flowhub.write"),
|
|
73
|
+
(req, res) => {
|
|
74
|
+
if (req.body) {
|
|
75
|
+
|
|
76
|
+
// API defined here --> https://github.com/node-red/node-red/blob/master/packages/node_modules/%40node-red/runtime/lib/index.js
|
|
77
|
+
const runtime = require("@node-red/runtime");
|
|
78
|
+
const jsonClone = require("rfdc")();
|
|
79
|
+
|
|
80
|
+
// if a test generates an uncaught exception, then captcha that and generate
|
|
81
|
+
// a failure - tests are considered failed if they generate uncaught exceptions/errors.
|
|
82
|
+
let createExtraCatchNode = () => {
|
|
83
|
+
let changeId = runtime.util.generateId()
|
|
84
|
+
let assertId = runtime.util.generateId()
|
|
85
|
+
let debugId = runtime.util.generateId()
|
|
86
|
+
|
|
87
|
+
return [
|
|
88
|
+
{
|
|
89
|
+
"id": runtime.util.generateId(),
|
|
90
|
+
"type": "catch",
|
|
91
|
+
"name": "",
|
|
92
|
+
"scope": null,
|
|
93
|
+
"uncaught": true,
|
|
94
|
+
"wires": [
|
|
95
|
+
[
|
|
96
|
+
changeId
|
|
97
|
+
]
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": changeId,
|
|
102
|
+
"type": "change",
|
|
103
|
+
"name": "",
|
|
104
|
+
"rules": [
|
|
105
|
+
{
|
|
106
|
+
"t": "set",
|
|
107
|
+
"p": "_unittest_triggered",
|
|
108
|
+
"pt": "msg",
|
|
109
|
+
"to": "true",
|
|
110
|
+
"tot": "bool"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"action": "",
|
|
114
|
+
"property": "",
|
|
115
|
+
"from": "",
|
|
116
|
+
"to": "",
|
|
117
|
+
"reg": false,
|
|
118
|
+
"wires": [
|
|
119
|
+
[
|
|
120
|
+
assertId,
|
|
121
|
+
debugId
|
|
122
|
+
]
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": debugId,
|
|
127
|
+
"type": "debug",
|
|
128
|
+
"name": "",
|
|
129
|
+
"active": true,
|
|
130
|
+
"tosidebar": false,
|
|
131
|
+
"console": true,
|
|
132
|
+
"tostatus": false,
|
|
133
|
+
"complete": "payload",
|
|
134
|
+
"targetType": "msg",
|
|
135
|
+
"statusVal": "",
|
|
136
|
+
"statusType": "auto",
|
|
137
|
+
"wires": []
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"id": assertId,
|
|
141
|
+
"type": "ut-assert-failure",
|
|
142
|
+
"name": "",
|
|
143
|
+
"wires": []
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
let replacedPrivInFileNames = (flowdetails) => {
|
|
149
|
+
const path = require('path');
|
|
150
|
+
const runtime = require("@node-red/runtime");
|
|
151
|
+
|
|
152
|
+
let getHttpServer = (settings) => {
|
|
153
|
+
var port = settings.serverPort;
|
|
154
|
+
if (port === undefined) {
|
|
155
|
+
port = settings.uiPort;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var listenPath = 'http' + (settings.https ? 's' : '') + '://' +
|
|
159
|
+
(settings.uiHost == '::' ? 'localhost' : (settings.uiHost == '0.0.0.0' ? '127.0.0.1' : settings.uiHost)) +
|
|
160
|
+
':' + port;
|
|
161
|
+
|
|
162
|
+
return listenPath;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let privDir = path.resolve(path.dirname(__filename), "..", "priv")
|
|
166
|
+
let httpServer = getHttpServer(runtime._.settings)
|
|
167
|
+
|
|
168
|
+
flowdetails.forEach( obj => {
|
|
169
|
+
if (obj.type == "inject") {
|
|
170
|
+
obj.props.forEach( prp => {
|
|
171
|
+
if (prp.v) prp.v = prp.v.replaceAll(/\${priv}/g, privDir).replaceAll(/\${host}/g, httpServer)
|
|
172
|
+
})
|
|
173
|
+
} else if (obj.type == "file in") {
|
|
174
|
+
if (obj.filenameType == "str" && obj.filename) obj.filename = obj.filename.replaceAll(/\${priv}/g, privDir)
|
|
175
|
+
} else if (obj.type == "http request") {
|
|
176
|
+
if (obj.url) obj.url = obj.url.replaceAll(/\${host}/g, httpServer)
|
|
177
|
+
} else if (obj.type == "change") {
|
|
178
|
+
obj.rules.forEach(prp => {
|
|
179
|
+
if (prp.tot == "str" && prp.to) {
|
|
180
|
+
prp.to = prp.to.replaceAll(/\${host}/g, httpServer).replaceAll(/\${priv}/g, privDir)
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
return flowdetails
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
let isErlangRedOnly = (tabDetails) => {
|
|
190
|
+
return tabDetails.env.filter(d => d.name == "ERED_ONLY")[0]?.value == "true"
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let isTestPending = (tabDetails) => {
|
|
194
|
+
return tabDetails.env.filter(d => d.name == "NRED_PENDING")[0]?.value == "true"
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// chunkify an array into chunks of `size` size
|
|
198
|
+
let chunkify = (array, size) => {
|
|
199
|
+
const chunkedArray = [];
|
|
200
|
+
for (let i = 0; i < array.length; i += size) {
|
|
201
|
+
chunkedArray.push(array.slice(i, i + size));
|
|
202
|
+
}
|
|
203
|
+
return chunkedArray;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// respond to request with a list of total tests to be done. The frontend then
|
|
207
|
+
// shows a progress indication of success / pending / failure
|
|
208
|
+
let respondWithCount = (res, count) => {
|
|
209
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
210
|
+
res.end(JSON.stringify({ status: "ok", todo: count }));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
setTimeout( () => {
|
|
215
|
+
let flowDetails = req.body["flowdata"]
|
|
216
|
+
|
|
217
|
+
let origFlowId = flowDetails.filter(d => d.type == "tab")[0].id
|
|
218
|
+
let tabDetails = flowDetails.filter(d => d.type == "tab")[0]
|
|
219
|
+
let injNodesIds = flowDetails.filter(d => d.type == "inject").map(d => d.id)
|
|
220
|
+
|
|
221
|
+
if (isErlangRedOnly(tabDetails)) {
|
|
222
|
+
RED.comms.publish("unittesting:testresults", {
|
|
223
|
+
flowid: origFlowId,
|
|
224
|
+
status: "not-supported"
|
|
225
|
+
})
|
|
226
|
+
return null
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
flowDetails = replacedPrivInFileNames(flowDetails)
|
|
230
|
+
|
|
231
|
+
// add an catch all and trigger a assert false if any exceptions are
|
|
232
|
+
// raised by the test - if there isn't already a catch all node.
|
|
233
|
+
if (flowDetails.filter(d => d.type == "catch").filter(d => d.scope == null).length == 0) {
|
|
234
|
+
flowDetails = flowDetails.concat(createExtraCatchNode())
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
var newConfig = jsonClone(runtime._.flows.getFlows().flows);
|
|
239
|
+
newConfig = newConfig.concat(flowDetails);
|
|
240
|
+
|
|
241
|
+
runtime._.flows.removeFlow(origFlowId, "root").then(result => {
|
|
242
|
+
runtime._.flows.setFlows(newConfig, null, 'flows', false, null, "root").then((rev) => {
|
|
243
|
+
runtime._.flows.startFlows("full", null, false, true).then(d => {
|
|
244
|
+
setTimeout(() => {
|
|
245
|
+
injNodesIds.forEach(ndeId => {
|
|
246
|
+
RED.nodes.getNode(ndeId)?.receive({ "_unittest_triggered": true })
|
|
247
|
+
})
|
|
248
|
+
}, 200)
|
|
249
|
+
})
|
|
250
|
+
})
|
|
251
|
+
})
|
|
252
|
+
}, 10)
|
|
253
|
+
|
|
254
|
+
res.sendStatus(200);
|
|
255
|
+
} else {
|
|
256
|
+
res.sendStatus(405);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
|
|
71
261
|
RED.httpAdmin.get("/UnitTesting/:flowid/runtest",
|
|
72
262
|
(req, res) => {
|
|
73
263
|
const path = require('path');
|
|
@@ -147,6 +337,47 @@ let createExtraCatchNode = () => {
|
|
|
147
337
|
]
|
|
148
338
|
}
|
|
149
339
|
|
|
340
|
+
let replacedPrivInFileNames = (flowdetails) => {
|
|
341
|
+
const path = require('path');
|
|
342
|
+
const runtime = require("@node-red/runtime");
|
|
343
|
+
|
|
344
|
+
let getHttpServer = (settings) => {
|
|
345
|
+
var port = settings.serverPort;
|
|
346
|
+
if (port === undefined) {
|
|
347
|
+
port = settings.uiPort;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
var listenPath = 'http' + (settings.https ? 's' : '') + '://' +
|
|
351
|
+
(settings.uiHost == '::' ? 'localhost' : (settings.uiHost == '0.0.0.0' ? '127.0.0.1' : settings.uiHost)) +
|
|
352
|
+
':' + port;
|
|
353
|
+
|
|
354
|
+
return listenPath;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
let privDir = path.resolve(path.dirname(__filename), "..", "priv")
|
|
358
|
+
let httpServer = getHttpServer(runtime._.settings)
|
|
359
|
+
|
|
360
|
+
flowdetails.forEach( obj => {
|
|
361
|
+
if (obj.type == "inject") {
|
|
362
|
+
obj.props.forEach( prp => {
|
|
363
|
+
if (prp.v) prp.v = prp.v.replaceAll(/\${priv}/g, privDir).replaceAll(/\${host}/g, httpServer)
|
|
364
|
+
})
|
|
365
|
+
} else if (obj.type == "file in") {
|
|
366
|
+
if (obj.filenameType == "str" && obj.filename) obj.filename = obj.filename.replaceAll(/\${priv}/g, privDir)
|
|
367
|
+
} else if (obj.type == "http request") {
|
|
368
|
+
if (obj.url) obj.url = obj.url.replaceAll(/\${host}/g, httpServer)
|
|
369
|
+
} else if (obj.type == "change") {
|
|
370
|
+
obj.rules.forEach(prp => {
|
|
371
|
+
if (prp.tot == "str" && prp.to) {
|
|
372
|
+
prp.to = prp.to.replaceAll(/\${host}/g, httpServer).replaceAll(/\${priv}/g, privDir)
|
|
373
|
+
}
|
|
374
|
+
})
|
|
375
|
+
}
|
|
376
|
+
})
|
|
377
|
+
|
|
378
|
+
return flowdetails
|
|
379
|
+
}
|
|
380
|
+
|
|
150
381
|
let isErlangRedOnly = (tabDetails) => {
|
|
151
382
|
return tabDetails.env.filter(d => d.name == "ERED_ONLY")[0]?.value == "true"
|
|
152
383
|
}
|
|
@@ -185,7 +416,9 @@ let respondWithCount = (res, count) => {
|
|
|
185
416
|
|
|
186
417
|
let allTests = [...a, ...b]
|
|
187
418
|
|
|
188
|
-
// if a limit (i.e. a list of testFlow ids) is provided, only
|
|
419
|
+
// if a limit (i.e. a list of testFlow ids) is provided, only perform those tests.
|
|
420
|
+
// the limit is defined when a group is tested --> only the flowids in the group
|
|
421
|
+
// are tested.
|
|
189
422
|
if (req.query.limit) {
|
|
190
423
|
let testIds = req.query.limit.split(",")
|
|
191
424
|
|
|
@@ -244,6 +477,8 @@ let respondWithCount = (res, count) => {
|
|
|
244
477
|
timeoutValues.push(parseInt(d.value) * 1000)
|
|
245
478
|
})
|
|
246
479
|
|
|
480
|
+
flowDetails = replacedPrivInFileNames(flowDetails)
|
|
481
|
+
|
|
247
482
|
// add an catch all and trigger a assert false if any exceptions are
|
|
248
483
|
// raised by the test - if there isn't already a catch all node.
|
|
249
484
|
if (flowDetails.filter(d => d.type == "catch").filter(d => d.scope == null).length == 0) {
|
|
@@ -369,7 +604,9 @@ let respondWithCount = (res, count) => {
|
|
|
369
604
|
tabDetails.env.filter(d => d.name == "NRED_TIMEOUT").forEach(d => {
|
|
370
605
|
timeoutValues.push(parseInt(d.value) * 1000)
|
|
371
606
|
})
|
|
372
|
-
|
|
607
|
+
|
|
608
|
+
flowDetails = replacedPrivInFileNames(flowDetails)
|
|
609
|
+
|
|
373
610
|
// add an catch all and trigger a assert false if any exceptions are
|
|
374
611
|
// raised by the test - if there isn't already a catch all node.
|
|
375
612
|
if (flowDetails.filter(d => d.type == "catch").filter(d => d.scope == null).length == 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gregoriusrippenstein/erlang-red-unittest",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
},
|
|
6
6
|
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"ut-assert-values": "nodes/ut-assert-values.js",
|
|
33
33
|
"ut-assert-success": "nodes/ut-assert-success.js",
|
|
34
34
|
"ut-assert-status": "nodes/ut-assert-status.js",
|
|
35
|
-
"ut-assert-debug": "nodes/ut-assert-debug.js"
|
|
35
|
+
"ut-assert-debug": "nodes/ut-assert-debug.js",
|
|
36
|
+
"ut-config": "nodes/ut-config.js"
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
|
package/plugins/sidebar.html
CHANGED
|
@@ -110,16 +110,23 @@ function doFlowImportForSidebarUnittesting(flowid) {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
RED.
|
|
113
|
+
if ( RED.view.state() === RED.state.DEFAULT) {
|
|
114
|
+
RED.clipboard.import();
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
setTimeout(() => {
|
|
117
|
+
var content = e.flowdata;
|
|
117
118
|
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
$('#red-ui-clipboard-dialog-import-text').val(
|
|
121
|
+
JSON.stringify(content)
|
|
122
|
+
).trigger("paste");
|
|
123
|
+
}, 300);
|
|
124
|
+
} else {
|
|
125
|
+
RED.notify("Close editor panel and retry, cannot open import dialog while editing nodes.", {
|
|
126
|
+
type: "warning",
|
|
127
|
+
timeout: 3000
|
|
128
|
+
});
|
|
129
|
+
}
|
|
123
130
|
}).fail(e => {
|
|
124
131
|
let msg = "<p>Failed to retrieve test flow data from server.</p>" +
|
|
125
132
|
$('#node-input-unittestingpull-flowid').val().trim() + "</p>" +
|
|
@@ -250,7 +257,62 @@ function clearDebugPanel() {
|
|
|
250
257
|
RED.actions.invoke("core:clear-debug-messages")
|
|
251
258
|
}
|
|
252
259
|
|
|
253
|
-
function
|
|
260
|
+
function runWorkspaceAsTest(flowid) {
|
|
261
|
+
// this is an Erlang-Red special.
|
|
262
|
+
|
|
263
|
+
let getFlowDataFromCurrentWorkspace = (flowid) => {
|
|
264
|
+
/******
|
|
265
|
+
** Code taken from Node-RED code base:
|
|
266
|
+
**
|
|
267
|
+
** https://github.com/node-red/node-red/blob/e8ddee24a9944e57d186f02b081295c56a45b67c/packages/node_modules/%40node-red/editor-client/src/js/ui/clipboard.js#L710-L723
|
|
268
|
+
**
|
|
269
|
+
**/
|
|
270
|
+
var activeWorkspace = flowid || RED.workspaces.active();
|
|
271
|
+
var nodes = RED.nodes.groups(activeWorkspace);
|
|
272
|
+
|
|
273
|
+
nodes = nodes.concat(RED.nodes.junctions(activeWorkspace));
|
|
274
|
+
nodes = nodes.concat(RED.nodes.filterNodes({ z: activeWorkspace }));
|
|
275
|
+
|
|
276
|
+
RED.nodes.eachConfig(function (n) {
|
|
277
|
+
if (n.z === RED.workspaces.active() && n._def.hasUsers === false) {
|
|
278
|
+
// Grab any config nodes scoped to this flow that don't
|
|
279
|
+
// require any flow-nodes to use them
|
|
280
|
+
nodes.push(n);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
var parentNode = RED.nodes.workspace(
|
|
285
|
+
activeWorkspace
|
|
286
|
+
) || RED.nodes.subflow(activeWorkspace);
|
|
287
|
+
|
|
288
|
+
nodes.unshift(parentNode);
|
|
289
|
+
|
|
290
|
+
return RED.nodes.createExportableNodeSet(nodes);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (flowid) {
|
|
294
|
+
$.ajax({
|
|
295
|
+
url: `UnitTesting/${flowid}/testworkspace`,
|
|
296
|
+
type: "POST",
|
|
297
|
+
contentType: "application/json; charset=utf-8",
|
|
298
|
+
|
|
299
|
+
data: JSON.stringify({
|
|
300
|
+
flowdata: getFlowDataFromCurrentWorkspace(flowid),
|
|
301
|
+
}),
|
|
302
|
+
|
|
303
|
+
success: function (resp) {
|
|
304
|
+
RED.notify(`Triggered test run for ${flowid}`, "info")
|
|
305
|
+
$('#node-input-unittestingpull-testresults-row').find(".todo").html(resp.todo)
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
error: function (jqXHR, textStatus, errorThrown) {
|
|
309
|
+
RED.notify("Failed to trigger test", "error")
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function runTestForFlowId(flowid, dirList=undefined) {
|
|
254
316
|
if (flowid) {
|
|
255
317
|
if (dirList) {
|
|
256
318
|
resetTestResultsForFlowId(dirList,flowid)
|
|
@@ -290,8 +352,10 @@ function testCurrentWorkspace() {
|
|
|
290
352
|
if (RED.comms.isConnected && !RED.comms.isConnected()) {
|
|
291
353
|
return RED.notify("Not connected to server, websocket down", "error")
|
|
292
354
|
}
|
|
293
|
-
|
|
294
|
-
|
|
355
|
+
|
|
356
|
+
// if ( RED.isErlangRed ) {
|
|
357
|
+
runWorkspaceAsTest(RED.workspaces.active())
|
|
358
|
+
/*
|
|
295
359
|
} else {
|
|
296
360
|
RED.notify("restarting flow", { type: "info" });
|
|
297
361
|
RED.actions.invoke("core:restart-flows")
|
|
@@ -301,6 +365,7 @@ function testCurrentWorkspace() {
|
|
|
301
365
|
RED.search.search("type:inject flow:current").map(d => d.node).forEach(d => RED.view.clickNodeButton(d))
|
|
302
366
|
}, 2000)
|
|
303
367
|
}
|
|
368
|
+
*/
|
|
304
369
|
}
|
|
305
370
|
|
|
306
371
|
function triggerInjectsInWorkspace() {
|
|
@@ -568,10 +633,11 @@ RED.actions.add("unittesting:trigger-injects-in-workspace", triggerInjectsInWork
|
|
|
568
633
|
|
|
569
634
|
$('#node-input-unittestingpull-testresults-row').on('click', 'span.filtrg', (e) => {
|
|
570
635
|
e.preventDefault();
|
|
571
|
-
|
|
636
|
+
let filtervalue = $(e.target).data('filter') || $($(e.target).parent()).data('filter')
|
|
637
|
+
if (!filtervalue) {
|
|
572
638
|
$('#node-input-unittestingpull-sb-target-filter').val('').trigger('keyup', { keyCode: 13})
|
|
573
639
|
} else {
|
|
574
|
-
let newVal = `is:${
|
|
640
|
+
let newVal = `is:${filtervalue}`
|
|
575
641
|
let currVal = $('#node-input-unittestingpull-sb-target-filter').val()
|
|
576
642
|
|
|
577
643
|
if ( newVal == currVal) { newVal = "" } // toggle between filter and all
|
|
@@ -686,7 +752,7 @@ $('#node-input-unittestingselect-test-node').on('click', (e) => {
|
|
|
686
752
|
|
|
687
753
|
<div class="form-row" style="margin-left: 10px; margin-top: 30px;">
|
|
688
754
|
<button id="node-input-unittestingpull-sb-refresh-list-but"
|
|
689
|
-
class="red-ui-button"><i class="fa fa-refresh"></i
|
|
755
|
+
class="red-ui-button"><i class="fa fa-refresh"></i></button>
|
|
690
756
|
<a id="unittesting-view-testflow-link"
|
|
691
757
|
style="color: blue; display: none; margin-left: 20px;"
|
|
692
758
|
target="_blank" href="">Share Testcase <i class="fa fa-external-link"></i></a>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hello world
|