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 CLIPayments

Test a partial refund and the balance it changes

Refund sixty dollars of a two hundred and fifty dollar payment, then check the row, the net and the account balance all agree.

Published on:

Refunds are the one operation in a payments dashboard that moves money backwards, and the only one where an arithmetic error shows up in an accounting reconciliation rather than in a customer complaint.

This use case issues a partial refund on the Squair dashboard and checks every figure it touches.

Failure modes in this flow

A partial refund updates three separate numbers, and a dashboard can update one of them without the others.

  • The refunded amount on the row - moving from $0.00 to $60.00.
  • The net on that payment - $190.00, which is the original $250.00 less the refund.
  • The status badge - Partially refunded rather than Completed or Refunded.
  • The account total - net sales after refunds falling from $250.00 to $190.00.

The badge matters as much as the figures. A partially refunded payment marked fully refunded blocks any further refund against it, and a payment marked completed invites a second refund that should not be possible.

Note

Note: Asserting the starting balance before the refund is what makes the change provable rather than a number that might always have read that way. Try it on TestMu AI. Try free!

Writing the objective

The first step establishes the baseline, including the fact that nothing has been refunded yet, so the refund the test issues is demonstrably the one being measured.

---
mode: testing
url: https://my-testing-repo-main.vercel.app/square-clone-app/dashboard?reset=true
max_steps: 45
tags: [square, payments, refunds]
---

# Squair 12.4: Refund from the dashboard

Catalog objective: refund the latest payment partially from the dashboard.
Key assertion: the refund is recorded and the balance updates.

## Verify the starting balance
Verify "Net sales after refunds" reads "$250.00" and the "pay_8812" row shows a refunded amount of "$0.00" with a "Completed" badge.

## Open the refund dialog
Click the refund button on the "pay_8812" row and verify a dialog titled "Refund pay_8812" opens showing "Original amount" of "$250.00".

## Refund part of it
Type "60" into "Refund amount", click "Issue refund", and verify a green banner reads "Refunded $60.00 on pay_8812."

## Verify the refund and the balance
Verify the "pay_8812" row now shows refunded of "$60.00", a net of "$190.00" and a "Partially refunded" badge, and "Net sales after refunds" reads "$190.00".

The dialog is identified by its title carrying the payment id, so a refund dialog opened against a neighbouring row fails before any amount is entered.

The assertions in detail

Each assertion covers one surface the refund is supposed to reach.

StepWhat it proves
Verify the starting balanceNet sales are $250.00 and the payment has no prior refund
Open the refund dialogThe dialog opens against the correct payment showing the original amount
Refund part of itA partial amount is accepted and confirmed by value
Verify the refund and the balanceRow, net, badge and account total all reflect the same refund

Four figures asserted against one action is the right ratio for a money-moving operation. Any one of them updating alone is a defect that reconciles incorrectly at the end of the month.

Next-generation test execution with TestMu AI

Running it locally

kane-cli testmd run tests/square/refund-dashboard_test.md

Point it at a sandbox rather than a live account. The flow moves real money in a real dashboard, and a test that issues refunds against production data is a different kind of problem.

Refund logic is also a common place for an agent-written change to land without review. Verifying agent-written code in a browser covers that loop, and running Kane CLI in CI covers gating it on every merge.

Author

...

Bhawana

Blogs: 75

  • 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

Refund Flow 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