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 Speed Up and Cancel Transaction Tests Cancel transaction Successfully cancels a pending transaction #30435

Merged
merged 4 commits into from
Feb 19, 2025
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { createDappTransaction } from '../../../page-objects/flows/transaction';
import Confirmation from '../../../page-objects/pages/confirmations/redesign/confirmation';
import ActivityListPage from '../../../page-objects/pages/home/activity-list';
import HomePage from '../../../page-objects/pages/home/homepage';
import { SMART_CONTRACTS } from '../../../seeder/smart-contracts';
import { TestSuiteArguments } from './shared';

const { WINDOW_TITLES, withFixtures } = require('../../../helpers');
Expand All @@ -28,10 +27,9 @@ describe('Speed Up and Cancel Transaction Tests', function () {
.withPermissionControllerConnectedToTestDapp()
.build(),
localNodeOptions: defaultGanacheOptionsForType2Transactions,
smartContract: SMART_CONTRACTS.PIGGYBANK,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is not needed in this spec, as we are not interacting with any smart contract

title: this.test?.fullTitle(),
},
async ({ driver }: TestSuiteArguments) => {
async ({ driver, ganacheServer }: TestSuiteArguments) => {
await unlockWallet(driver);

// Create initial stuck transaction
Expand All @@ -43,7 +41,6 @@ describe('Speed Up and Cancel Transaction Tests', function () {
});

// Wait for confirmation dialog and confirm initial transaction
await driver.waitUntilXWindowHandles(3);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed as it's done in the below step

await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

const confirmationPage = new Confirmation(driver);
Expand All @@ -53,6 +50,7 @@ describe('Speed Up and Cancel Transaction Tests', function () {
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
await ganacheServer?.mineBlock();

const homePage = new HomePage(driver);
await homePage.goToActivityList();
Expand All @@ -63,6 +61,7 @@ describe('Speed Up and Cancel Transaction Tests', function () {
await activityListPage.click_transactionListItem();
await activityListPage.click_speedUpTransaction();
await activityListPage.click_confirmTransactionReplacement();
await ganacheServer?.mineBlock();

await activityListPage.check_waitForTransactionStatus('confirmed');
},
Expand All @@ -79,10 +78,9 @@ describe('Speed Up and Cancel Transaction Tests', function () {
.withPermissionControllerConnectedToTestDapp()
.build(),
localNodeOptions: defaultGanacheOptionsForType2Transactions,
smartContract: SMART_CONTRACTS.PIGGYBANK,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is not needed in this spec, as we are not interacting with any smart contract

title: this.test?.fullTitle(),
},
async ({ driver }: TestSuiteArguments) => {
async ({ driver, ganacheServer }: TestSuiteArguments) => {
await unlockWallet(driver);

// Create initial stuck transaction
Expand All @@ -93,11 +91,11 @@ describe('Speed Up and Cancel Transaction Tests', function () {
to: DEFAULT_FIXTURE_ACCOUNT,
});

await driver.waitUntilXWindowHandles(3);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed as it's handled in the below method

await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

const confirmationPage = new Confirmation(driver);
await confirmationPage.clickFooterConfirmButton();
await ganacheServer?.mineBlock();

await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
Expand All @@ -111,6 +109,7 @@ describe('Speed Up and Cancel Transaction Tests', function () {

await activityListPage.click_cancelTransaction();
await activityListPage.click_confirmTransactionReplacement();
await ganacheServer?.mineBlock();

await activityListPage.check_waitForTransactionStatus('cancelled');
},
Expand Down
Loading