-
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
test: fix flaky snap signature test #29480
Conversation
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. |
Builds ready [180a903]
Page Load Metrics (1618 ± 53 ms)
|
…xtension into fix-flaky-snaps-test
Builds ready [065893f]
Page Load Metrics (1749 ± 77 ms)
|
…xtension into fix-flaky-snaps-test
@@ -175,8 +175,13 @@ describe('Test Snap Signature Insights', function () { | |||
// switch back to MetaMask window and switch to tx insights pane | |||
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); | |||
|
|||
await driver.waitForSelector( |
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.
Doesn't the below clickElementSafe
also wait for the selector, or does it take so long we need to wait twice as long and we can't change the timeout?
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.
The clickElementSafe waits for elementsLocated, while the selector is waiting for it to be visible both serve different purposes. When an element exists in the dom it does not necessarily mean it is visible/interactable on the page hence the extra check. Also the wait is an intelligent one, so as soon as the condition is met it moves on, so we don't really add any extra time to the test if the element is present. The timeout is just the max time it waits before failing.
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.
Sorry for the confusion, I'm aware the timeout isn't fixed, I was asking if there was a big delay in the test meaning we needed to wait twice to generate a sufficient delay.
Out of scope for this PR, but if one method is silently checking visibility, and the other just whether it exists, perhaps we could benefit from a requireVisible
property on clickElementSafe
to minimise duplication like this.
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.
Makes sense, I'll make that change in another PR.
Builds ready [73d76e5]
Page Load Metrics (1738 ± 60 ms)
|
Builds ready [21517af]
Page Load Metrics (1685 ± 45 ms)
|
Builds ready [cc6dba9]
Page Load Metrics (1883 ± 143 ms)
|
Description
Related issues
Fixes: #29380
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist