From e50d94104cd805562a462af9d633373a246a7b32 Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:55:49 +0200 Subject: [PATCH] Bump test-dapp to v7.1.0 (#20665) * Bump test-dapp to v7.1.0 * Update erc721 tests with new dapp layout --------- Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- package.json | 2 +- test/e2e/nft/erc721-interaction.spec.js | 24 ++++++++++++++++++------ yarn.lock | 10 +++++----- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index fe680f976..be512b7e2 100644 --- a/package.json +++ b/package.json @@ -387,7 +387,7 @@ "@metamask/eslint-config-typescript": "^9.0.1", "@metamask/forwarder": "^1.1.0", "@metamask/phishing-warning": "^2.1.0", - "@metamask/test-dapp": "^7.0.1", + "@metamask/test-dapp": "^7.1.0", "@sentry/cli": "^2.19.4", "@storybook/addon-a11y": "^7.0.11", "@storybook/addon-actions": "^7.0.11", diff --git a/test/e2e/nft/erc721-interaction.spec.js b/test/e2e/nft/erc721-interaction.spec.js index e979a8530..bbfd544e7 100644 --- a/test/e2e/nft/erc721-interaction.spec.js +++ b/test/e2e/nft/erc721-interaction.spec.js @@ -72,9 +72,12 @@ describe('ERC721 NFTs testdapp interaction', function () { assert.equal(await nftsMintStatus.isDisplayed(), true); // watch 3 of the nfts - await driver.clickElement({ text: 'Watch NFT 1', tag: 'button' }); - await driver.clickElement({ text: 'Watch NFT 2', tag: 'button' }); - await driver.clickElement({ text: 'Watch NFT 3', tag: 'button' }); + await driver.fill('#watchNFTInput', '1'); + await driver.clickElement({ text: 'Watch NFT', tag: 'button' }); + await driver.fill('#watchNFTInput', '2'); + await driver.clickElement({ text: 'Watch NFT', tag: 'button' }); + await driver.fill('#watchNFTInput', '3'); + await driver.clickElement({ text: 'Watch NFT', tag: 'button' }); await driver.waitUntilXWindowHandles(3); windowHandles = await driver.getAllWindowHandles(); @@ -83,6 +86,12 @@ describe('ERC721 NFTs testdapp interaction', function () { windowHandles, ); + // avoid race condition + await driver.waitForSelector({ + css: '.confirm-add-suggested-nft__nft-tokenId', + text: '#3', + }); + // confirm watchNFT await driver.waitForSelector({ css: '.mm-text--heading-lg', @@ -98,9 +107,12 @@ describe('ERC721 NFTs testdapp interaction', function () { assert.equal(nftsListItemsFirstCheck.length, 3); await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles); - await driver.clickElement({ text: 'Watch NFT 4', tag: 'button' }); - await driver.clickElement({ text: 'Watch NFT 5', tag: 'button' }); - await driver.clickElement({ text: 'Watch NFT 6', tag: 'button' }); + await driver.fill('#watchNFTInput', '4'); + await driver.clickElement({ text: 'Watch NFT', tag: 'button' }); + await driver.fill('#watchNFTInput', '5'); + await driver.clickElement({ text: 'Watch NFT', tag: 'button' }); + await driver.fill('#watchNFTInput', '6'); + await driver.clickElement({ text: 'Watch NFT', tag: 'button' }); await driver.waitUntilXWindowHandles(3); windowHandles = await driver.getAllWindowHandles(); diff --git a/yarn.lock b/yarn.lock index c78faf8fd..2b5a69611 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5099,10 +5099,10 @@ __metadata: languageName: node linkType: hard -"@metamask/test-dapp@npm:^7.0.1": - version: 7.0.1 - resolution: "@metamask/test-dapp@npm:7.0.1" - checksum: 5597b9695406a15e2a1976a5ac77a5674eda1f3be97dface0e95ed23ce877a09acac4487199f780892f63470ed09f2e2d14946ebf341afbc02214057a51427ab +"@metamask/test-dapp@npm:^7.1.0": + version: 7.1.0 + resolution: "@metamask/test-dapp@npm:7.1.0" + checksum: 94a01886a4254dafdf719086da6ded59fb1fef701d32d9c32673251fd0d664b133dd0c73664184f2b9c566caedcc9550d845cdfe7976cef993b6549c1d3b8881 languageName: node linkType: hard @@ -24249,7 +24249,7 @@ __metadata: "@metamask/snaps-utils": "npm:^1.0.2" "@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.38.0-flask.1" "@metamask/subject-metadata-controller": "npm:^2.0.0" - "@metamask/test-dapp": "npm:^7.0.1" + "@metamask/test-dapp": "npm:^7.1.0" "@metamask/utils": "npm:^5.0.0" "@ngraveio/bc-ur": "npm:^1.1.6" "@popperjs/core": "npm:^2.4.0"