Skip to content

Commit

Permalink
feat: read(selector), save(selector), renderValue(selector) actions
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Mar 3, 2024
1 parent 1f1d1eb commit a1416c5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function runAction(stagedActions, index, element) {

function runSpecialAction(actions, index, element, actionName, params) {
if (!params) return "next";

let elements
switch (actionName) {
case 'event':
console.log("Waiting Event....");
Expand All @@ -121,11 +121,20 @@ function runSpecialAction(actions, index, element, actionName, params) {
}
break;
case 'action':
let elements = queryElements({ element, selector: params, type: 'selector' });
elements = queryElements({ element, selector: params, type: 'selector' });
for (let i = 0; i < elements.length; i++) {
elements[i].click();
}
break;
case 'read':
case 'save':
case 'renderValue':
elements = queryElements({ element, selector: params, type: 'selector' });
for (let i = 0; i < elements.length; i++) {
if (elements[i][actionName])
elements[i][actionName]();
}
break;
case 'submit':
let form = closest('form');
if (form)
Expand Down

0 comments on commit a1416c5

Please sign in to comment.