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 that a portfolio total equals its positions
Test that a portfolio total equals its positions
Four read-only assertions that take a headline number apart and put it back together from the rows underneath.
Published on:
A portfolio total is the number a customer checks most often and trusts most completely. It is also derived from several other numbers, any one of which can be stale while the total still looks reasonable.
This use case takes the Robinhud portfolio total apart and verifies it from the rows up.
The checks that matter
The test is arithmetic performed on screen, which is the only kind of check that can catch a total computed from stale inputs.
| Figure | Value | Relationship |
|---|---|---|
| Total value | $1,309.60 | Positions plus cash |
| Positions value | $1,059.60 | Sum of all position market values |
| Cash | $250.00 | Uninvested balance |
| AAPL | $680.40 | 3 shares |
| AMZN | $379.20 | 2 shares |
| Sum of position values | $1,059.60 | Must equal positions value |
The application exposes its own sum check, and the test asserts that it equals the positions value shown above it. Two figures produced by different code paths agreeing is stronger evidence than either one being correct on its own.
Note: A read-only flow like this costs well under two minutes and covers the number customers look at more than any other. Start on TestMu AI. Start for free
The flow as a test file
Each position is asserted with its share count alongside its market value, so a row showing the right value for the wrong quantity fails.
---
mode: testing
url: https://my-testing-repo-main.vercel.app/robinhood-clone-app/portfolio?reset=true
max_steps: 40
tags: [robinhood, fintech, portfolio]
---
# Robinhud 16.3: Portfolio value
Catalog objective: open the portfolio and verify the total equals the sum of its positions.
Key assertion: the total matches the computed position sum.
## Verify the headline total
Verify "Total value" reads "$1,309.60".
## Verify the parts it is made of
Verify "Positions value" reads "$1,059.60" and "Cash" reads "$250.00".
## Verify each position's market value
Verify the AAPL row shows 3 shares with a market value of "$680.40" and the AMZN row shows 2 shares with a market value of "$379.20".
## Verify the sum check agrees
Verify "Sum of position values" reads "$1,059.60", which is the same as "Positions value".The step ceiling is 40 rather than 45 because nothing is submitted. Keeping the guard tight on a read-only flow means a runaway run stops sooner.
Step by step coverage
The four steps move from the headline down to the components and back up to the check.
| Step | What it proves |
|---|---|
| Verify the headline total | The figure the customer sees first is correct |
| Verify the parts it is made of | Positions value and cash both render |
| Verify each position's market value | Every row carries the right quantity and value |
| Verify the sum check agrees | The computed sum matches the displayed positions value |
Working top down and then confirming bottom up means a failure localises immediately. A wrong total with correct rows is a different bug from correct rows summed wrongly.
Adding it to a suite
kane-cli testmd run tests/robinhood/portfolio-value_test.mdAdd a variant for an empty portfolio and one for a single position, since zero and one are where display logic tends to break.
Financial totals are worth checking on every release rather than on request. Kane CLI in a pipeline covers scheduling, and deriving assertions from requirements covers keeping expected figures tied to a source.
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.
Portfolio Value 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




