Test Plan For CMS Integration Test: Targets Requirements
Test Plan For CMS Integration Test: Targets Requirements
integration test
Targets Requirements
- This plan use for test correctness of CMS when integration with other - One CMS
services - One PLM
- Can test more testcases in one time, use same CMS and DB - One BI
- Can build to a runnable program which automatically test user's credit in - One AM
Unity system - One AE
- One Admin Portal
- One Agent Portal
- Use RealResultFakeBetting
Betting account AC
Example convention
We must apply the naming rule when setup DB before running a testcase.
See below example:
Testcase 1 requirements: Testcase 2 requirements:
Company Company
Needed DB
Common testflow
We'll test a testcase more time with a specific number of bets input. Each time we run a
testcase we call it as round and later round will has larger input with the previous. It'll
help us easy for control and verify the result in the first run. For example, testcase 1 will be
tested in 3 rounds, in first round we only test with 10 bets and then test with 30 bets in
next round and finally we'll test with 100 bets.
I break down a testcase into phases, and for each phase a set of potential steps will be
done. You can see the testflow diagram below. A testcase doesn't need perform all steps
in a phase. It can only do a subset of step. For example, If we want test with normal bet
then we don't need generate missing or dangling bets (step 2.2 and 2.3).
Start
Step Action
Phase 1:
1-1 Setup currency and currency conversions
Setup DB
1-2 Setup users
Step Action
Phase 2: 2-1 Config and run BI client
Run testcase
2-2 Generate missing bets
2-3 Generate dangling bets
Step 2-1: Config and run BI clients Step 2-3: Generate dangling bets
(will update later about how to config) Generate dangling bets similar with generation missing bet except one thing we need
change value one of these action pack's properties after inserted: odd, pivot, target type,
Step 2-2: Generate missing bets version, league and teams name. We can clear league name.
To generate a missing bet, we have to insert a new action pack to action_packs table and (1) logout account
then insert new bet to fake_bets table, it must has similar information with action pack we (2) insert a new action pack to action_packs table
just inserted. (3) insert a new fake bet to fake_bets table
(1) logout account (4) clear league name of action pack we just inserted
(2) insert a new action pack to action_packs table (5) login account
(3) insert a new fake bet to fake_bets table
(4) login account
Step 3-1: Collect and calculate expected user credit after finished phase 2
If user's type is bet user, we need to collect user's bets and calculate about (see appendix to get formulas and
queries):
(1) credit: current user's credit. It's credit field in bet_users table.
(2) turnover: total bet's stake was placed. Not include CANCELLED/REJECTED bets.
(3) outstanding: total bet's stake of unsettled bets. It's oustanding field in bet_users table.
(4) PL: total bet's return amount of settled bets. It's pl field in bet_users table.
(5) paid commission: total commission amount user was paid for its agents.
If user's type is agent user, we need to collect downline bet user's bets and calculate about (see appendix to get
formulas and queries):
(6) credit: current user's credit
(7) downline credit: total credit of all its downline users (both child agent and bet users)
(8) downline outstanding: total oustanding of all its bet users ("i think we should call it as member outstanding
similar with member turnover or member PL because only bet user has outstanding")
(9) member turnover: total turnover of all its bet users.
(10) member PL: total PL of all its bet users.
(11) member commission: total paid commission of all its bet users.
(12) received commission: total commission amount that user was received.
Finally this step, we'll have these tables and can use them for verification steps:
Paid
Bet User Credit TurnOver Outstanding PL
Commission
Step 3-2: Collect and calculate expected user's credit after resolve all bets
We'll collect and calculate again user credit informations similar with step 3.1 after resolve all
bets were placed in phase 2.
Step 3-4: Collect and calculate expected user's credits after resolve all resettled bets
After generate resettled bets, we also collect and calculate user credit informations again similar with step 3-1
after resolve all resettled bets which were generated in previous step.
Step 4-1: Verify data in database
After collect and calculate expected user's credits base on bets in step 3-1, 3-3, 3-4, 3-6 and 3-7.
We can use them to verify data in database, BI, CMS (by query DB), Agent Portal and Admin
Portal. To verify data in database we'll query and calculate these fields (see appendix to get
queries):
+ Bet user's credit, outstanding and pl: query directly from bet_users table.
+ Bet user's paid commisson, turnover: query and calculate from bet_transaction table
+ Agent user's credit: query from agent_users table
+ Agent user's downline credit, downline outstanding and member PL : query and calcualte
from bet_users table.
+ Agent user's member turnover, received commission and member commission: query and
calculate from bet_transaction table.