Power Your Software Testing with AI Agents and Cloud
The Native AI-Agentic Cloud Platform to Supercharge Quality Engineering. Test Intelligently and Ship Faster.
- TestMu AI (Formerly LambdaTest)
- /
- Use Cases
- /
- Test grocery substitution preferences through to the order
Test grocery substitution preferences through to the order
Set an out-of-stock preference on one item, place the order, and confirm the preference survived and the other item kept its default.
Published on:
Substitution preferences are the single largest source of grocery delivery complaints, and they are stored settings that have to survive a round trip through order creation. The interface confirms the choice instantly. Whether the choice reached the order is a different question.
This use case sets a preference on one of two items in the Wallmark cart, places the order, and then checks both items on the confirmation. Five steps, 184 seconds, all passed.
The flow under test
Testing a saved preference properly means checking it in two places and checking the item you did not touch as well as the one you did.
- The immediate confirmation - a badge reading "Preference saved: Same brand only" right after the dropdown selection.
- The persisted value - the same preference on the same item in the order confirmation, after the order exists.
- The untouched item - Honey Wheat Bread still holding the default, "Pick the best available match".
That third assertion is the one that catches a preference handler writing its value to every line in the cart. Without it, a test that sets one preference and checks one preference passes a bug that would reach every customer.
Note: Kane CLI drives dropdowns, radio groups and native selects from the label a shopper reads, so preference widgets do not need special handling in the test. Start on TestMu AI. Try free!
The test file
The preference is set by naming the dropdown and the item together, which is how a person would describe it. Kane CLI resolves which control that refers to on the live page.
---
mode: testing
url: https://my-testing-repo-main.vercel.app/walmart-clone-app?reset=true
max_steps: 45
tags: [walmart, e-commerce, grocery]
---
# Wallmark 4.2: Grocery substitution
Catalog objective: add groceries, set a substitution preference on one item, and place the order.
Key assertion: the substitution preference is saved on that item.
## Add two grocery items
Click "Add to cart" on "Whole Milk, 1 gal", click "Add to cart" on "Honey Wheat Bread", and verify the cart shows both items.
## Set a substitution preference
Select "Same brand only" in the "If this item is out of stock" dropdown for "Whole Milk, 1 gal" and verify a badge appears reading "Preference saved: Same brand only".
## Go to checkout and choose a slot
Click "Continue to checkout", click "Today, 6pm - 7pm", and verify the order summary shows the pickup slot "Today, 6pm - 7pm".
## Place the order
Click "Place order" and verify the confirmation shows "Order placed" with an order number starting with "W-".
## Confirm the preference survived the order
Verify the "Substitution preferences" card shows "Whole Milk, 1 gal" with "Same brand only" and "Honey Wheat Bread" with "Pick the best available match".The order number assertion checks a prefix rather than a value, since it is generated per order. Run the test with:
kane-cli testmd run tests/walmart/grocery-substitution_test.mdThe run
Five passes. The final step is the cheapest at 25 seconds because it asserts two values against a confirmation page that is already loaded.
---
test: ../grocery-substitution_test.md
status: passed
started: 2026-09-15T09:56:27.554Z
duration_s: 184
session_id: 04cca968-be2a-42ba-9d1b-1f60e6300731
---
# Wallmark 4.2: Grocery substitution - Result
## Add two grocery items ✓ passed (41.7s)
md5: a4125fee8c60e3b1a45d4896d3737b07
Click "Add to cart" on "Whole Milk, 1 gal", click "Add to cart" on "Honey Wheat Bread", and verify the cart shows both items.
## Set a substitution preference ✓ passed (40.6s)
md5: 61f8ae05f6be363e4a59908869c5ba82
Select "Same brand only" in the "If this item is out of stock" dropdown for "Whole Milk, 1 gal" and verify a badge appears reading "Preference saved: Same brand only".
## Go to checkout and choose a slot ✓ passed (40.3s)
md5: 4e34dca9fc7a5f4f2502a9318a47da1b
Click "Continue to checkout", click "Today, 6pm - 7pm", and verify the order summary shows the pickup slot "Today, 6pm - 7pm".
## Place the order ✓ passed (33s)
md5: ee8c386251a38b14f9fe4d7be5aa0f1d
Click "Place order" and verify the confirmation shows "Order placed" with an order number starting with "W-".
## Confirm the preference survived the order ✓ passed (25s)
md5: 46054da63cdfde2b6531d9378c967b9e
Verify the "Substitution preferences" card shows "Whole Milk, 1 gal" with "Same brand only" and "Honey Wheat Bread" with "Pick the best available match".| Step | Result | Duration |
|---|---|---|
| Add two grocery items | Passed | 41.7s |
| Set a substitution preference | Passed | 40.6s |
| Go to checkout and choose a slot | Passed | 40.3s |
| Place the order | Passed | 33s |
| Confirm the preference survived the order | Passed | 25s |
Reading the evidence
The outcome is a test that proves a stored setting made it through order creation intact, which is the only version of this test that is worth running. It costs three minutes and needs no fixtures beyond the app's own data.
The pattern generalises to any preference that has to survive a submit: delivery instructions, gift options, communication settings. Generating test cases is the quickest way to produce the neighbouring variants, and the three modes covers chaining several of them in one session.
Author
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.
Substitution 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




