||3 months ago|
|scenarios||3 months ago|
|.gitignore||3 months ago|
|.taprc||3 months ago|
|README.md||3 months ago|
|config.js||3 months ago|
|lib.js||3 months ago|
|package.json||3 months ago|
|yarn.lock||3 months ago|
Bunch of test scripts to automate traversing USSD menu's with little human interaction and as close replication to actual USSD usage including AT style reqests and waiting times.
2 accounts each with:
- Initial pin set
- Some SRF Balance
- Install dependencies with
$ npm i
- Set global config in
|initial_menu||Statless||Main menu > Help > Exit|
|display_sarafu||Stateless||Main menu > My Sarafu > Exit|
|reset_pin||Stateful||Main menu > Account options > Reset pin > Exit|
These tests live individually in their own folder. They require some ENV variables to be set before running them.
These are included under the
stateless folder and can be run in any order and have multple tests under the same folder since they only check correctness of menu responses.
# Set env variables for stateful scenarios, refer to individual test folders $ npx tap --bail scenarios/SCENARIO_NAME
CURRENT_PIN=4444 NEW_PIN=3333 npx tap --bail scenarios/stateless
- These scripts cannot reset USSD sessions upon failure. You will need to manually set your account USSD menu to the main menu
- Cannot verify sms status, confirm with cic-notify for delivery
Writing your own scenario
- Each scenario should exit since this test suite doesn't pass around past session info
- Control wait between menus with the
wait(time in ms)function
- Follow any spec
- For any menu traversal, remember to append a
*before the next input, this correctly mocks AT webhooks e.g.
- Dyanmic inputs for stateful scenarios must come from an env var that can be set again on next run
- Include a
tap-parallel-not-okfile in any new folder
# Initial Main menu, no input "" # Input 1 "1" # Input 2 "1*2" # Input 99 "1*2*99"