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 Phishing Detection Via Iframe should redirect users to the the MetaMask Phishing Detection page when an iframe domain is on the phishing blocklist #28293

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Nov 5, 2024

Description

There is a race condition in our Extension e2e tests, where we click the continue to unsafe link before the event listener has been attached. This causes the click to not take any effect and the test fail sometimes.

Here is an example of the failure: https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/103699/workflows/b2ef7c35-f54a-4ea8-bd8b-15e57585d6fe/jobs/3865722/artifacts

See how after clicking the anchor element, the redirect never happens, because the click was done before the event listener was added.

image

The fix has been done in the phishing page level, where I added a new test id once the event listener click has been added, so we can now wait for that selector id to be in the page, before clicking.

Open in GitHub Codespaces

Related issues

Fixes: #27661

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 requested a review from a team as a code owner November 5, 2024 11:52
@seaona seaona self-assigned this Nov 5, 2024
Copy link
Contributor

github-actions bot commented Nov 5, 2024

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 [0591461]
Page Load Metrics (1990 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint28323181897394189
domContentLoaded17202261195512962
load17692325199013766
domInteractive2710053199
backgroundConnect998372612
firstReactRender842171122813
getState571242211
initialActions01000
loadScripts12691730143211957
setupStore1091232010
uiStartup19372683223018288
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-qa Relating to QA work (Quality Assurance) flaky tests team-extension-platform
Projects
Status: Needs dev review
3 participants