-
Notifications
You must be signed in to change notification settings - Fork 888
adding e2e tests for basenames registration flow #2489
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
adding e2e tests for basenames registration flow #2489
Conversation
@Aushveen is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
✅ Heimdall Review Status
|
1f77c99
to
cf6083e
Compare
cf6083e
to
6e8fd7a
Compare
7c12e05
to
2715d2e
Compare
2715d2e
to
23b5df9
Compare
d0e1863
to
324f177
Compare
Review Error for timothywangdev-cb @ 2025-06-30 18:44:13 UTC |
LGTM |
if (!metamask) { | ||
throw new Error('Metamask is not defined'); | ||
} |
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.
Does every test we write need this? Is there a way we can make onchaintestkit perform this check for us?
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.
yes, this is required. Since OCTK only provides the components for the tests, it’s not possible to do it directly. Users have to create their wallet through wallet manager
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.
this should not be an issue anyways since when you import test from testFixture, it has the metamask set up there.
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] |
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.
Does this make it required to pass before we can merge?
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.
yes, that's the goal right. It is an e2e test to make sure the registry flow works as intended. If anything changes, such as the UI components, then the E2E tests should be changed accordingly.
|
||
--- | ||
|
||
## Running the tests locally |
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.
Could there also be instructions on how to run this with headless mode disabled so that you can see the test running?
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.
resolved, check lines below
apps/web/e2e/E2Ereadme.md
Outdated
Aushveen Vimalathas | ||
:no_bell: Today at 10:51 AM |
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.
Aushveen Vimalathas | |
:no_bell: Today at 10:51 AM |
apps/web/e2e/E2Ereadme.md
Outdated
Error: Timed out waiting 60000ms from config.webServer. | ||
``` | ||
|
||
Try re-running the E2E workflow a couple more times |
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.
What causes this to happen?
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 happens in the workflows, loading the web browser/ui in the workflow takes a super long time. I will double this value
// Complete registration | ||
await initiateRegistration(mainPage); | ||
await page.waitForLoadState('networkidle'); | ||
await handleTransaction(metamask); |
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.
Can we check that the balance of the test account was decremented by the expected cost?
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.
not at the moment, we could add a method though that will get the balance of the wallet in the future upgrades to onchaintestkit
The way the approve transaction works is that it only gets approved if the wallet has sufficient funds.
3871f74
to
82de660
Compare
9238fa5
to
b83c422
Compare
34d20ea
to
d0feaa3
Compare
9381e16
to
ecf4f3c
Compare
4661202
to
9b203b9
Compare
9b203b9
to
4a1fd11
Compare
if (process.env.E2E_TEST !== 'true') { | ||
logger.error('error getting proofs for baseEthHolders', error); | ||
} |
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 there a way to prevent needing to do this? It would be very easy to forget to add this check when writing future API routes.
Maybe the check can be added in the error function itself? https://github.com/base/web/blob/master/apps/web/src/utils/logger.ts#L80
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.
resolved
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This is a E2E test using the newly released npm package @coinbase/onchaintestkit
This tests the registration flow, specifically:
This is built with playwright, anvil ETH nodes, and foundry