From 7f6bdf0178ea1e056cf8cdfc3fae61dd5adcf672 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 12 Apr 2023 09:21:33 -0230 Subject: [PATCH] Fix e2e test for NFT interactions (#18540) The test `should transfer a single ERC721 NFT from one account to another` has been failing intermittently. It seems to be failing due to a race condition; the first render shows "Send Token" but later renders show "Send TDC". The test only passes if it runs fast enough to read the first render of the list item component. The test has been updated to look for the text "Send TDC", which is what the component shows from the second render onward. --- test/e2e/nft/erc721-interaction.spec.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/e2e/nft/erc721-interaction.spec.js b/test/e2e/nft/erc721-interaction.spec.js index 6e9a9e959..2d7d3abe9 100644 --- a/test/e2e/nft/erc721-interaction.spec.js +++ b/test/e2e/nft/erc721-interaction.spec.js @@ -62,9 +62,7 @@ describe('ERC721 NFTs testdapp interaction', function () { ); // Verify transaction - const completedTx = await driver.findElement('.list-item__title'); - const completedTxText = await completedTx.getText(); - assert.equal(completedTxText, 'Send Token'); + await driver.findElement({ text: 'Send TDC' }); }, ); });