Skip to content

Instantly share code, notes, and snippets.

@maxhoheiser
Last active March 22, 2022 16:33
Show Gist options
  • Save maxhoheiser/938a4bb3c8ec846203d5c1d831530b3d to your computer and use it in GitHub Desktop.
Save maxhoheiser/938a4bb3c8ec846203d5c1d831530b3d to your computer and use it in GitHub Desktop.
Example function to handle puppeteer integration
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