Add e2e test for invalid PSBT upload#462
Add e2e test for invalid PSBT upload#462harrshita123 wants to merge 3 commits intocaravan-bitcoin:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Legend101Zz
left a comment
There was a problem hiding this comment.
Just a nit , rest looks good to me thanks for the PR , can you also please attach a screen shot showing the playwright running the test , would be really helpful thanks
.changeset/invalid-psbt-e2e-test.md
Outdated
| @@ -0,0 +1,8 @@ | |||
| --- | |||
| "caravan-coordinator": none | |||
There was a problem hiding this comment.
actually we don't need a changeset for this , changeset it for packages and coordinator version , we don't it for e2e test suite ... @bucko13 please correct me if I am wrong here :)
There was a problem hiding this comment.
actually we don't need a changeset for this , changeset it for packages and coordinator version , we don't it for e2e test suite ... @bucko13 please correct me if I am wrong here :)
Thanks for the review and the helpful suggestion!
You are absolutely right . since this change only adds an end-to-end test and does not modify any package code or affect the coordinator version, a changeset isn’t required. I have removed the changeset file accordingly.
I have also attached a screenshot of the Playwright test suite running locally (npm run test:e2e) showing all tests passing, including the newly added invalid PSBT test.
please let me know if there is anything else I should improve!
There was a problem hiding this comment.
actually we don't need a changeset for this , changeset it for packages and coordinator version , we don't it for e2e test suite ... @bucko13 please correct me if I am wrong here :)
Thanks for the review and the helpful suggestion!
You are absolutely right . since this change only adds an end-to-end test and does not modify any package code or affect the coordinator version, a changeset isn’t required. I have removed the changeset file accordingly.
I have also attached a screenshot of the Playwright test suite running locally (npm run test:e2e) showing all tests passing, including the newly added invalid PSBT test.
please let me know if there is anything else I should improve!
There was a problem hiding this comment.
Thanks @harrshita123 everything looks good to me :)
|
With #487 we need to update to the new e2e system. will require resolving some merge conflicts. |
|
Hi @harrshita123 Thanks for your patience. As Buck suggested above due to the E2E changes the testsiote was updated , Could you please pull in the latest changes and review the updated E2E setup we’ve implemented, then adjust your changes accordingly? |
I will sync with the latest main, rebase this PR, and update my changes to align with the new E2E setup from #487. I will take care of the merge conflicts and push an update soon. |
9064ec8 to
fd1770c
Compare
|
Should i have to add changesets ? |
Legend101Zz
left a comment
There was a problem hiding this comment.
@harrshita123 thanks for the PR , I had a comment on moving all the assertion logic to pages , you can read more in the contribution.md to understand how the new e2e architecture works :)
|
|
||
| await sendTab.importPsbtFile(invalidPsbtPath); | ||
|
|
||
| await expect(page.getByRole("alert")).toBeVisible({ timeout: 10000 }); |
There was a problem hiding this comment.
The assertions at the end are leaking raw Playwright locators into the test body — this should go through the page object instead. sendTab is right there; something like sendTab.expectImportError() (or whatever makes sense on the POM) would keep the test readable and keep selector details out of spec files.
So can you plaese move the page.getByRole("alert") and sign-button assertions behind a POM method on sendTab.
As if we don't follow the POM model we can again go back to having flaky tests :)


Test / Quality improvement (E2E test)
Fixes #442
This PR adds an end-to-end test to validate Caravan’s behavior when an invalid PSBT file is uploaded.
The test ensures that:
This improves test coverage and prevents regressions related to PSBT validation.
I have tested my changes thoroughly.
I have added tests to cover my changes.
I have run the test suite locally, and all tests pass.
I have written tests for all new changes/features.
I have followed the project's coding style and conventions.
Added E2E test in:
apps/coordinator/e2e/tests/03-transaction_flow.spec.tsVerified locally using
npm run test:e2eHave you read the contributing guide?
Yes