topological-nodered-wdio 0.3.1 → 0.3.2

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.3.1",
4
+ "version": "0.3.2",
5
5
  "author": "topological",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -22,22 +22,21 @@ module.exports = function(RED) {
22
22
  let reverse = config.reverse === 'true' || msg.reverse
23
23
  let error = config.error || msg.error
24
24
 
25
- let boolReverse = reverse === 'false' ? false : true
26
-
27
25
  if (config.action === 'displayed') {
28
26
  node.log = `Waiting for the element to be displayed for ${time}, identified using ${locateUsing}: "${locateValue}".`
29
- await element.waitForDisplayed(time, boolReverse, error, 2000)
27
+ await element.waitForDisplayed({timeout: time, reverse: reverse, timeoutMsg: error, interval : 2000})
30
28
  } else if (config.action === 'enabled') {
31
29
  node.log = `Waiting for the element to be enabled for ${time}, identified using ${locateUsing}: "${locateValue}".`
32
- await element.waitForEnabled(time, boolReverse, error, 2000)
30
+ await element.waitForEnabled({timeout: time, reverse: reverse, timeoutMsg: error, interval : 2000})
33
31
  } else if (config.action === 'exists') {
34
32
  node.log = `Waiting for the element to be exists for ${time}, identified using ${locateUsing}: "${locateValue}".`
35
- await element.waitForExist(time, boolReverse, error, 2000)
33
+ await element.waitForExist({timeout: time, reverse: reverse, timeoutMsg: error, interval : 2000})
36
34
  } else if (config.action === 'until') {
37
35
  await element.waitUntil()
38
36
  }
39
37
 
40
38
  if (error) {
39
+ await common.log(node)
41
40
  common.handleError(error, node, msg)
42
41
  } else {
43
42
  await common.log(node)