Skip to content

Commit

Permalink
Feature/revoke permission to all (#932)
Browse files Browse the repository at this point in the history
* Fix typo in Permission word

* Add permission revoking actions

* Add tests for permission revoking actions

* Regenerate synpress commands file
  • Loading branch information
rafal2228 authored Oct 18, 2023
1 parent 5ecfd64 commit de76346
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 92 deletions.
22 changes: 20 additions & 2 deletions commands/metamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ const metamask = {
);
return true;
},
async confirmPermisionToApproveAll() {
async confirmPermissionToApproveAll() {
const notificationPage = await playwright.switchToMetamaskNotification();
await playwright.waitAndClick(
notificationPageElements.allowToSpendButton,
Expand All @@ -1361,7 +1361,7 @@ const metamask = {
);
return true;
},
async rejectPermisionToApproveAll() {
async rejectPermissionToApproveAll() {
const notificationPage = await playwright.switchToMetamaskNotification();
await playwright.waitAndClick(
notificationPageElements.allowToSpendButton,
Expand All @@ -1374,6 +1374,24 @@ const metamask = {
);
return true;
},
async confirmRevokePermissionToAll() {
const notificationPage = await playwright.switchToMetamaskNotification();
await playwright.waitAndClick(
notificationPageElements.allowToSpendButton,
notificationPage,
{ waitForEvent: 'close' },
);
return true;
},
async rejectRevokePermissionToAll() {
const notificationPage = await playwright.switchToMetamaskNotification();
await playwright.waitAndClick(
notificationPageElements.rejectToSpendButton,
notificationPage,
{ waitForEvent: 'close' },
);
return true;
},
async allowToAddNetwork({ waitForEvent } = {}) {
const notificationPage = await playwright.switchToMetamaskNotification();
if (waitForEvent) {
Expand Down
Loading

0 comments on commit de76346

Please sign in to comment.