-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[e2e] Using ganache requests to getBalance and getAccounts #18215
Changes from 3 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 |
---|---|---|
|
@@ -145,6 +145,8 @@ async function withFixtures(options, testSuite) { | |
driver: driverProxy ?? driver, | ||
mockServer, | ||
contractRegistry, | ||
ganacheServer, | ||
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. we pass ganacheServer to the testsuite to be able to access its methods |
||
secondaryGanacheServer, | ||
}); | ||
} catch (error) { | ||
failed = true; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ describe('MetaMask Responsive UI', function () { | |
title: this.test.title, | ||
failOnConsoleError: false, | ||
}, | ||
async ({ driver }) => { | ||
async ({ driver, ganacheServer }) => { | ||
await driver.navigate(); | ||
|
||
// Import Secret Recovery Phrase | ||
|
@@ -104,9 +104,10 @@ describe('MetaMask Responsive UI', function () { | |
await driver.press('#confirm-password', driver.Key.ENTER); | ||
|
||
// balance renders | ||
const balance = await ganacheServer.getBalance(); | ||
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. here we access the current balance of the acocunt, instead of hardcoding the balance |
||
await driver.waitForSelector({ | ||
css: '[data-testid="eth-overview__primary-currency"]', | ||
text: '1000 ETH', | ||
text: `${balance} ETH`, | ||
}); | ||
}, | ||
); | ||
|
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.
If the balance is a float number, we round it up to 4 decimals to match UI.
If it's a whole number, do nothing