Skip to content

Commit 3600a6b

Browse files
committed
fix: add flag status to trigger next action
1 parent a1416c5 commit 3600a6b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,19 @@ function runAction(stagedActions, index, element) {
102102

103103
function runSpecialAction(actions, index, element, actionName, params) {
104104
if (!params) return "next";
105-
let elements
105+
let elements, status = "next"
106106
switch (actionName) {
107107
case 'event':
108108
console.log("Waiting Event....");
109+
status = ""
109110
document.addEventListener(params, () => {
110111
console.log('Event Action (Received event from other section) ====== ' + params);
111112
runNextAction(actions, index, element);
112113
}, { once: true })
113114
break;
114115
case 'timeout':
116+
status = ""
117+
115118
let delayTime = parseInt(params);
116119
if (delayTime > 0) {
117120
setTimeout(function () {
@@ -141,8 +144,14 @@ function runSpecialAction(actions, index, element, actionName, params) {
141144
form.click();
142145
break;
143146
default:
144-
return "next";
147+
elements = queryElements({ element, selector: params, type: 'selector' });
148+
for (let i = 0; i < elements.length; i++) {
149+
if (elements[i][actionName])
150+
elements[i][actionName]();
151+
}
145152
}
153+
154+
return status
146155
}
147156

148157
function runNextAction(actions, index, element) {

0 commit comments

Comments
 (0)