topological-nodered-wdio 0.3.1 → 0.4.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.
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.4.0",
5
5
  "author": "topological",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -43,6 +43,7 @@ module.exports = function(RED) {
43
43
  common.successStatus(node)
44
44
  node.send(msg)
45
45
  } catch (e) {
46
+ await common.log(node)
46
47
  common.handleError(e, node, msg)
47
48
  }
48
49
  })
@@ -61,6 +61,7 @@ module.exports = function(RED) {
61
61
  common.successStatus(node)
62
62
  node.send(msg)
63
63
  } catch (e) {
64
+ await common.log(node)
64
65
  common.handleError(e, node, msg)
65
66
  }
66
67
  })
@@ -20,6 +20,7 @@ module.exports = function(RED) {
20
20
  common.successStatus(node)
21
21
  node.send(msg)
22
22
  } catch (e) {
23
+ await common.log(node)
23
24
  common.handleError(e, node, msg)
24
25
  }
25
26
  })
@@ -40,6 +40,7 @@ module.exports = function(RED) {
40
40
  common.successStatus(node)
41
41
  node.send(msg)
42
42
  } catch (e) {
43
+ await common.log(node)
43
44
  common.handleError(e, node, msg)
44
45
  }
45
46
  })
@@ -96,6 +96,7 @@ module.exports = function(RED) {
96
96
  common.successStatus(node)
97
97
  node.send(msg)
98
98
  } catch (e) {
99
+ await common.log(node)
99
100
  common.handleError(e, node, msg)
100
101
  }
101
102
  })
@@ -38,6 +38,7 @@ module.exports = function (RED) {
38
38
  common.successStatus(node)
39
39
  node.send(msg)
40
40
  } catch (e) {
41
+ await common.log(node)
41
42
  common.handleError(e, node, msg)
42
43
  }
43
44
  })
@@ -31,6 +31,7 @@ module.exports = function(RED) {
31
31
  common.successStatus(node)
32
32
  node.send(msg)
33
33
  } catch (e) {
34
+ await common.log(node)
34
35
  common.handleError(e, node, msg)
35
36
  }
36
37
  })
@@ -22,29 +22,24 @@ 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
- if (error) {
41
- common.handleError(error, node, msg)
42
- } else {
43
- await common.log(node)
44
- common.successStatus(node)
45
- node.send(msg)
46
- }
38
+ await common.log(node)
39
+ common.successStatus(node)
40
+ node.send(msg)
47
41
  } catch (e) {
42
+ await common.log(node)
48
43
  common.handleError(e, node, msg)
49
44
  }
50
45
  })
@@ -29,6 +29,7 @@ module.exports = function(RED) {
29
29
  common.successStatus(node)
30
30
  node.send(msg)
31
31
  } catch (e) {
32
+ await common.log(node)
32
33
  common.handleError(e, node, msg)
33
34
  }
34
35
  })
@@ -32,6 +32,7 @@ module.exports = function(RED) {
32
32
  common.successStatus(node)
33
33
  node.send(msg)
34
34
  } catch (e) {
35
+ await common.log(node)
35
36
  common.handleError(e, node, msg)
36
37
  }
37
38
  })
@@ -25,6 +25,7 @@ module.exports = function(RED) {
25
25
  msg.payload = b.sessionId
26
26
  node.send(msg)
27
27
  } catch (e) {
28
+ await common.log(node)
28
29
  common.handleError(e, node, msg)
29
30
  }
30
31
  })
@@ -39,6 +40,7 @@ module.exports = function(RED) {
39
40
  node.log('Disconnected webdriver session ' + sessionId)
40
41
  }
41
42
  } catch (e) {
43
+ await common.log(node)
42
44
  common.handleError(e, node, msg)
43
45
  }
44
46
  done()
@@ -34,6 +34,7 @@ module.exports = function(RED) {
34
34
  common.successStatus(node)
35
35
  node.send(msg)
36
36
  } catch (e) {
37
+ await common.log(node)
37
38
  common.handleError(e, node, msg)
38
39
  }
39
40
  })