-
Notifications
You must be signed in to change notification settings - Fork 974
Generating simulated Brave Payments data for testing
This wiki became obsolete due to the recent ledger updates.
**depends on code in PR #4714: https://github.com/brave/browser-laptop/pull/4714 **
How to generate a browsing history for testing Brave Payments so you do not need to browse pages to test it.
- Clear Brave user data (
npm run clean userData
) - Run Brave, enable Payments
- Observe empty synopsis table (no publishers listed)
- In a terminal, run
npm run add-simulated-synopsis-visits
- Back in Brave, toggle Payments
- Observe Synopsis table is populated with random Publishers with random visit counts and durations
How to generate a simulated Payment History, allowing testing of features (e.g. Payment History or Payment Receipt export) that depend on transactions without spending BTC or waiting.
- Clear user data (
npm run clean userData
) - Start Brave
- Enable Brave Payments
- Observe no transactions, empty wallet, Payment History link is unavailable
- Run
npm run add-simulated-payment-history
- Switch to Brave and Toggle Payments
- Observe Payment History link is available
- Open Payment History.
- Observe 10 months of randomized Payments data
- Open
/\<UserDataPath\>/ledger-state.json
and confirm transactions are present
(Please forgive the bits of the GIF where I am just highlighting the raw generated data in Emacs, that is for those who are interested in what data looks like, in ledger-state.json
.
You only have to run npm run add-simulated-payment-history
, not do any other emacs/terminal-fu, I promise! :-) )
insecurity test
Vertical Side Tabs Tab Suspender