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

fix: flaky test Queued Confirmations Queued Requests Banner Alert Banner is shown on dApp 1, but not on dApp 2 after adding transaction on dApp 1, and one on dApp 2 (old confirmation flow) #30028

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ workflows:
requires:
- prep-deps
- test-e2e-chrome-webpack:
<<: *main_master_rc_only
requires:
- prep-build-test-webpack
- get-changed-files-with-git-diff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ async function connectToDappTwoAndSwitchBackToOne(
await driver.waitUntilXWindowHandles(4);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

await driver.clickElement({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

race condition here, we need to wait for the dialog to close, before proceeding to the dapp 1 window

await driver.clickElementAndWaitForWindowToClose({
text: 'Connect',
tag: 'button',
});
Expand All @@ -417,8 +417,11 @@ async function switchChainToDappOne(driver: Driver) {
`window.ethereum.request(${switchEthereumChainRequest})`,
);

await driver.waitUntilXWindowHandles(4);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);
Comment on lines -420 to -421
Copy link
Contributor Author

@seaona seaona Jan 31, 2025

Choose a reason for hiding this comment

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

incorrect expectations, as the dialog should never open in this case, as that network already has permissions. We should just expect that the network has been switched.
The incorrect expectations together with the above race condition, made that this test passes sometimes, because we wait for 4 windows, and this is the case if the dialog from the step before is not closed fast enough (is possible because we didn't wait for the dialog to close in the first place), but that dialog instance doesn't exist anymore in the next steps

// No dialog should appear as we already gave permissions to this network
await driver.waitForSelector({
css: '[id="chainId"]',
text: '0x539',
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we just wait for the test dapp to have switched to the new network

}

async function switchToDAppAndCreateTransactionRequest(driver: Driver) {
Expand Down
Loading