Skip to content

Commit b3ba0fa

Browse files
committed
Make the failSilently directive work per-element
1 parent 125c9af commit b3ba0fa

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

injected/integration-test/test-pages/broker-protection/actions/click-disabled-button-failSilently.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"action": {
44
"actionType": "click",
55
"id": "1",
6-
"failSilently": true,
76
"elements": [
87
{
98
"type": "button",
10-
"selector": ".btn"
9+
"selector": ".btn",
10+
"failSilently": true
1111
}
1212
]
1313
}

injected/integration-test/test-pages/broker-protection/actions/click-nonexistent-selector-failSilently.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"action": {
44
"actionType": "click",
55
"id": "1",
6-
"failSilently": true,
76
"elements": [
87
{
98
"type": "button",
10-
"selector": ".test"
9+
"selector": ".test",
10+
"failSilently": true
1111
}
1212
]
1313
}

injected/src/features/broker-protection/actions/click.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function click(action, userData, root = document) {
5151
const elements = getElements(rootElement, element.selector);
5252

5353
if (!elements?.length) {
54-
if (action.failSilently) {
54+
if (element.failSilently) {
5555
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
5656
}
5757

@@ -67,7 +67,7 @@ export function click(action, userData, root = document) {
6767
const elem = elements[i];
6868

6969
if ('disabled' in elem) {
70-
if (elem.disabled && !action.failSilently) {
70+
if (elem.disabled && !element.failSilently) {
7171
return new ErrorResponse({ actionID: action.id, message: `could not click disabled element ${element.selector}'!` });
7272
}
7373
}

0 commit comments

Comments
 (0)