Fix assertion to match actual cart page content#779
Open
mendral-app[bot] wants to merge 2 commits intomainfrom
Open
Fix assertion to match actual cart page content#779mendral-app[bot] wants to merge 2 commits intomainfrom
mendral-app[bot] wants to merge 2 commits intomainfrom
Conversation
The test_agent_fallback test asserted 'added to cart' in page content, but after the agent completes, session.observe() captures the cart page (/cart) which shows the product name and quantity — not an 'added to cart' toast. Replace with assertion for 'the cap' which verifies the correct item was added to cart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_agent_fallbackby replacing the'added to cart'string check with'the cap', which actually appears on the cart page wheresession.observe()captures content after the agent completes.Context
Insight: test_agent_fallback: assertion checks for 'added to cart' but page lands on cart view
The test was asserting
"added to cart" in page_content, but after the fallback agent finishes,session.observe()captures the cart page (/cart), not the product page. The cart page shows'1 item in your cart for $35.00'and'the cap'— but never the string'added to cart'.The underlying action (adding the cap to cart) succeeds every time — only the assertion was wrong.
Changes
tests/integration/sdk/test_agent_fallback.py:46-51: Replaceassert "added to cart" in page_contentwithassert "the cap" in page_content, which verifies the correct item was added to cart by checking for the product name on the cart page.Failure evidence
5 occurrences across runs 24213104872, 24482491956, 24804410046 and others — all showing the same pattern: cart page content contains
'the cap'and'$35.00'but not'added to cart'.Note
Created by Mendral. Tag @mendral-app with feedback or questions.
Greptile Summary
Fixes a false-negative in
test_agent_fallbackby correcting the post-action assertion to check for'the cap'instead of'added to cart'. After the fallback agent finishes,session.observe()captures the cart page (/cart), which displays the product name but not the literal string'added to cart', causing the test to fail despite the underlying action succeeding.Confidence Score: 5/5
Safe to merge — single-line test assertion fix with clear evidence backing the change.
The only change is replacing a wrong assertion string with one that actually appears on the observed page. The PR description provides solid failure evidence from multiple CI runs, the
.lower()normalization is already in place, and no production code is touched.No files require special attention.
Important Files Changed
Reviews (2): Last reviewed commit: "style: apply ruff format to assertion" | Re-trigger Greptile