Walks the four-step quote wizard, applies promo code SPRING10, checks the discount is exactly 10% of the subtotal, books the shipment and tracks the booking.
demoformsfreightmoney version: 1.0 DEMO-011__freight_quote_with_promo.py group: Freight regressiongroup: Freight smokegroup: Python and TypeScript, side by side
Runs
16
Pass rate
88%
14 passed / 2 failed
Avg duration
3s
p95 3s
Estimate
3s
avg of last 10 judged runs
Flakiness
0.27
0 stable · 1 alternates
Current streak
9
passed
Duration per run point color = outcome; dashed = 7-run average; click a point to open the run
Step timing trends the same step compared across the last 16 runs — slowest steps first, one line each
How long it takes distribution of 16 runs — two humps mean two different behaviours hiding behind one average
fastest 2s · slowest 4s
Why this test failed grouped by message, last 90 days
| times | message | last | |
|---|---|---|---|
| 2 | AssertionError: SPRING10 should take 10% off the $117.62 subtotal ($1… | Sep 24 | open |
Outcomes by target version
What this test does plain language, derived from the code
- response = page.goto(ctx.base_url + "freight/quote/?restart=1")
- assert response.ok, f"the quote page answered HTTP {response.status}: {page.title()!r}"
- ⏱ Timed phase: route
- Type “San Francisco” into the “From (city)” field
- Type “San Diego” into the “To (city)” field
- Click the button labelled “Next: cargo”
- ⏱ Timed phase: cargo
- Type “120” into the “Total weight (kg)” field
- Type “3” into the “Pieces” field
- Click the button labelled “Next”
- ⏱ Timed phase: choose a service
- page.get_by_role("radio", name="Standard").check()
- Click the button labelled “Next: review”
- ⏱ Timed phase: apply promo SPRING10
- Type “SPRING10” into the “Promo code” field
- Click the button labelled “Apply”
- Wait until #price-discount appears
- amount = lambda sel: float(page.get_attribute(sel, "data-amount")) # noqa: E731
- subtotal, discount = amount("#price-subtotal"), amount("#price-discount")
- fuel, total = amount("#price-fuel"), amount("#price-total")
- ctx.log(f"subtotal ${subtotal:.2f}, discount ${discount:.2f}, total ${total:.2f}")
- Take a screenshot (“priced”)
- expected = round(subtotal * 0.10, 2)
- assert abs(discount - expected) < 0.011, (
- f"SPRING10 should take 10% off the ${subtotal:.2f} subtotal (${expected:.2f}), "
- f"but the quote takes ${discount:.2f} off")
- assert abs(total - (subtotal - discount + fuel)) < 0.011, (
- f"the total ${total:.2f} is not subtotal - discount + fuel surcharge")
- ⏱ Timed phase: book
- Type “Grace Hopper” into the “Contact name” field
- Type “grace@example.gov” into the “Email” field
- Click the button labelled “Book shipment”
- Wait until #booking-id appears
- booking = page.inner_text("#booking-id")
- ctx.log(f"booked {booking}")
- ⏱ Timed phase: track the new booking
- Click the link labelled “Track this shipment”
- Wait until #track-result appears
- assert page.inner_text("#track-status") == "Booked"
- assert booking in page.inner_text("#track-result")
Show the code
"""A four-step quote, a promo code, a booking -- and checking the money.
Walks the quote wizard the way a customer does (route, cargo, service,
review), applies promo code SPRING10 and checks the discount is exactly 10%
of the subtotal -- computed from the numbers ON THE PAGE, so the test stays
right when prices change. Then it books the shipment and tracks the new
booking number.
Written in the "user-facing locators" style (get_by_label, get_by_role):
it reads like the steps a person follows, and it is what the Remote
Recorder produces too.
"""
def run(page, ctx):
response = page.goto(ctx.base_url + "freight/quote/?restart=1")
assert response.ok, f"the quote page answered HTTP {response.status}: {page.title()!r}"
with ctx.timed("route"):
page.get_by_label("From (city)").fill("San Francisco")
page.get_by_label("To (city)").fill("San Diego")
page.get_by_role("button", name="Next: cargo").click()
with ctx.timed("cargo"):
page.get_by_label("Total weight (kg)").fill("120")
page.get_by_label("Pieces").fill("3")
page.get_by_role("button", name="Next").click()
with ctx.timed("choose a service"):
page.get_by_role("radio", name="Standard").check()
page.get_by_role("button", name="Next: review").click()
with ctx.timed("apply promo SPRING10"):
page.get_by_label("Promo code").fill("SPRING10")
page.get_by_role("button", name="Apply").click()
page.wait_for_selector("#price-discount")
amount = lambda sel: float(page.get_attribute(sel, "data-amount")) # noqa: E731
subtotal, discount = amount("#price-subtotal"), amount("#price-discount")
fuel, total = amount("#price-fuel"), amount("#price-total")
ctx.log(f"subtotal ${subtotal:.2f}, discount ${discount:.2f}, total ${total:.2f}")
ctx.screenshot("priced")
expected = round(subtotal * 0.10, 2)
assert abs(discount - expected) < 0.011, (
f"SPRING10 should take 10% off the ${subtotal:.2f} subtotal (${expected:.2f}), "
f"but the quote takes ${discount:.2f} off")
assert abs(total - (subtotal - discount + fuel)) < 0.011, (
f"the total ${total:.2f} is not subtotal - discount + fuel surcharge")
with ctx.timed("book"):
page.get_by_label("Contact name").fill("Grace Hopper")
page.get_by_label("Email").fill("grace@example.gov")
page.get_by_role("button", name="Book shipment").click()
page.wait_for_selector("#booking-id")
booking = page.inner_text("#booking-id")
ctx.log(f"booked {booking}")
with ctx.timed("track the new booking"):
page.get_by_role("link", name="Track this shipment").click()
page.wait_for_selector("#track-result")
assert page.inner_text("#track-status") == "Booked"
assert booking in page.inner_text("#track-result")
All runs
| Run | Status | Queued | Duration | Version | Trigger | Batch |
|---|---|---|---|---|---|---|
| #486 | passed | 2026-09-25 07:00:10 | 3s | 3.0.0 | schedule | schedule: Freight regression … |
| #470 | passed | 2026-09-25 00:30:11 | 2s | 3.0.0 | group | group: Python and TypeScript,… |
| #393 | passed | 2026-09-24 23:24:12 | 2s | 3.0.0 | group | group: Freight smoke |
| #389 | passed | 2026-09-24 23:23:58 | 2s | 3.0.0 | group | group: Freight smoke |
| #385 | passed | 2026-09-24 23:22:20 | 2s | 3.0.0 | group | group: Freight smoke |
| #381 | passed | 2026-09-24 23:10:27 | 2s | 3.0.0 | group | group: Freight smoke |
| #374 | passed | 2026-09-24 22:10:14 | 3s | 3.0.0 | schedule | schedule: Freight smoke 22:10 |
| #366 | passed | 2026-09-24 22:05:21 | 4s | 3.0.0 | group | group: Freight regression |
| #356 | passed | 2026-09-24 22:04:30 | 3s | 3.0.0 | group | group: Freight smoke |
| #352 | failed | 2026-09-24 22:04:21 | 3s | 2.1.0 | group | group: Freight smoke |
| #332 | passed | 2026-09-24 19:48:13 | 3s | 3.0.0 | cli-adopted | 4 tests (terminal) |
| #308 | passed | 2026-09-24 18:59:58 | 3s | 3.0.0 | cli-adopted | 8 tests (terminal) |
| #300 | failed | 2026-09-24 18:57:59 | 2s | 2.1.0 | cli-adopted | 8 tests (terminal) |
| #288 | passed | 2026-09-24 18:55:40 | 3s | 2.0.0 | cli-adopted | 8 tests (terminal) |
| #149 | passed | 2026-09-24 18:52:00 | 3s | 1.1.0 | cli-adopted | 8 tests (terminal) |
| #11 | passed | 2026-09-24 18:48:19 | 3s | 1.0.0 | cli-adopted | 8 tests (terminal) |