-
Notifications
You must be signed in to change notification settings - Fork 0
test(e2e): split the integrated browser test into independent scenarios #118
Conversation
The real-API browser test was one 90-second journey, so an early failure hid everything after it. It is now six independent scenarios (image upload and removal, editing, rating, saving to the cookbook, privacy and deletion) plus one short end-to-end journey through the real registration and publishing UI. Scenario users are created through the auth service with a real session cookie, because UI registration is rate limited to 5 per minute per IP, and recipes through the repository. Closes #108
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.
Request changes:
The test split improves isolation, but a few regression checks from the original end-to-end test are lost or weakened:
- Image preservation (
recipe-api.spec.ts:227): The edit scenario uses a recipe without an image. Please verify that editing a recipe preserves its existing uploaded image after reload. - Rating-to-save flow (
recipe-api.spec.ts:277): Splitting rating and saving into separate scenarios removes coverage of saving a recipe immediately after changing or removing a rating. Consider keeping this interaction in the rating scenario. - Explore search (
recipe-api.spec.ts:374): The test may pass even if search doesn't work, because the newly created recipe is already visible in Explore. First search for an unrelated term and verify the recipe disappears, then search for its title and verify it appears again.
These are test coverage gaps rather than confirmed application bugs, but they're worth addressing to avoid losing regression protection.
- The edit scenario now edits a recipe that has an uploaded image and checks the same image is still shown, loaded, after reload. - The rating scenario saves to My Cookbook straight after changing the rating, and unsaves/saves straight after removing it; after reload the recipe is saved and unrated. - The journey first searches an unrelated term and waits for the empty result (so a loading state cannot pass the check), then finds the recipe by title. Verified that ignoring the search term on the server, or dropping the image on save, makes the scenarios fail.
|
Thanks, all three gaps restored in the latest commit:
I checked that the new assertions can fail by temporarily breaking the app. Saving an edit without the image fails the edit scenario. Ignoring the search term on the server fails the journey; it passed before I added the wait for the empty result, which is why that wait is there. All 6 |
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 three previously requested fixes are addressed.
One regression check from the original test is still missing: verifying that another user can save an edited recipe and see its updated title in My Cookbook. Please restore this assertion before merging.
Minor, non-blocking: Consider using expect.poll() to check naturalWidth > 0 in the image upload test. Currently, the assertion might run before the image finishes loading, causing occasional test failures even when the application works correctly.
Restores the original journey's check that another user can save an edited recipe and sees its new title in My Cookbook, in the edit scenario. The upload scenario now polls naturalWidth, as the image can be visible before it has finished loading. Refs #108
|
Thanks, both done in 95fc023:
I also merged the latest |
Changes
e2e/recipe-api.spec.ts(real PostgreSQL + API behind the built client) was one 90-second test, so a failure early in the journey hid everything after it. It is now:playwright.config.ts.Validation
--repeat-each=2(12/12, ~11 s instead of one ~20 s test); fulltest:e2eandnpm run checkpass.AI usage
Written with Claude Code (Anthropic) to address a teammate's review of the final-delivery findings. Please review the diff as you would any other contribution.
Closes #108