topological-nodered-wdio 0.4.7 → 0.5.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,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
+ }
@@ -1,96 +1,96 @@
1
- <script type="text/javascript">
2
- function setValue() {
3
- return $('#node-input-killSession').val()
4
- }
5
- //https://9bbb33aa-ac83-4087-9829-a264f90452fe@chrome.browserless.io:443/webdriver
6
- function setProvider() {
7
- if ($('#node-input-webdriverProvider').val() === 'browserless.io') {
8
- $('#node-input-webdriverUri').attr(
9
- 'placeholder',
10
- 'https://<apikey>:chrome.browserless.io:443/webdriver'
11
- )
12
- $('#node-input-webdriverBrowser').val('chrome')
13
- $('#row-browser').hide()
14
- } else if ($('#node-input-webdriverProvider').val() === 'local') {
15
- $('#row-browser').show()
16
- }
17
- }
18
-
19
- RED.nodes.registerType('new-session', {
20
- category: 'Webdriver IO',
21
- color: '#a6bbcf',
22
- defaults: {
23
- name: { value: '' },
24
- webdriverUri: { value: '' },
25
- webdriverProvider: { value: '' },
26
- webdriverBrowser: { value: '' },
27
- logLevel: { value: 'error' },
28
- killSession: { value: setValue() }
29
- },
30
- inputs: 1,
31
- outputs: 1,
32
- icon: 'white-globe.png',
33
- label: function() {
34
- return this.name || 'new session'
35
- }
36
- })
37
- </script>
38
-
39
- <script type="text/x-red" data-template-name="new-session">
40
- <div class="form-row">
41
- <label for="node-input-webdriverProvider"><i class="fa fa-globe"></i> Webdriver Remote Provider</label>
42
- <select type="text" id="node-input-webdriverProvider" style="width:70%;" onchange="setProvider()">
43
- <option value="browserless.io">browserless.io</option>
44
- <option value="local" selected>Local Webdriver</option>
45
- </select>
46
- </div>
47
- <div class="form-row">
48
- <label for="node-input-webdriverUri"><i class="fa fa-globe"></i> Webdriver Host URI</label>
49
- <input id="node-input-webdriverUri" type="text" placeholder="https://host:port/path">
50
- </div>
51
- <div class="form-row" id="row-browser">
52
- <label for="node-input-webdriverBrowser"><i class="fa fa-globe"></i> Browser</label>
53
- <select type="text" id="node-input-webdriverBrowser" style="width:70%;">
54
- <option value="chrome" selected>Chrome</option>
55
- <option value="chromium">Chromium</option>
56
- <option value="custom">Custom</option>
57
- </select>
58
- </div>
59
- <div class="form-row">
60
- <label for="node-input-logLevel"><i class="fa fa-tasks"></i> Log Level</label>
61
- <select type="text" id="node-input-logLevel" style="width:70%;">
62
- <option value="trace">Trace</option>
63
- <option value="debug">Debug</option>
64
- <option value="info">Info</option>
65
- <option value="warn">Warn</option>
66
- <option value="error" selected>Error</option>
67
- <option value="silent">Silent</option>
68
- </select>
69
- </div>
70
- <div class="form-row">
71
- <label for="node-input-killSession"><i class="fa fa-tasks"></i> Kill existing session on flow deploy</label>
72
- <input id="node-input-killSession" type="checkbox" onclick="setValue()" style="width:auto;">
73
- </div>
74
- <div class="form-row">
75
- <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
76
- <input id="node-input-name" type="text">
77
- </div>
78
- </script>
79
-
80
- <script type="text/x-red" data-help-name="new-session">
81
- <h3>Creates new session and also sets the "wdio_browser" global variable to the new session object.</h3>
82
- <h3>Inputs</h3>
83
- <dl class="message-properties">
84
- <dt>webdriverProvider: <span class="property-type">string</span></dt>
85
- <dd>Webdriver server name.</dd>
86
- <dt>webdriverUri: <span class="property-type">string</span></dt>
87
- <dd>The string format should be <protocal>://<hotsname>:<port number>/<path>, user 80/8080/443 if it is service based webdriver provider.</dd>
88
- <dd><code>msg.webdriverUri</code> can be used by leaving the webdriverUri field blank.</dd>
89
- <dt>Browser: <span class="property-type">string</span></dt>
90
- <dd>Chrome configs are default. We can pass custom capabilities by selecting Browser as `Custom` and pass `msg.capabilities` to the node.</dd>
91
- <dt>logLevel: <span class="property-type">string</span></dt>
92
- <dd>Select the log level to display the logs on console during run.</dd>
93
- <dt>killSession: <span class="property-type">Bool</span></dt>
94
- <dd>Kill open session during deploy. This would be helpful to debug the changes by not closing the current browser.</dd>
95
- </dl>
96
- </script>
1
+ <script type="text/javascript">
2
+ function setValue() {
3
+ return $('#node-input-killSession').val()
4
+ }
5
+ //https://9bbb33aa-ac83-4087-9829-a264f90452fe@chrome.browserless.io:443/webdriver
6
+ function setProvider() {
7
+ if ($('#node-input-webdriverProvider').val() === 'browserless.io') {
8
+ $('#node-input-webdriverUri').attr(
9
+ 'placeholder',
10
+ 'https://<apikey>:chrome.browserless.io:443/webdriver'
11
+ )
12
+ $('#node-input-webdriverBrowser').val('chrome')
13
+ $('#row-browser').hide()
14
+ } else if ($('#node-input-webdriverProvider').val() === 'local') {
15
+ $('#row-browser').show()
16
+ }
17
+ }
18
+
19
+ RED.nodes.registerType('new-session', {
20
+ category: 'Webdriver IO',
21
+ color: '#a6bbcf',
22
+ defaults: {
23
+ name: { value: '' },
24
+ webdriverUri: { value: '' },
25
+ webdriverProvider: { value: '' },
26
+ webdriverBrowser: { value: '' },
27
+ logLevel: { value: 'error' },
28
+ killSession: { value: setValue() }
29
+ },
30
+ inputs: 1,
31
+ outputs: 1,
32
+ icon: 'white-globe.png',
33
+ label: function() {
34
+ return this.name || 'new session'
35
+ }
36
+ })
37
+ </script>
38
+
39
+ <script type="text/x-red" data-template-name="new-session">
40
+ <div class="form-row">
41
+ <label for="node-input-webdriverProvider"><i class="fa fa-globe"></i> Webdriver Remote Provider</label>
42
+ <select type="text" id="node-input-webdriverProvider" style="width:70%;" onchange="setProvider()">
43
+ <option value="browserless.io">browserless.io</option>
44
+ <option value="local" selected>Local Webdriver</option>
45
+ </select>
46
+ </div>
47
+ <div class="form-row">
48
+ <label for="node-input-webdriverUri"><i class="fa fa-globe"></i> Webdriver Host URI</label>
49
+ <input id="node-input-webdriverUri" type="text" placeholder="https://host:port/path">
50
+ </div>
51
+ <div class="form-row" id="row-browser">
52
+ <label for="node-input-webdriverBrowser"><i class="fa fa-globe"></i> Browser</label>
53
+ <select type="text" id="node-input-webdriverBrowser" style="width:70%;">
54
+ <option value="chrome" selected>Chrome</option>
55
+ <option value="chromium">Chromium</option>
56
+ <option value="custom">Custom</option>
57
+ </select>
58
+ </div>
59
+ <div class="form-row">
60
+ <label for="node-input-logLevel"><i class="fa fa-tasks"></i> Log Level</label>
61
+ <select type="text" id="node-input-logLevel" style="width:70%;">
62
+ <option value="trace">Trace</option>
63
+ <option value="debug">Debug</option>
64
+ <option value="info">Info</option>
65
+ <option value="warn">Warn</option>
66
+ <option value="error" selected>Error</option>
67
+ <option value="silent">Silent</option>
68
+ </select>
69
+ </div>
70
+ <div class="form-row">
71
+ <label for="node-input-killSession"><i class="fa fa-tasks"></i> Kill existing session on flow deploy</label>
72
+ <input id="node-input-killSession" type="checkbox" onclick="setValue()" style="width:auto;">
73
+ </div>
74
+ <div class="form-row">
75
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
76
+ <input id="node-input-name" type="text">
77
+ </div>
78
+ </script>
79
+
80
+ <script type="text/x-red" data-help-name="new-session">
81
+ <h3>Creates new session and also sets the "wdio_browser" global variable to the new session object.</h3>
82
+ <h3>Inputs</h3>
83
+ <dl class="message-properties">
84
+ <dt>webdriverProvider: <span class="property-type">string</span></dt>
85
+ <dd>Webdriver server name.</dd>
86
+ <dt>webdriverUri: <span class="property-type">string</span></dt>
87
+ <dd>The string format should be <protocal>://<hotsname>:<port number>/<path>, user 80/8080/443 if it is service based webdriver provider.</dd>
88
+ <dd><code>msg.webdriverUri</code> can be used by leaving the webdriverUri field blank.</dd>
89
+ <dt>Browser: <span class="property-type">string</span></dt>
90
+ <dd>Chrome configs are default. We can pass custom capabilities by selecting Browser as `Custom` and pass `msg.capabilities` to the node.</dd>
91
+ <dt>logLevel: <span class="property-type">string</span></dt>
92
+ <dd>Select the log level to display the logs on console during run.</dd>
93
+ <dt>killSession: <span class="property-type">Bool</span></dt>
94
+ <dd>Kill open session during deploy. This would be helpful to debug the changes by not closing the current browser.</dd>
95
+ </dl>
96
+ </script>