topological-nodered-wdio 0.4.5 → 0.4.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "topological-nodered-wdio",
3
3
  "description": "Open source WebdriverIO nodes for Node-RED",
4
- "version": "0.4.5",
4
+ "version": "0.4.7",
5
5
  "author": "topological",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -53,6 +53,7 @@
53
53
  <select type="text" id="node-input-webdriverBrowser" style="width:70%;">
54
54
  <option value="chrome" selected>Chrome</option>
55
55
  <option value="chromium">Chromium</option>
56
+ <option value="custom">Custom</option>
56
57
  </select>
57
58
  </div>
58
59
  <div class="form-row">
@@ -86,8 +87,7 @@
86
87
  <dd>The string format should be <protocal>://<hotsname>:<port number>/<path>, user 80/8080/443 if it is service based webdriver provider.</dd>
87
88
  <dd><code>msg.webdriverUri</code> can be used by leaving the webdriverUri field blank.</dd>
88
89
  <dt>Browser: <span class="property-type">string</span></dt>
89
- <dd>Current configurations are only for chrome.</dd>
90
- <dd><code>msg.webdriverBrowser</code> can be used by leaving the webdriverBrowser blank.</dd>
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
91
  <dt>logLevel: <span class="property-type">string</span></dt>
92
92
  <dd>Select the log level to display the logs on console during run.</dd>
93
93
  <dt>killSession: <span class="property-type">Bool</span></dt>
@@ -14,8 +14,8 @@ module.exports = function(RED) {
14
14
  parseUri(config.webdriverUri || msg.webdriverUri, node),
15
15
  getCapabilities(
16
16
  config.webdriverProvider,
17
- config.webdriverBrowser || msg.webdriverBrowser,
18
- config.browserlessToken
17
+ config.webdriverBrowser,
18
+ msg
19
19
  )
20
20
  )
21
21
  node.log = `Open new browser.`
@@ -72,10 +72,13 @@ const parseUri = (uri, node) => {
72
72
  return uriComponents
73
73
  }
74
74
 
75
- const getCapabilities = (vendor, browser) => {
75
+ const getCapabilities = (vendor, browser, msg) => {
76
76
  let capabilities
77
77
 
78
- if (vendor === 'browserless.io') {
78
+ if(browser == 'custom'){
79
+ capabilities = msg.capabilities
80
+ }
81
+ else if (vendor === 'browserless.io') {
79
82
  capabilities = {
80
83
  browserName: browser,
81
84
  'goog:chromeOptions': {