Last active
March 22, 2022 16:33
-
-
Save maxhoheiser/938a4bb3c8ec846203d5c1d831530b3d to your computer and use it in GitHub Desktop.
Example function to handle puppeteer integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
encryptionPublicKeyPageElements, | |
} = require('../pages/metamask/notification-page'); | |
confirmEncryptionPublicKeyRequest: async () => { | |
const notificationPage = await puppeteer.switchToMetamaskNotification(); | |
await puppeteer.waitAndClick( | |
encryptionPublicKeyPageElements.confirmEncryptionPublicKeyButton, | |
notificationPage, | |
); | |
await puppeteer.metamaskWindow().waitForTimeout(3000); | |
return true; | |
}, | |
rejectEncryptionPublicKeyRequest: async () => { | |
const notificationPage = await puppeteer.switchToMetamaskNotification(); | |
await puppeteer.waitAndClick( | |
encryptionPublicKeyPageElements.rejectEncryptionPublicKeyButton, | |
notificationPage, | |
); | |
await puppeteer.metamaskWindow().waitForTimeout(3000); | |
return true; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment