topological-nodered-wdio 0.4.0 → 0.4.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.4.0",
4
+ "version": "0.4.2",
5
5
  "author": "topological",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -38,9 +38,13 @@
38
38
  <div class="form-row">
39
39
  <label for="node-input-check"><i class="fa fa-tasks"></i> Check</label>
40
40
  <select type="text" id="node-input-check" style="width:70%;">
41
- <option value="selected">Is Element Selected</option>
42
- <option value="enabled">Is Element Enabled</option>
43
- <option value="displayed">Is Element Displayed</option>
41
+ <option value="clickable">Is Clickable</option>
42
+ <option value="displayed">Is Displayed</option>
43
+ <option value="displayedInView">Is Displayed in Viewport</option>
44
+ <option value="enabled">Is Enabled</option>
45
+ <option value="existing">Is Existing</option>
46
+ <option value="focused">Is Focused</option>
47
+ <option value="selected">Is Selected</option>
44
48
  </select>
45
49
  </div>
46
50
  <div class="form-row">
@@ -13,26 +13,33 @@ module.exports = function (RED) {
13
13
 
14
14
  let browser = await common.getBrowser(node.context())
15
15
 
16
- let elementId = await common.getElementId(
16
+ let element = await common.getElement(
17
17
  browser,
18
18
  locateUsing,
19
19
  locateValue
20
20
  )
21
21
 
22
- if (config.check === 'selected') {
23
- node.log = `Check the webelement is selected, identified using ${locateUsing}: "${locateValue}".`
24
- msg.payload = await browser.isElementSelected(elementId)
25
- } else if (config.check === 'enabled') {
26
- node.log = `Check the webelement is enabled, identified using ${locateUsing}: "${locateValue}".`
27
- msg.payload = await browser.isElementEnabled(elementId)
22
+ if (config.check === 'clickable') {
23
+ node.log = `Check the webelement is clickable, identified using ${locateUsing}: "${locateValue}".`
24
+ msg.payload = await element.isClickable()
28
25
  } else if (config.check === 'displayed') {
29
- let element = await common.getElement(
30
- browser,
31
- locateUsing,
32
- locateValue
33
- )
34
26
  node.log = `Check the webelement is displayed, identified using ${locateUsing}: "${locateValue}".`
35
- msg.payload = await browser.isElementDisplayed(element.elementId)
27
+ msg.payload = await element.isDisplayed()
28
+ } else if (config.check === 'displayedInView') {
29
+ node.log = `Check the webelement is displayed in view port, identified using ${locateUsing}: "${locateValue}".`
30
+ msg.payload = await element.isDisplayedInViewport()
31
+ } else if (config.check === 'enabled') {
32
+ node.log = `Check the webelement is enabled, identified using ${locateUsing}: "${locateValue}".`
33
+ msg.payload = await element.isEnabled()
34
+ } else if (config.check === 'existing') {
35
+ node.log = `Check the webelement is existing, identified using ${locateUsing}: "${locateValue}".`
36
+ msg.payload = await element.isExisting()
37
+ } else if (config.check === 'focused') {
38
+ node.log = `Check the webelement is focused, identified using ${locateUsing}: "${locateValue}".`
39
+ msg.payload = await element.isFocused()
40
+ } else if (config.check === 'selected') {
41
+ node.log = `Check the webelement is selected, identified using ${locateUsing}: "${locateValue}".`
42
+ msg.payload = await element.isSelected()
36
43
  }
37
44
  await common.log(node)
38
45
  common.successStatus(node)
@@ -42,7 +42,11 @@
42
42
  <option value="id">id</option>
43
43
  <option value="name">name</option>
44
44
  <option value="className">Class Name</option>
45
- <option value="selector">Jquery Selector</option>
45
+ <option value="css selector">CSS selector</option>
46
+ <option value="link text">Link text</option>
47
+ <option value="partial link text">Partial link text</option>
48
+ <option value="tag name">Tag name</option>
49
+ <option value="xpath" selected>XPath</option>
46
50
  </select>
47
51
  </div>
48
52
  <div class="form-row">
@@ -55,7 +59,7 @@
55
59
  <option value="displayed">Wait for Displayed</option>
56
60
  <option value="enabled">Wait for Enabled</option>
57
61
  <option value="exists">Wait for Exist</option>
58
- <option value="until">Wait Until</option>
62
+ <!-- <option value="until">Wait Until</option> -->
59
63
  </select>
60
64
  </div>
61
65
  <div class="form-row" id="actionTime" >