Skip to content

fix: flaky anti-pattern getText + assert 3 #28062

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

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Oct 24, 2024

Description

Continuing the work of removing the e2e anti-pattern of finding the element and then asserting its text.
There are more occurrences, but this work is split in several PRs, for an easy review and a faster ci.
Once all occurrences have been fixed, we'll be able to merge @HowardBraham 's PR for adding a lint rule which prevents introducing it again.

Open in GitHub Codespaces

Related issues

Fixes: (but doesn't yet closes) #19870

Manual testing steps

  1. Check ci

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.

@seaona seaona self-assigned this Oct 24, 2024
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.

@seaona seaona added team-extension-platform Extension Platform team flaky tests area-qa Relating to QA work (Quality Assurance) labels Oct 24, 2024

await driver.waitForSelector({
tag: 'span',
text: '₱2,500,000.00',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the conversion value was not mocked before. Now it is, so the value is always the same and we can look for the complete exact text

@metamaskbot
Copy link
Collaborator

Builds ready [c66015d]
Page Load Metrics (1918 ± 80 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17082304191515876
domContentLoaded16912263188015374
load17082359191816680
domInteractive25222534120
backgroundConnect166834189
firstReactRender51205944120
getState687262713
initialActions01000
loadScripts12321718139313464
setupStore1296342512
uiStartup19082656214418790
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@seaona seaona marked this pull request as ready for review October 24, 2024 07:28
@seaona seaona requested a review from a team as a code owner October 24, 2024 07:28
Comment on lines 43 to 46
driver.waitForSelector({
css: '[data-testid="unlock-page-title"]',
text: 'Welcome back!',
});
Copy link
Contributor

Choose a reason for hiding this comment

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

missing await

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoaa nice catch 😍 !! Thank you!! fixed 🙏

@metamaskbot
Copy link
Collaborator

Builds ready [8b7e35e]
Page Load Metrics (1936 ± 80 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17622582194416981
domContentLoaded17472289187911153
load17572583193616780
domInteractive24177513416
backgroundConnect10220504723
firstReactRender522201105125
getState497252813
initialActions01000
loadScripts1284148013885426
setupStore1195342813
uiStartup195029122200236114
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

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.

LGTM ! Thanks for the refacto !

@seaona seaona added this pull request to the merge queue Oct 24, 2024
Merged via the queue into develop with commit 5983dc1 Oct 24, 2024
76 checks passed
@seaona seaona deleted the anti-pattern-get-text-3 branch October 24, 2024 13:22
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-qa Relating to QA work (Quality Assurance) flaky tests release-12.7.0 Issue or pull request that will be included in release 12.7.0 team-extension-platform Extension Platform team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants