topological-nodered-wdio 0.5.4 → 1.0.0

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.
@@ -1,67 +1,67 @@
1
- <script type="text/javascript">
2
- function setFrameAction() {
3
- let action = $('#node-input-action').val()
4
- $('#actionFrame').hide()
5
- if (action === 'frame') {
6
- $('#actionFrame').show()
7
- }
8
- }
9
-
10
- RED.nodes.registerType('frame-action', {
11
- category: 'Webdriver IO',
12
- color: '#a6bbcf',
13
- defaults: {
14
- name: { value: '' },
15
- action: { value: 'frame' },
16
- frame: { value: '' }
17
- },
18
- inputs: 1,
19
- outputs: 1,
20
- icon: 'white-globe.png',
21
- label: function() {
22
- return this.name || 'frame action'
23
- },
24
- oneditprepare: function() {
25
- setFrameAction()
26
- }
27
- })
28
- </script>
29
-
30
- <script type="text/x-red" data-template-name="frame-action">
31
- <div class="form-row">
32
- <label for="node-input-action"><i class="fa fa-tasks"></i> Action</label>
33
- <select type="text" id="node-input-action" style="width:70%;" onchange="setFrameAction()">
34
- <option value="frame">Switch to Frame</option>
35
- <option value="parentFrame">Switch to Parent Frame</option>
36
- </select>
37
- </div>
38
- <div class="form-row" id="actionFrame">
39
- <label for="node-input-frame"><i class="fa fa-tasks"></i> Frame Name</label>
40
- <input id="node-input-frame" type="text" >
41
- </div>
42
- <div class="form-row">
43
- <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
44
- <input id="node-input-name" type="text">
45
- </div>
46
- </script>
47
-
48
- <script type="text/x-red" data-help-name="frame-action">
49
- <h3>Select the current top-level browsing context or a child/parent browsing context of the current browsing context to use as the current browsing context for subsequent commands</h3>
50
- <h3>Details</h3>
51
- <dl class="message-properties">
52
- <dt>Action: <span class="property-type">select</span></dt>
53
- <dd>
54
- <ul>
55
- <li><b>Switch to Frame</b></li>
56
- <ul>
57
- <li>The Switch To Frame command is used to select the current top-level browsing context or a child browsing context of the current browsing context to use as the current browsing context for subsequent commands.</li>
58
- </ul>
59
- <li><b>Switch to Parent Frame</b></li>
60
- <ul>
61
- <li>The Switch to Parent Frame command sets the current browsing context for future commands to the parent of the current browsing context.</li>
62
- </ul>
63
- </ul>
64
- </dd>
65
- </dl>
66
- </script>
67
-
1
+ <script type="text/javascript">
2
+ function setFrameAction() {
3
+ let action = $('#node-input-action').val()
4
+ $('#actionFrame').hide()
5
+ if (action === 'frame') {
6
+ $('#actionFrame').show()
7
+ }
8
+ }
9
+
10
+ RED.nodes.registerType('frame-action', {
11
+ category: 'Webdriver IO',
12
+ color: '#a6bbcf',
13
+ defaults: {
14
+ name: { value: '' },
15
+ action: { value: 'frame' },
16
+ frame: { value: '' }
17
+ },
18
+ inputs: 1,
19
+ outputs: 1,
20
+ icon: 'white-globe.png',
21
+ label: function() {
22
+ return this.name || 'frame action'
23
+ },
24
+ oneditprepare: function() {
25
+ setFrameAction()
26
+ }
27
+ })
28
+ </script>
29
+
30
+ <script type="text/x-red" data-template-name="frame-action">
31
+ <div class="form-row">
32
+ <label for="node-input-action"><i class="fa fa-tasks"></i> Action</label>
33
+ <select type="text" id="node-input-action" style="width:70%;" onchange="setFrameAction()">
34
+ <option value="frame">Switch to Frame</option>
35
+ <option value="parentFrame">Switch to Parent Frame</option>
36
+ </select>
37
+ </div>
38
+ <div class="form-row" id="actionFrame">
39
+ <label for="node-input-frame"><i class="fa fa-tasks"></i> Frame Name</label>
40
+ <input id="node-input-frame" type="text" >
41
+ </div>
42
+ <div class="form-row">
43
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
44
+ <input id="node-input-name" type="text">
45
+ </div>
46
+ </script>
47
+
48
+ <script type="text/x-red" data-help-name="frame-action">
49
+ <h3>Select the current top-level browsing context or a child/parent browsing context of the current browsing context to use as the current browsing context for subsequent commands</h3>
50
+ <h3>Details</h3>
51
+ <dl class="message-properties">
52
+ <dt>Action: <span class="property-type">select</span></dt>
53
+ <dd>
54
+ <ul>
55
+ <li><b>Switch to Frame</b></li>
56
+ <ul>
57
+ <li>The Switch To Frame command is used to select the current top-level browsing context or a child browsing context of the current browsing context to use as the current browsing context for subsequent commands.</li>
58
+ </ul>
59
+ <li><b>Switch to Parent Frame</b></li>
60
+ <ul>
61
+ <li>The Switch to Parent Frame command sets the current browsing context for future commands to the parent of the current browsing context.</li>
62
+ </ul>
63
+ </ul>
64
+ </dd>
65
+ </dl>
66
+ </script>
67
+
@@ -1,38 +1,38 @@
1
- const common = require('./wdio-common')
2
-
3
- module.exports = function(RED) {
4
- function frameAction(config) {
5
- RED.nodes.createNode(this, config)
6
- const node = this
7
- common.clearStatus(node)
8
-
9
- node.on('input', async (msg) => {
10
- try {
11
- let browser = await common.getBrowser(node.context())
12
-
13
- let frame = config.frame || msg.value
14
-
15
- if (config.action === 'frame') {
16
- let checkNumber = Number(frame)
17
- if (!Number.isNaN(checkNumber)) {
18
- node.log = `Switch to frame/iFrame, identified using index: "${frame}".`
19
- await browser.switchToFrame(parseInt(frame))
20
- } else {
21
- node.log = `Switch to frame/iFrame, identified using selector: "${frame}".`
22
- //Need to fix this to find element
23
- await browser.switchToFrame(frame)
24
- }
25
- } else if (config.action === 'parentFrame') {
26
- await browser.switchToParentFrame()
27
- }
28
- await common.log(node)
29
- common.successStatus(node)
30
- node.send(msg)
31
- } catch (e) {
32
- await common.log(node)
33
- common.handleError(e, node, msg)
34
- }
35
- })
36
- }
37
- RED.nodes.registerType('frame-action', frameAction)
38
- }
1
+ const common = require('./wdio-common')
2
+
3
+ module.exports = function(RED) {
4
+ function frameAction(config) {
5
+ RED.nodes.createNode(this, config)
6
+ const node = this
7
+ common.clearStatus(node)
8
+
9
+ node.on('input', async (msg) => {
10
+ try {
11
+ let browser = await common.getBrowser(node.context())
12
+
13
+ let frame = config.frame || msg.value
14
+
15
+ if (config.action === 'frame') {
16
+ let checkNumber = Number(frame)
17
+ if (!Number.isNaN(checkNumber)) {
18
+ node.log = `Switch to frame/iFrame, identified using index: "${frame}".`
19
+ await browser.switchToFrame(parseInt(frame))
20
+ } else {
21
+ node.log = `Switch to frame/iFrame, identified using selector: "${frame}".`
22
+ //Need to fix this to find element
23
+ await browser.switchToFrame(frame)
24
+ }
25
+ } else if (config.action === 'parentFrame') {
26
+ await browser.switchToParentFrame()
27
+ }
28
+ await common.log(node)
29
+ common.successStatus(node)
30
+ node.send(msg)
31
+ } catch (e) {
32
+ await common.log(node)
33
+ common.handleError(e, node, msg)
34
+ }
35
+ })
36
+ }
37
+ RED.nodes.registerType('frame-action', frameAction)
38
+ }
@@ -1,85 +1,85 @@
1
- <script type="text/javascript">
2
- function setWaitAction() {
3
- let action = $('#node-input-action').val()
4
- $('#actionImplicit').show()
5
- $('#actionPageLoad').show()
6
- $('#actionScript').show()
7
- if (action === 'get') {
8
- $('#actionImplicit').hide()
9
- $('#actionPageLoad').hide()
10
- $('#actionScript').hide()
11
- }
12
- }
13
-
14
- RED.nodes.registerType('implicit-wait-config', {
15
- category: 'Webdriver IO',
16
- color: '#a6bbcf',
17
- defaults: {
18
- name: { value: '' },
19
- implicit: { value: '' },
20
- pageload: { value: '' },
21
- script: { value: '' },
22
- action: { value: '' }
23
- },
24
- inputs: 1,
25
- outputs: 1,
26
- icon: 'white-globe.png',
27
- label: function() {
28
- return this.name || 'implicit-wait config'
29
- },
30
- oneditprepare: function() {
31
- setWaitAction()
32
- }
33
- })
34
- </script>
35
-
36
- <script type="text/x-red" data-template-name="implicit-wait-config">
37
-
38
- <div class="form-row">
39
- <label for="node-input-action"><i class="fa fa-tasks"></i> Action</label>
40
- <select type="text" id="node-input-action" style="width:70%;" onchange="setWaitAction()">
41
- <option value="set">Set Timeouts</option>
42
- <option value="get">Get Timeouts</option>
43
- </select>
44
- </div>
45
- <div class="form-row" id="actionImplicit" >
46
- <label for="node-input-implicit"><i class="fa fa-tasks"></i> Implicit Wait</label>
47
- <input id="node-input-implicit" type="text" placeholder="in ms">
48
- </div>
49
- <div class="form-row" id="actionPageLoad" >
50
- <label for="node-input-pageload"><i class="fa fa-tasks"></i> Page Load Timeout</label>
51
- <input id="node-input-pageload" type="text" placeholder="in ms">
52
- </div>
53
- <div class="form-row" id="actionScript" >
54
- <label for="node-input-script"><i class="fa fa-tasks"></i> Script Timeout</label>
55
- <input id="node-input-script" type="text" placeholder="in ms">
56
- </div>
57
- <div class="form-row">
58
- <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
59
- <input id="node-input-name" type="text">
60
- </div>
61
- </script>
62
-
63
- <script type="text/x-red" data-help-name="implicit-wait-config">
64
- <h3>The Set Timeouts command sets timeout durations associated with the current session.</h3>
65
- <h3>Inputs</h3>
66
- <dl class="message-properties">
67
- <dt><code>mgs.implicit</code>: <span class="property-type">int</span></dt>
68
- <dd>Integer in ms for session implicit wait timeout</dd>
69
- <dt><code>msg.pageload</code><span class="property-type">int</span></dt>
70
- <dd>Integer in ms for session page load timeout<br></dd>
71
- <dt><code>msg.script</code><span class="property-type">int</span></dt>
72
- <dd>Integer in ms for session script timeout</dd>
73
- </dl>
74
-
75
- <h3>Details</h3>
76
- <p><b>Action</b> specifies the action to be performed on the target web element. Actions includes:
77
- <ul>
78
- <li><b>Get Timeouts</b>: The Get Timeouts command gets timeout durations associated with the current session.</li>
79
- <li><b>Set Timeouts</b>: The Set Timeouts command sets timeout durations associated with the current session. The timeouts that can be controlled are listed below.</li>
80
- </ul>
81
-
82
- <p><b>Implicit Wait</b> Integer in ms for session implicit wait timeout.<br></p>
83
- <p><b>Page Load Timeout</b> Integer in ms for session page load timeout.<br></p>
84
- <p><b>Script Timeout</b> Integer in ms for session script timeout.<br></p>
85
- </script>
1
+ <script type="text/javascript">
2
+ function setWaitAction() {
3
+ let action = $('#node-input-action').val()
4
+ $('#actionImplicit').show()
5
+ $('#actionPageLoad').show()
6
+ $('#actionScript').show()
7
+ if (action === 'get') {
8
+ $('#actionImplicit').hide()
9
+ $('#actionPageLoad').hide()
10
+ $('#actionScript').hide()
11
+ }
12
+ }
13
+
14
+ RED.nodes.registerType('implicit-wait-config', {
15
+ category: 'Webdriver IO',
16
+ color: '#a6bbcf',
17
+ defaults: {
18
+ name: { value: '' },
19
+ implicit: { value: '' },
20
+ pageload: { value: '' },
21
+ script: { value: '' },
22
+ action: { value: '' }
23
+ },
24
+ inputs: 1,
25
+ outputs: 1,
26
+ icon: 'white-globe.png',
27
+ label: function() {
28
+ return this.name || 'implicit-wait config'
29
+ },
30
+ oneditprepare: function() {
31
+ setWaitAction()
32
+ }
33
+ })
34
+ </script>
35
+
36
+ <script type="text/x-red" data-template-name="implicit-wait-config">
37
+
38
+ <div class="form-row">
39
+ <label for="node-input-action"><i class="fa fa-tasks"></i> Action</label>
40
+ <select type="text" id="node-input-action" style="width:70%;" onchange="setWaitAction()">
41
+ <option value="set">Set Timeouts</option>
42
+ <option value="get">Get Timeouts</option>
43
+ </select>
44
+ </div>
45
+ <div class="form-row" id="actionImplicit" >
46
+ <label for="node-input-implicit"><i class="fa fa-tasks"></i> Implicit Wait</label>
47
+ <input id="node-input-implicit" type="text" placeholder="in ms">
48
+ </div>
49
+ <div class="form-row" id="actionPageLoad" >
50
+ <label for="node-input-pageload"><i class="fa fa-tasks"></i> Page Load Timeout</label>
51
+ <input id="node-input-pageload" type="text" placeholder="in ms">
52
+ </div>
53
+ <div class="form-row" id="actionScript" >
54
+ <label for="node-input-script"><i class="fa fa-tasks"></i> Script Timeout</label>
55
+ <input id="node-input-script" type="text" placeholder="in ms">
56
+ </div>
57
+ <div class="form-row">
58
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
59
+ <input id="node-input-name" type="text">
60
+ </div>
61
+ </script>
62
+
63
+ <script type="text/x-red" data-help-name="implicit-wait-config">
64
+ <h3>The Set Timeouts command sets timeout durations associated with the current session.</h3>
65
+ <h3>Inputs</h3>
66
+ <dl class="message-properties">
67
+ <dt><code>mgs.implicit</code>: <span class="property-type">int</span></dt>
68
+ <dd>Integer in ms for session implicit wait timeout</dd>
69
+ <dt><code>msg.pageload</code><span class="property-type">int</span></dt>
70
+ <dd>Integer in ms for session page load timeout<br></dd>
71
+ <dt><code>msg.script</code><span class="property-type">int</span></dt>
72
+ <dd>Integer in ms for session script timeout</dd>
73
+ </dl>
74
+
75
+ <h3>Details</h3>
76
+ <p><b>Action</b> specifies the action to be performed on the target web element. Actions includes:
77
+ <ul>
78
+ <li><b>Get Timeouts</b>: The Get Timeouts command gets timeout durations associated with the current session.</li>
79
+ <li><b>Set Timeouts</b>: The Set Timeouts command sets timeout durations associated with the current session. The timeouts that can be controlled are listed below.</li>
80
+ </ul>
81
+
82
+ <p><b>Implicit Wait</b> Integer in ms for session implicit wait timeout.<br></p>
83
+ <p><b>Page Load Timeout</b> Integer in ms for session page load timeout.<br></p>
84
+ <p><b>Script Timeout</b> Integer in ms for session script timeout.<br></p>
85
+ </script>
@@ -1,41 +1,41 @@
1
- const common = require('./wdio-common')
2
-
3
- module.exports = function(RED) {
4
- function waitConfig(config) {
5
- RED.nodes.createNode(this, config)
6
- this.implicit = config.implicit
7
- this.pageload = config.pageload
8
- this.script = config.script
9
- const node = this
10
- common.clearStatus(node)
11
-
12
- node.on('input', async (msg) => {
13
- try {
14
- let browser = await common.getBrowser(node.context())
15
-
16
- let implicit = parseInt(node.implicit || msg.implicit)
17
- let pageLoad = parseInt(node.pageload || msg.pageload)
18
- let script = parseInt(node.script || msg.script)
19
-
20
- if (config.action === 'set') {
21
- var timeouts = {
22
- implicit,
23
- pageLoad,
24
- script
25
- }
26
- node.log = `Setup the implicit wait timeouts as "${timeouts}".`
27
- await browser.setTimeout(timeouts)
28
- } else if (config.action === 'get') {
29
- msg.payload = await browser.getTimeouts()
30
- }
31
- await common.log(node)
32
- common.successStatus(node)
33
- node.send(msg)
34
- } catch (e) {
35
- await common.log(node)
36
- common.handleError(e, node, msg)
37
- }
38
- })
39
- }
40
- RED.nodes.registerType('implicit-wait-config', waitConfig)
41
- }
1
+ const common = require('./wdio-common')
2
+
3
+ module.exports = function(RED) {
4
+ function waitConfig(config) {
5
+ RED.nodes.createNode(this, config)
6
+ this.implicit = config.implicit
7
+ this.pageload = config.pageload
8
+ this.script = config.script
9
+ const node = this
10
+ common.clearStatus(node)
11
+
12
+ node.on('input', async (msg) => {
13
+ try {
14
+ let browser = await common.getBrowser(node.context())
15
+
16
+ let implicit = parseInt(node.implicit || msg.implicit)
17
+ let pageLoad = parseInt(node.pageload || msg.pageload)
18
+ let script = parseInt(node.script || msg.script)
19
+
20
+ if (config.action === 'set') {
21
+ var timeouts = {
22
+ implicit,
23
+ pageLoad,
24
+ script
25
+ }
26
+ node.log = `Setup the implicit wait timeouts as "${timeouts}".`
27
+ await browser.setTimeout(timeouts)
28
+ } else if (config.action === 'get') {
29
+ msg.payload = await browser.getTimeouts()
30
+ }
31
+ await common.log(node)
32
+ common.successStatus(node)
33
+ node.send(msg)
34
+ } catch (e) {
35
+ await common.log(node)
36
+ common.handleError(e, node, msg)
37
+ }
38
+ })
39
+ }
40
+ RED.nodes.registerType('implicit-wait-config', waitConfig)
41
+ }