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: Allow token balance to populate after swap #28744

Merged
merged 9 commits into from
Dec 2, 2024
Merged

Conversation

davibroc
Copy link
Contributor

@davibroc davibroc commented Nov 26, 2024

Description

After importing the test account which contains the funds to execute the swaps it takes a few seconds before the balance would show up in the wallet. So I added steps to the script to pause and wait for that balance to show up before executing the tests.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

Builds ready [5d3cfd0]
Page Load Metrics (1652 ± 42 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1497182816568440
domContentLoaded1478180916258842
load1483182616528642
domInteractive237036147
backgroundConnect9117262512
firstReactRender1670332210
getState45114157
initialActions01000
loadScripts1068133211947938
setupStore65716199
uiStartup1645201918399646
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [04fca2d]
Page Load Metrics (1726 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15762023172712661
domContentLoaded15142002169412560
load15752022172612761
domInteractive247538168
backgroundConnect1180342210
firstReactRender1670332210
getState56017199
initialActions040294
loadScripts11131526125410651
setupStore610711
uiStartup17432228191914569
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@davibroc davibroc force-pushed the test/fix-zero-balance branch from 04fca2d to 6eda1a5 Compare November 27, 2024 00:52
@metamaskbot
Copy link
Collaborator

Builds ready [6eda1a5]
Page Load Metrics (1942 ± 123 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint38924211764501241
domContentLoaded159023831910254122
load159923981942255123
domInteractive2484452010
backgroundConnect679352311
firstReactRender1677402311
getState45418147
initialActions01000
loadScripts116818151433215103
setupStore65915157
uiStartup175726852172289139
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@davibroc davibroc force-pushed the test/fix-zero-balance branch from 9734c2d to 6ed9fd5 Compare November 29, 2024 17:51
@metamaskbot
Copy link
Collaborator

Builds ready [6ed9fd5]
Page Load Metrics (1947 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint41222161870353170
domContentLoaded16842197191211153
load17502216194710651
domInteractive23197443718
backgroundConnect1075362412
firstReactRender175624105
getState5611693199
initialActions01000
loadScripts12581701147110149
setupStore714921
uiStartup19862440222011857
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [cfa41a1]
Page Load Metrics (1776 ± 74 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15992283177815374
domContentLoaded15912236175314670
load15962301177615574
domInteractive248933168
backgroundConnect76122178
firstReactRender15481984
getState4411489209
initialActions01000
loadScripts12081578133110349
setupStore616831
uiStartup180128992026247119
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@@ -82,6 +84,8 @@ testSet.forEach((options) => {
await walletPage.selectTokenWallet();
await networkController.selectNetwork(options.network);
await walletPage.selectSwapAction();
// Allow balance label to populate
await walletPage.page.waitForTimeout(3000);
Copy link
Contributor

@chloeYue chloeYue Dec 2, 2024

Choose a reason for hiding this comment

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

Do we have a dynamic way to wait for the balance label to populate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately not in this case like I did above. If I click and open the control and wait to populate it will never populate it will always stay zero.

Copy link
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

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

Added a small nit, not blocking.

@@ -54,6 +59,8 @@ export class WalletPage {
await this.importAccountButton.click();
await this.page.fill('#private-key-box', accountPK);
await this.importAccountConfirmBtn.click();
await this.page.waitForTimeout(2000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this mandatory? is not possible to change it for a locator?

@davibroc davibroc added this pull request to the merge queue Dec 2, 2024
Merged via the queue into main with commit c5df9dc Dec 2, 2024
78 checks passed
@davibroc davibroc deleted the test/fix-zero-balance branch December 2, 2024 19:21
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2024
@metamaskbot metamaskbot added the release-12.10.0 Issue or pull request that will be included in release 12.10.0 label Dec 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed release-12.10.0 Issue or pull request that will be included in release 12.10.0 team-swaps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants