-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'); | ||
|
@@ -28,10 +27,9 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |
.withPermissionControllerConnectedToTestDapp() | ||
.build(), | ||
localNodeOptions: defaultGanacheOptionsForType2Transactions, | ||
smartContract: SMART_CONTRACTS.PIGGYBANK, | ||
title: this.test?.fullTitle(), | ||
}, | ||
async ({ driver }: TestSuiteArguments) => { | ||
async ({ driver, ganacheServer }: TestSuiteArguments) => { | ||
await unlockWallet(driver); | ||
|
||
// Create initial stuck transaction | ||
|
@@ -43,7 +41,6 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |
}); | ||
|
||
// Wait for confirmation dialog and confirm initial transaction | ||
await driver.waitUntilXWindowHandles(3); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
@@ -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(); | ||
|
@@ -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'); | ||
}, | ||
|
@@ -79,10 +78,9 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |
.withPermissionControllerConnectedToTestDapp() | ||
.build(), | ||
localNodeOptions: defaultGanacheOptionsForType2Transactions, | ||
smartContract: SMART_CONTRACTS.PIGGYBANK, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
@@ -93,11 +91,11 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |
to: DEFAULT_FIXTURE_ACCOUNT, | ||
}); | ||
|
||
await driver.waitUntilXWindowHandles(3); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
@@ -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'); | ||
}, | ||
|
There was a problem hiding this comment.
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