Skip to content

Commit

Permalink
update e2e test script about nft evm transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhixin Zhou committed Mar 6, 2025
1 parent c76e66b commit 1c986fc
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion e2e/sendTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,50 @@ export const moveTokenCoaHomepage = async ({ page, tokenname, amount = '0.000000
// Wait for the transaction to be completed
await waitForTransaction({ page, successtext: 'success', amount });
};

export const sendNftCOA = async ({ page, nftname, receiver, successtext }) => {
// Wait for the EVM account to be loaded
await getCurrentAddress(page);
await page.getByRole('tab', { name: 'NFTs' }).click();
await page.getByRole('button', { name: nftname }).click();
await page.getByRole('link').nth(0).click();
await page.getByRole('button', { name: 'Send' }).click();
await page.getByPlaceholder('Search, Address(0x) or Flow').click();
await page.getByPlaceholder('Search, Address(0x) or Flow').fill(receiver);
await page.getByRole('button', { name: 'Send' }).click();
// // Wait for the transaction to be completed
await waitForTransaction({ page, successtext });
};
export const moveNftCOA = async ({ page, nftname, receiver, successtext }) => {
// Wait for the EVM account to be loaded
await getCurrentAddress(page);
await page.getByRole('tab', { name: 'NFTs' }).click();
await page.getByRole('button', { name: nftname }).click();
await page.getByRole('link').nth(0).click();
await page.getByRole('button', { name: 'Move' }).click();
await page.getByRole('combobox').click();
await page.getByRole('option', { name: receiver }).click();
await page.getByRole('button', { name: 'Move' }).click();
// // Wait for the transaction to be completed
await waitForTransaction({ page, successtext });
};
export const batchmoveNftCOA = async ({ page, nftname, receiver, successtext }) => {
// Wait for the EVM account to be loaded
await getCurrentAddress(page);
await page
.locator('div')
.filter({ hasText: /^Move$/ })
.getByRole('button')
.click();
await page.getByRole('button', { name: 'Move NFTs' }).click();
await page.getByRole('combobox').click();
await page.getByRole('option', { name: receiver }).click();
await page.getByRole('button').nth(1).click();
await page.getByRole('button', { name: 'TopShot' }).click();
await page.getByRole('button', { name: '#' }).nth(0).click();
await page.getByRole('button', { name: 'Move' }).click();
// Wait for the transaction to be completed
await waitForTransaction({ page, successtext });
};
test.beforeEach(async ({ page, extensionId }) => {
// Login to our sender account
await loginToSenderAccount({ page, extensionId });
Expand Down Expand Up @@ -172,6 +215,47 @@ test('move USDC token COA to FLOW homepage', async ({ page }) => {
});
}); */
//Send NFT from COA to COA
test('send top shot COA to COA', async ({ page }) => {
await sendNftCOA({
page,
nftname: 'NBA Top Shot',
receiver: process.env.TEST_RECEIVER_EVM_ADDR!,
successtext: 'success',
});
});
//Send NFT from COA to FLOW
test('send top shot COA to FLOW', async ({ page }) => {
await sendNftCOA({
page,
nftname: 'NBA Top Shot',
receiver: process.env.TEST_RECEIVER_ADDR!,
successtext: 'success',
});
});
//Send NFT from COA to EOA
test('send top shot COA to EOA', async ({ page }) => {
await sendNftCOA({
page,
nftname: 'NBA Top Shot',
receiver: process.env.TEST_RECEIVER_METAMASK_EVM_ADDR!,
successtext: 'success',
});
});
//Move NFT from COA to FLOW
test('Move top shot COA to FLOW', async ({ page }) => {
await moveNftCOA({
page,
nftname: 'NBA Top Shot',
receiver: process.env.TEST_SENDER_ADDR!,
successtext: 'success',
});
});
//Batch move NFT from COA to FLOW
test('Batch Move top shot COA to FLOW', async ({ page }) => {
await batchmoveNftCOA({
page,
nftname: 'TopShot',
receiver: process.env.TEST_SENDER_ADDR!,
successtext: 'success',
});
});

0 comments on commit 1c986fc

Please sign in to comment.