Skip to content

fix: flaky test ENS domain resolves to a correct address#25248

Merged
seaona merged 2 commits intodevelopfrom
flaky-ens-send
Jun 13, 2024
Merged

fix: flaky test ENS domain resolves to a correct address#25248
seaona merged 2 commits intodevelopfrom
flaky-ens-send

Conversation

@seaona
Copy link
Copy Markdown
Member

@seaona seaona commented Jun 12, 2024

Description

This PR fixes the flaky test ENS domain resolves to a correct address

The error is:


[driver] Called 'clickElement' with arguments [".address-list-item"]
[driver] Called 'findElement' with arguments [{"css":".ens-input__selected-input__title","text":"test.eth"}]
Failure on testcase: 'ENS domain resolves to a correct address', for more information see the artifacts tab in CI

TimeoutError: Waiting for element to be located By(xpath, .//*[contains(concat(' ', normalize-space(./@class), ' '), ' ens-input__selected-input__title ')][(contains(string(.), 'test.eth') or contains(string(.), 'test.eth'))])`

The problem is that we are clicking the address-list-item button, and nothing happens afterwards. Then we try to find the next element but is not there.
If we look into the address-list-item button element we can see how it has nested elements inside, which will render the address and the ENS domain.
Clicking on a "container" element with other elements inside might not work as we expect, since the inside elements might not be fully updated before clicking with unknown effects (in this case, the ENS and address resolution) .

To fix this, we are doing 2 things:

  • waiting for both the ENS and the address to be fully rendered (before we were just waiting for the ENS domain to be loaded)
  • clicking on a more specific element inside the container -> we now click into the inner element for the domain ENS

See Box as the container button, and nested elements with address and ENS domain.

Screenshot from 2024-06-12 10-49-23

Open in GitHub Codespaces

Related issues

Fixes: #24652

Manual testing steps

  1. Check ci
  2. Run test multiple times locally with different builds yarn test:e2e:single test/e2e/tests/transaction/ens.spec.js --browser=chrome --leave-running --retryUntilFailure --retries=10

Screenshots/Recordings

Ci failure screenshot: notice how, after clicking the ENS address button, we don't see the asset below, this means that the click didn't have any effect.

image

Expected: after clicking the EN address button, we should see the asset below

Screenshot from 2024-06-12 10-04-33

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 added team-extension-platform Extension Platform team flaky tests labels Jun 12, 2024
@seaona seaona self-assigned this Jun 12, 2024
@github-actions
Copy link
Copy Markdown
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 changed the title fix: flaky test ENS domain resolves to a correct address/test-failure-screenshot.png fix: flaky test `ENS domain resolves to a correct address Jun 12, 2024
@seaona seaona changed the title fix: flaky test `ENS domain resolves to a correct address fix: flaky test ENS domain resolves to a correct address Jun 12, 2024
@seaona seaona marked this pull request as ready for review June 12, 2024 10:33
@seaona seaona requested a review from a team as a code owner June 12, 2024 10:33
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7f44013]
Page Load Metrics (46 ± 2 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint65918073
domContentLoaded8181021
load39584652
domInteractive8181021
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.61%. Comparing base (59a805a) to head (5268c76).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25248   +/-   ##
========================================
  Coverage    65.61%   65.61%           
========================================
  Files         1373     1373           
  Lines        54523    54523           
  Branches     14282    14282           
========================================
  Hits         35774    35774           
  Misses       18749    18749           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

danjm
danjm previously approved these changes Jun 12, 2024
vthomas13
vthomas13 previously approved these changes Jun 12, 2024
chloeYue
chloeYue previously approved these changes Jun 12, 2024
@seaona seaona dismissed stale reviews from chloeYue, vthomas13, and danjm via 5268c76 June 13, 2024 07:38
@seaona seaona requested review from chloeYue, danjm and vthomas13 June 13, 2024 08:01
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [5268c76]
Page Load Metrics (104 ± 134 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint60817153
domContentLoaded810900
load371325104280134
domInteractive810900
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@seaona seaona merged commit 0dff71e into develop Jun 13, 2024
@seaona seaona deleted the flaky-ens-send branch June 13, 2024 10:42
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

flaky tests release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

flaky test: "ENS domain resolves to a correct address"

5 participants