diff --git a/wallets/metamask/test/e2e/metamask/batchTransfer.spec.ts b/wallets/metamask/test/e2e/metamask/batchTransfer.spec.ts new file mode 100644 index 000000000..dfce35247 --- /dev/null +++ b/wallets/metamask/test/e2e/metamask/batchTransfer.spec.ts @@ -0,0 +1,23 @@ +import { testWithMetaMask } from '../testWithMetaMask' + +const test = testWithMetaMask + +const { expect } = test + +test('should confirm approval to transfer all from ERC1155', async ({ page, metamask, deployAndMintERC1155 }) => { + await deployAndMintERC1155() + + await page.locator('#setApprovalForAllERC1155Button').click() + await metamask.confirmTransaction() + + await expect(page.locator('#erc1155Status')).toHaveText('Set Approval For All completed') +}) + +test('should perform batch ERC115 transfer', async ({ page, metamask, deployAndMintERC1155 }) => { + await deployAndMintERC1155() + + await page.locator('#batchTransferFromButton').click() + await metamask.confirmTransaction() + + await expect(page.locator('#erc1155Status')).toHaveText('Batch Transfer From completed') +}) diff --git a/wallets/metamask/test/e2e/testWithMetaMask.ts b/wallets/metamask/test/e2e/testWithMetaMask.ts index 9db25a89b..c81c3808f 100644 --- a/wallets/metamask/test/e2e/testWithMetaMask.ts +++ b/wallets/metamask/test/e2e/testWithMetaMask.ts @@ -8,6 +8,7 @@ export const testWithMetaMask = testWithSynpress(connectedSetup, unlockForFixtur metamask: MetaMask connectToAnvil: () => Promise deployToken: () => Promise + deployAndMintERC1155: () => Promise }>({ metamask: async ({ context, metamaskPage, extensionId }, use) => { const metamask = new MetaMask(context, metamaskPage, connectedSetup.walletPassword, extensionId) @@ -43,5 +44,18 @@ export const testWithMetaMask = testWithSynpress(connectedSetup, unlockForFixtur await metamask.confirmTransaction() }) + }, + deployAndMintERC1155: async ({ page, metamask, connectToAnvil }, use) => { + await use(async () => { + await connectToAnvil() + + await page.locator('#deployERC1155Button').click() + await metamask.confirmTransaction() + + await page.locator('#batchMintButton').click() + await metamask.confirmTransactionAndWaitForMining() + + await expect(page.locator('#erc1155Status')).toHaveText('Batch Minting completed') + }) } })