topological-nodered-wdio 0.3.2 → 0.4.1
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 +1 -1
- package/src/alert-action.js +1 -0
- package/src/browser-action.js +1 -0
- package/src/delete-session.js +1 -0
- package/src/dropdown-action.js +1 -0
- package/src/element-action.js +1 -0
- package/src/element-check.html +7 -3
- package/src/element-check.js +21 -13
- package/src/execute-script.js +1 -0
- package/src/explicit-wait.html +6 -2
- package/src/explicit-wait.js +4 -8
- package/src/frame-action.js +1 -0
- package/src/implicit-wait-config.js +1 -0
- package/src/new-session.js +2 -0
- package/src/window-action.js +1 -0
package/package.json
CHANGED
package/src/alert-action.js
CHANGED
package/src/browser-action.js
CHANGED
package/src/delete-session.js
CHANGED
package/src/dropdown-action.js
CHANGED
package/src/element-action.js
CHANGED
package/src/element-check.html
CHANGED
|
@@ -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="
|
|
42
|
-
<option value="
|
|
43
|
-
<option value="
|
|
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">
|
package/src/element-check.js
CHANGED
|
@@ -13,31 +13,39 @@ module.exports = function (RED) {
|
|
|
13
13
|
|
|
14
14
|
let browser = await common.getBrowser(node.context())
|
|
15
15
|
|
|
16
|
-
let
|
|
16
|
+
let element = await common.getElement(
|
|
17
17
|
browser,
|
|
18
18
|
locateUsing,
|
|
19
19
|
locateValue
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
-
if (config.check === '
|
|
23
|
-
node.log = `Check the webelement is
|
|
24
|
-
msg.payload = await
|
|
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 =
|
|
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 browser.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 browser.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 browser.isSelected()
|
|
36
43
|
}
|
|
37
44
|
await common.log(node)
|
|
38
45
|
common.successStatus(node)
|
|
39
46
|
node.send(msg)
|
|
40
47
|
} catch (e) {
|
|
48
|
+
await common.log(node)
|
|
41
49
|
common.handleError(e, node, msg)
|
|
42
50
|
}
|
|
43
51
|
})
|
package/src/execute-script.js
CHANGED
package/src/explicit-wait.html
CHANGED
|
@@ -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">
|
|
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" >
|
package/src/explicit-wait.js
CHANGED
|
@@ -35,15 +35,11 @@ module.exports = function(RED) {
|
|
|
35
35
|
await element.waitUntil()
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} else {
|
|
42
|
-
await common.log(node)
|
|
43
|
-
common.successStatus(node)
|
|
44
|
-
node.send(msg)
|
|
45
|
-
}
|
|
38
|
+
await common.log(node)
|
|
39
|
+
common.successStatus(node)
|
|
40
|
+
node.send(msg)
|
|
46
41
|
} catch (e) {
|
|
42
|
+
await common.log(node)
|
|
47
43
|
common.handleError(e, node, msg)
|
|
48
44
|
}
|
|
49
45
|
})
|
package/src/frame-action.js
CHANGED
package/src/new-session.js
CHANGED
|
@@ -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()
|