Skip to content
testmode

Test case examples

Complete Testmode test cases for common flows, each one run for real on a public practice shop: search, filters, product pages, cart, a signed-in page, login errors, form validation, a contact form and a full checkout.

Every example on this page is a test case from the documentation’s demo project, run against the Toolshop, the public practice shop at https://practicesoftwaretesting.com. Each one ran and passed as shown, except the last, which fails for a real reason. Copy them as a starting point, then swap in your own labels.

The variables they use are project variables: {{Search Term}} is hammer, {{Contact Subject}} is Warranty, {{Unknown Email}} is an address the shop doesn’t know, and {{Short Message}} and {{Support Message}} are a too-short and a long enough message. See Variables.

Search finds hammers (Start Path /, tags search, smoke)
1. Type {{Search Term}} into the "Search" field and click "Search".
2. Wait until the heading "Searched for:" appears above the products.
Expected Outcome: Every product card shown has "hammer" in its name, in any letter case, "Thor Hammer" is one of them, and "There are no products found." is not shown.

Why it works: the wait names the heading that appears with the results, and the outcome says what must and must not be on the page. PASSED

Filter catalogue by the Hammer category (Start Path /, tags catalogue, filters, smoke)
1. In the filters under "By category:", tick "Hammer".
2. Wait until "Claw Hammer" is listed.
Expected Outcome: Only hammers are listed, for example "Claw Hammer" and "Thor Hammer", and no pliers, screwdrivers or wrenches appear.

Why it works: the wait names a product that only appears once the filter has applied. An earlier version waited until “the product list updates”, which names nothing on the page, and timed out. See Troubleshoot failed tests. PASSED

Product page shows price and Add to cart (Start Path /, tags catalogue, smoke)
1. Type "Combination Pliers" into the "Search" field and click "Search".
2. Open the product "Combination Pliers".
Expected Outcome: The product page shows the name "Combination Pliers", a price in dollars, a quantity field and an "Add to cart" button.

Why it works: the test reaches the product by searching for its name, so it doesn’t depend on a product id in the URL. PASSED

Add a product to the cart (Start Path /, tags cart, smoke)
1. Type "Slip Joint Pliers" into the "Search" field and click "Search".
2. Open the product "Slip Joint Pliers".
3. Click "Add to cart".
4. Open the cart from the cart icon in the navigation menu.
Expected Outcome: The message "Product added to shopping cart." appears after adding, and the cart lists "Slip Joint Pliers".
PASSED
Sign-in lands on My account (Start Path /account, credential Jane Doe – demo customer, tags account, smoke)
1. Look at the page heading and the navigation menu. Do not click "Sign out".
Expected Outcome: The page heading reads "My account", and the navigation menu shows the customer's name instead of "Sign in".

Why it works: the credential signs in before step 1, so there are no login steps, and the test starts on the page it checks. “Do not click” is context, not an action. See Credentials and automatic login. PASSED

Login rejects an unknown email (Start Path /auth/login, no credential, tags account, negative)
1. Type {{Unknown Email}} into "Email address".
2. Type "not-a-real-password" into "Password" and click "Login".
Expected Outcome: The error "Invalid email or password" is shown and the "Login" form is still displayed.

Why it works: it uses an address the site doesn’t know, so no real account is ever locked by wrong passwords, and no credential, because the test is about the login form itself. PASSED

Contact form requires a 50-character message (Start Path /contact, tags contact, validation)
1. Fill "First name" with "Maren", "Last name" with "Veld" and "Email address" with "maren.veld@example.com".
2. In "Subject", choose {{Contact Subject}}.
3. Type {{Short Message}} into "Message" and click "Send".
Expected Outcome: The form shows "Message must be minimal 50 characters" and the text "Thanks for your message! We will contact you shortly." does not appear.

Why it works: it checks the exact error message and that the success message does not appear. PASSED

Contact form sends a support message (Start Path /contact, tags contact)
1. Fill "First name" with "Maren", "Last name" with "Veld" and "Email address" with "maren.veld@example.com".
2. In "Subject", choose {{Contact Subject}}.
3. Type {{Support Message}} into "Message" and click "Send".
Expected Outcome: The page shows "Thanks for your message! We will contact you shortly."

This sends a real message to the site. Run tests like it only on environments meant for testing. PASSED

Checkout with cash on delivery (Start Path /, credential Jane Doe – demo customer, tags checkout)
1. Type "Combination Pliers" into the "Search" field and click "Search".
2. Open the product "Combination Pliers", click "Add to cart" and wait for "Product added to shopping cart.".
3. Open the cart from the cart icon in the navigation menu and click "Proceed to checkout".
4. On the "Sign in" step, where you are already logged in, click "Proceed to checkout".
5. On the "Billing Address" step, choose "Austria" in "Country", type "1010" into "Postal code" and "98" into "House number", wait until Street, City and State are filled in automatically, then click "Proceed to checkout".
6. On the "Payment" step, choose "Cash on Delivery" under "Payment Method" and click "Check payment".
7. When a message about the payment appears under the form, click "Confirm".
Expected Outcome: The page shows "Thanks for your order! Your invoice number is" followed by an invoice number.

Why it works: each step names the screen it acts on, step 5 waits for the site’s own address lookup, and step 7 handles the two-click payment. It places a real order: run it only where that is safe. PASSED

Long Nose Pliers can be added to the cart (Start Path /, tags cart, regression)
1. Type "Long Nose Pliers" into the "Search" field and click "Search".
2. Open the product "Long Nose Pliers".
3. Click "Add to cart".
Expected Outcome: The message "Product added to shopping cart." appears.

FAILED The shop is out of this product. The failure reason says so: “Expected outcome not met… Observed: … The page shows ‘Out of stock’”. This is the kind of failure a test exists to catch, and the steps need no change.