-
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: remove unnecessary delays and wait for condition with waitForUrlContaning
#30265
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. |
waitforurlcontaning
waitForUrlContaning
waitForUrlContaning
waitForUrlContaning
Builds ready [08a9ed8]
Page Load Metrics (1750 ± 92 ms)
Bundle size diffs
|
assert.ok((await this.driver.getCurrentUrl()).includes('asset')); | ||
await this.driver.waitForUrlContaining({ | ||
url: 'asset', | ||
timeout: this.driver.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.
is this.driver.timeout
the same as the default timeout? if so, should we just remove timeout: this.driver.timeout,
from these calls?
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.
it is the same, indeed, but lint is failing if I don't add it explicitly :/
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.
ah, you need to define the type as optional in the JSDoc for the function . See the "Optional parameter" section at https://jsdoc.app/tags-type
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.
aww got it 😍 thank you so much, learning a lot from your reviews 🙏
: expectedHandleCount + 1, | ||
); | ||
assert.match(await this.driver.getCurrentUrl(), /.+cross-chain\/swaps/u); | ||
await this.driver.waitUntilXWindowHandles(expectedHandleCount); |
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.
Just curious why this is needed. seems like waitForUrlContaining
should just wait.
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.
I agree, this is not needed. I left the validation because this was explicitly validated in the original spec, but happy to remove it! We can completely remove the expectedHandleCount
in the func singature too then 🙏
Co-authored-by: David Murdoch <[email protected]>
Co-authored-by: David Murdoch <[email protected]>
.circleci/config.yml
Outdated
@@ -147,7 +146,6 @@ workflows: | |||
- prep-build-test | |||
- get-changed-files-with-git-diff | |||
- test-e2e-firefox: | |||
<<: *main_master_rc_only |
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.
just for testing ci, will be removed once finished
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.
waitForUrlContaning
waitForUrlContaning
Builds ready [b02539b]
Page Load Metrics (1764 ± 74 ms)
Bundle size diffs
|
Description
Just a small enhancement to remove some unnecessary delays in bridge specs.
This PR adds a new function in the driver
waitForUrlContaning
, which just checks for a substring, instead of the exact match with thewaitForUrl
. We can now use this and remove the hardcoded delaysRelated issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist