Module 25 · Advanced · 9 min read
Writing test scripts and scenarios
You will be able to: Write a script with preconditions, steps and expected results; Include ledger checks, negative tests and role tests; Design a scenario list for a distributor.
- Read not done yet
- Self-check: not taken not done yet
- Lesson complete not done yet
A good test script can be run by someone who was not in the workshop. It names the data, tells the tester exactly what to do, and says what they must see. 'Check it works' is not an expected result.
Script template
| Field | Content |
|---|---|
| ID and title | TS-OTC-01, Cash-on-credit sale with VAT |
| Requirement ID | R-02 |
| Preconditions | Customer C001 credit limit AED 20,000; item I-100 price AED 100, cost AED 60, stock 50; user with Sales role |
| Steps | Numbered, one action each |
| Expected result | Specific figures and screens |
| Ledger check | What Posting Trail and reports must show |
| Result and tester | Pass or Fail, name, date, defect ID |
TS-OTC-01 in fullSteps: 1) Open Sales Invoice, press New. 2) Pick customer C001. 3) Add item I-100, quantity 10 at AED 100. 4) Submit. Expected: net AED 1,000, VAT at 5% AED 50, total AED 1,050; the document gets a number from the invoice series. Ledger check in Reports, Posting Trail: receivable debit 1,050, sales credit 1,000, VAT output credit 50, cost of goods sold debit 600 (10 x 60) against inventory. Stock of I-100 falls from 50 to 40. Aged receivables for C001 shows 1,050.
Beyond the happy path
- Negative tests: invoice over the credit limit (blocked or warned as configured), a document dated in a closed year, a duplicate customer LPO, missing TRN where required.
- Corrections: amend a submitted invoice (the number gets /A1), cancel one, issue a credit note.
- Role tests: log in as each role and try an action it should not have. A screen outside the role or licence shows Access Restricted, and a button the role may not use is refused with the missing permission named.
- Approval tests: an invoice above the approval threshold waits for the approver; the approver, not the raiser, approves it.
- Output tests: print on every real printer and paper size, and export to PDF.
- Month-end tests: bank reconciliation, VAT Return Worksheet, trial balance equals zero difference.
| Process | Scenario | Priority |
|---|---|---|
| Sales | Quotation to order to delivery note to invoice to receipt | Must |
| Sales | Credit limit exceeded | Must |
| Sales | Return with credit note | Must |
| Purchase | PO to GRN to purchase invoice to payment | Must |
| Stock | Transfer between warehouses and an adjustment | Should |
| POS | Cash sale, card sale, shift close | Must for retail |
| Finance | Receipt allocation to oldest invoices; PDC deposit and clearance | Must |
| VAT | Return Worksheet equals reports | Must |
| Roles | Each role's allowed and refused actions | Must |
TipWrite the expected figures before the tester runs the script. If the system and the script disagree, one of them is wrong, and you want to know which.
Practise in the demo
- Write a script for a purchase of 20 units at AED 50 plus 5% VAT with the expected receivable-side and stock results.
- In the demo, run a small sale and look at Reports, Posting Trail to confirm the entries.
- Open https://demo.zeyto.app/demo-app/ and sign in with the demo login. This is a public demo with sample data, so nothing you do there affects a real business.
Public demo company, sign in as admin / demoAdmin123. Data refreshes nightly.
Key takeaways
- A script has preconditions, numbered steps, specific expected results and a ledger check.
- Test negative cases, corrections and roles, not only the happy path.
- Write the expected figures first.
Check yourself
3 questions on this lesson. Not timed, not the exam, and you can try again. Score 60% or more, and read the lesson, to complete it.