Hero Background

Power Your Software Testing with AI Agents and Cloud

The Native AI-Agentic Cloud Platform to Supercharge Quality Engineering. Test Intelligently and Ship Faster.

Kane CLIGrocery

Replacement preferences and a cart checked too early

The shortest failing run in the set. Step one asserted the cart panel without opening it, and Kane CLI named the misstep in 69 seconds.

Published on:

This run failed on step one and ended in 69 seconds, which makes it the cheapest failure in the whole set. The cause is a single sentence that asserts something the browser was never taken to.

Kane CLI classified it as an automation bug rather than a product defect, and said which move was missing.

The verdict Kane CLI returned

The reason line is short and it is specific:

  • What Kane CLI observed - the agent ran out of viable actions with no way to satisfy the step.
  • The verdict - the agent did not open the cart before verifying the item.
  • The classification - automation_bug, agent_misstep, at confidence 0.96.

The step says click Add on an item and verify the carts panel shows it. After the click the browser is still on the storefront. The carts panel is a separate surface, and nothing in the sentence takes the run there.

Note

Note: A failure on step one that ends in 69 seconds costs almost nothing to discover, which is the argument for running flows early rather than at the end of a suite. Try it on TestMu AI. Try free!

The flow under test

The rest of the file is well constructed, and steps two and three passed once attempted. The flow sets a specific replacement, picks a named backup item, and then reloads to prove the preference persisted.

---
mode: testing
url: https://my-testing-repo-main.vercel.app/instacart-clone-app?reset=true
max_steps: 40
tags: [instacart, grocery, replacements]
---

# Instacrate 7.2: Replacement preferences

Catalog objective: set a replacement choice on an item that often goes out of stock.
Key assertion: the preference persists in the cart item detail.

## Add a flaky item
Click "Add" on "Baby Spinach, 5 oz" and verify the carts panel shows "Baby Spinach, 5 oz".

## Choose a specific replacement
Select "Choose a specific replacement" in the "If it's out of stock" dropdown for "Baby Spinach, 5 oz" and verify a "Backup item" dropdown appears.

## Pick the backup item
Select "Spring Mix, 5 oz" as the backup and verify a badge appears reading "Saved: Choose a specific replacement -> Spring Mix, 5 oz".

## Confirm it persists after reload
Reload the page and verify the cart still shows "Saved: Choose a specific replacement -> Spring Mix, 5 oz".

The reload step is the one worth keeping. A replacement preference that lives only in the current page session is the exact defect this flow is built to catch, and only a reload can distinguish that from a saved one. Reproduce it with:

kane-cli testmd run tests/instacart/replacement-preferences_test.md

How the failure surfaced

The run ended at 69 seconds with 64.5 of those spent on the failing step, and the final reload assertion recorded as skipped.

---
test: ../replacement-preferences_test.md
status: failed
started: 2026-09-15T10:30:25.130Z
duration_s: 69
session_id: 165d3aa8-e560-4c77-936b-c54655043371
---

# Instacrate 7.2: Replacement preferences - Result

## Add a flaky item ✗ failed (64.5s)
md5: 1bc961962eb3e1152fa2422740921465
Reason: AP determined agent is stuck - no viable actions remain - bug verdict: Agent did not open the cart before verifying the item [automation_bug/agent_misstep, confidence 0.96]
Click "Add" on "Baby Spinach, 5 oz" and verify the carts panel shows "Baby Spinach, 5 oz".

## Choose a specific replacement ✓ passed ( - )
md5: 6ed2dcbcea16a7dd747f222fdeda8e58
Select "Choose a specific replacement" in the "If it's out of stock" dropdown for "Baby Spinach, 5 oz" and verify a "Backup item" dropdown appears.

## Pick the backup item ✓ passed ( - )
md5: fa5b745bb45e58a323dfc1a38656118b
Select "Spring Mix, 5 oz" as the backup and verify a badge appears reading "Saved: Choose a specific replacement -> Spring Mix, 5 oz".

## Confirm it persists after reload ⏭ skipped

A skipped persistence check is worth noticing. The preference logic was never tested on this run, so the flow returned no information about the thing it exists to verify. Treating the two passing middle steps as coverage would be the wrong read.

Next-generation test execution with TestMu AI

Fixing the test

The fix is to split the first step: click Add, then open the carts panel, then assert the item is listed. Three short steps instead of one compound sentence, each ending somewhere the next assertion can see.

This is the most common way a plain English step goes wrong, and it is easy to spot once you know the shape. The interactive mode is the fastest place to iterate on it, since the browser stays open between attempts, and generated test cases make the navigation explicit by default.

Author

...

Bhawana

Blogs: 77

  • Twitter
  • Linkedin

Bhawana is a Community Evangelist at TestMu AI with over 3 years of experience creating technically accurate, strategy-driven content in software testing. She has authored 50+ blogs on test automation, cross-browser testing, mobile testing, and real device testing. She also serves as Product Marketing Manager for Kane CLI, the command-line tool that runs browser automation from the terminal using natural-language flows in a real Chrome browser. Bhawana is certified in KaneAI, Selenium, Appium, Playwright, and Cypress, reflecting her hands-on knowledge of modern automation practices. On LinkedIn, she is followed by 6000+ QA engineers, testers, AI automation testers, and tech leaders.

Add to Google preferred sources

Summarise with AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Replacement Preference FAQs

Did you find this page helpful?

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests