topological-nodered-wdio 0.5.2 → 0.5.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/package.json +1 -1
- package/src/document-helper.html +22 -8
- package/src/document-helper.js +2 -0
- package/src/wdio-common.js +4 -3
package/package.json
CHANGED
package/src/document-helper.html
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
<script type="text/javascript">
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
|
|
3
|
+
function setValue() {
|
|
4
|
+
return $('#node-input-line').val()
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function setChanges() {
|
|
8
|
+
return $('#node-input-refUrl').val()
|
|
9
|
+
}
|
|
10
|
+
|
|
2
11
|
RED.nodes.registerType('document-helper', {
|
|
3
12
|
category: 'Webdriver IO',
|
|
4
|
-
color: '#
|
|
13
|
+
color: '#FFFFFF',
|
|
5
14
|
defaults: {
|
|
6
15
|
name: { value: '' },
|
|
7
|
-
|
|
16
|
+
refUrl: {value: setChanges()},
|
|
17
|
+
line: {value: setValue()}
|
|
8
18
|
},
|
|
9
19
|
inputs: 1,
|
|
10
20
|
outputs: 1,
|
|
@@ -22,20 +32,24 @@
|
|
|
22
32
|
<input id="node-input-name" type="text">
|
|
23
33
|
</div>
|
|
24
34
|
|
|
35
|
+
<div class="form-row">
|
|
36
|
+
<input type="checkbox" id="node-input-line" name="node-input-line" onclick="setValue()" style="width:auto; margin-right:20%" />
|
|
37
|
+
<label for="node-input-line" style="min-width:70%;color:#87A980"><b> Use new line as separator</b></label>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
25
40
|
<div class="form-row">
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
<label for="node-input-refUrl"><i class="fa fa-tag"></i> Ref. URl</label>
|
|
42
|
+
<textarea id="node-input-refUrl" name="node-input-refUrl" class="node-text-editor" rows="3" style="min-width:70%;" onblur="setChanges()"></textarea>
|
|
28
43
|
</div>
|
|
29
44
|
</script>
|
|
30
45
|
|
|
31
|
-
|
|
32
|
-
|
|
33
46
|
<script type="text/x-red" data-help-name="document-helper">
|
|
34
47
|
<h3>Log helper node uses to add notes to <code>global.document</code></h3>
|
|
35
48
|
<h3>Details</h3>
|
|
36
49
|
<dl class="message-properties">
|
|
37
50
|
<dt>Name: name of the log to be added to <code>global.document</code></dt>
|
|
38
|
-
<dt>
|
|
51
|
+
<dt>New Line: Check the checkbox for Use new line as separator</dt>
|
|
52
|
+
<dt>Ref Url.: A quick reference url that needs to be added to document.</dt>
|
|
39
53
|
</dl>
|
|
40
54
|
|
|
41
55
|
<h3>Outputs</h3>
|
package/src/document-helper.js
CHANGED
package/src/wdio-common.js
CHANGED
|
@@ -150,13 +150,14 @@ module.exports.log = async (node) => {
|
|
|
150
150
|
let context = node.context()
|
|
151
151
|
let stepCount = await (context.global.get('stepCount') || 0) + 1
|
|
152
152
|
let document = await context.global.get('document') || ''
|
|
153
|
-
await context.global.set('document', `${document}
|
|
153
|
+
await context.global.set('document', `${document}${stepCount}. Node: ${node.name} - ${node.log}\n`)
|
|
154
154
|
await context.global.set('stepCount', stepCount)
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
module.exports.document = async (node) => {
|
|
158
158
|
let context = node.context()
|
|
159
|
-
let name = node.name
|
|
160
159
|
let document = await context.global.get('document') || ''
|
|
161
|
-
|
|
160
|
+
document = node.line? `${document}\n${node.name}${node.refUrl? `\nRef: ${node.refUrl}`:''}\n\n` :
|
|
161
|
+
`${document}********************\n${node.name}${node.refUrl? `\nRef: ${node.refUrl}`:''}\n********************\n`
|
|
162
|
+
await context.global.set('document', document.replaceAll('\\n','\n'))
|
|
162
163
|
}
|