Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Completing missing step for import ERC1155 token origin dapp in existing E2E test #27680

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion test/e2e/tests/tokens/nft/erc1155-interaction.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { strict: assert } = require('assert');
const { mockNetworkStateOld } = require('../../../../stub/networks');
const {
withFixtures,
DAPP_URL,
Expand All @@ -19,6 +20,15 @@ describe('ERC1155 NFTs testdapp interaction', function () {
dapp: true,
fixtures: new FixtureBuilder()
.withPermissionControllerConnectedToTestDapp()
.withNetworkController(
mockNetworkStateOld({
chainId: '0x539',
nickname: 'Localhost 8545',
rpcUrl: 'http://localhost:8545',
ticker: 'ETH',
blockExplorerUrl: 'https://etherscan.io/',
}),
)
.build(),
ganacheOptions: defaultGanacheOptions,
smartContract,
Expand All @@ -38,7 +48,7 @@ describe('ERC1155 NFTs testdapp interaction', function () {
await driver.clickElement('#batchMintButton');

// Notification
const windowHandles = await driver.waitUntilXWindowHandles(3);
let windowHandles = await driver.waitUntilXWindowHandles(3);
const [extension] = windowHandles;
await driver.switchToWindowWithTitle(
WINDOW_TITLES.Dialog,
Expand All @@ -65,6 +75,45 @@ describe('ERC1155 NFTs testdapp interaction', function () {
true,
`transaction item should be displayed in activity tab`,
);
await driver.clickElement('[data-testid="activity-list-item-action"]');
await driver.clickElement({
text: 'View on block explorer',
tag: 'a',
});
// Switch to block explorer
await driver.waitUntilXWindowHandles(3);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle('E2E Test Page', windowHandles);
await driver.findElement('[data-testid="empty-page-body"]');
// Verify block explorer
await driver.waitForUrl({
url: 'https://etherscan.io/tx/0xfe4428397f7913875783c5c0dad182937b596148295bc33c7f08d74fdee8897f',
});
// switch to Dapp
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
WINDOW_TITLES.TestDApp,
windowHandles,
);
await driver.fill('#watchAssetInput', '1');
await driver.clickElement('#watchAssetButton');
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
WINDOW_TITLES.Dialog,
windowHandles,
);
await driver.clickElement('[data-testid="page-container-footer-next"]');
await driver.waitUntilXWindowHandles(3);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
windowHandles,
);
await driver.findClickableElement(
'[data-testid="account-overview__nfts-tab"]',
);
await driver.clickElement('[data-testid="account-overview__nfts-tab"]');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is flaking here.

await driver.clickElement('[data-testid="nft-item"]');
},
);
});
Expand Down