Merchant Portal — Invoice Test Cases
A. Document controlA. Kiểm soát tài liệu
| Doc ID | CPG-TC-CPG-MP_Invoice_TestCases |
|---|---|
| VersionPhiên bản | 1.0 |
| StatusTrạng thái | Draft |
| Owner | CPG BA / Architecture |
| AudienceĐối tượng | QA, Product, Backend, Frontend |
| ClassificationPhân loại | Internal |
| Effective dateNgày hiệu lực | 01/12/2026 |
| Related docs | MP Invoice UC · MP Invoice FSD |
B. Version historyB. Lịch sử phiên bản
| Version | Date | Author | ChangesThay đổi |
|---|---|---|---|
| 1.0 | 01/12/2026 | Khoa Trinh | Version 1.0 |
C. Table of contentsC. Mục lục
D. ContentD. Nội dung
Index
| Test ID | Test name | BR | UC | Category |
|---|---|---|---|---|
| TC-MP-INV-001 | Invoices landing shows breadcrumb and title | BR-MP-INV-01 | UC-INV-01 | Function |
| TC-MP-INV-002 | Manage user sees Create and Export actions | BR-MP-INV-01 | UC-INV-01 | Function |
| TC-MP-INV-003 | Invoice table shows expected columns | BR-MP-INV-01 | UC-INV-01 | Function |
| TC-MP-INV-004 | Pagination defaults to 10 rows per page | BR-MP-INV-01 | UC-INV-01 | Function |
| TC-MP-INV-005 | Empty filter result shows no invoices message | BR-MP-INV-01 | UC-INV-01 | Function |
| TC-MP-INV-006 | Filter invoices by Invoice Id | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-007 | Filter invoices by Order Id | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-008 | Filter invoices by Customer Email | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-009 | Filter invoices by Product Code | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-010 | Filter invoices by Status Pending | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-011 | Filter invoices by Network TRON | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-012 | Filter invoices by amount range | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-013 | Search with unchanged filters still refreshes list | BR-MP-INV-02 | UC-INV-02 | Function |
| TC-MP-INV-014 | Create invoice succeeds for USDT | BR-MP-INV-03 | UC-INV-03 | Function |
| TC-MP-INV-015 | Create invoice discount reduces total | BR-MP-INV-03 | UC-INV-03 | Function |
| TC-MP-INV-016 | Create invoice rejects negative discount | BR-MP-INV-03 | UC-INV-03 | Validation |
| TC-MP-INV-017 | Create invoice rejects discount above subtotal plus tax | BR-MP-INV-03 | UC-INV-03 | Validation |
| TC-MP-INV-018 | Create invoice requires future expiry | BR-MP-INV-03 | UC-INV-03 | Validation |
| TC-MP-INV-019 | Create invoice requires product id and name | BR-MP-INV-03 | UC-INV-03 | Validation |
| TC-MP-INV-020 | Create invoice refresh shows new code on page 1 | BR-MP-INV-03 | UC-INV-03 | Function |
| TC-MP-INV-021 | Open invoice detail from Invoice Id | BR-MP-INV-04 | UC-INV-04 | Function |
| TC-MP-INV-022 | Detail shows subtotal tax discount and total | BR-MP-INV-04 | UC-INV-04 | Function |
| TC-MP-INV-023 | Close invoice detail dialog | BR-MP-INV-04 | UC-INV-04 | Function |
| TC-MP-INV-024 | Download invoice PDF for manage user | BR-MP-INV-04 | UC-INV-04 | Function |
| TC-MP-INV-025 | View-only user cannot download PDF | BR-MP-INV-04 | UC-INV-04 | Security |
| TC-MP-INV-026 | Export invoices as CSV | BR-MP-INV-05 | UC-INV-05 | Function |
| TC-MP-INV-027 | Export invoices as Excel | BR-MP-INV-05 | UC-INV-05 | Function |
| TC-MP-INV-028 | Export invoices as PDF | BR-MP-INV-05 | UC-INV-05 | Function |
| TC-MP-INV-029 | View-only user cannot create or export | BR-MP-INV-06 | UC-INV-06 | Security |
| TC-MP-INV-030 | Manage user can create and export | BR-MP-INV-06 | UC-INV-06 | Security |
Test cases
TC-MP-INV-001
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-001 |
| Business Requirement ID | BR-MP-INV-01 |
| Category | Function |
| Use Case ID | UC-INV-01 |
| Test name | Invoices landing shows breadcrumb and title |
| Preconditions | User with invoice:view and invoice:manage is logged in. |
| Data | — |
| Steps | Open /invoices. |
| Expected result | Breadcrumb Home / Invoices and heading Invoices are visible. |
TC-MP-INV-002
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-002 |
| Business Requirement ID | BR-MP-INV-01 |
| Category | Function |
| Use Case ID | UC-INV-01 |
| Test name | Manage user sees Create and Export actions |
| Preconditions | invoiceAdmin logged in. |
| Data | — |
| Steps | Open /invoices. |
| Expected result | Export CSV Excel PDF and Create Invoice buttons are visible. |
TC-MP-INV-003
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-003 |
| Business Requirement ID | BR-MP-INV-01 |
| Category | Function |
| Use Case ID | UC-INV-01 |
| Test name | Invoice table shows expected columns |
| Preconditions | Seed invoices exist. |
| Data | — |
| Steps | Open /invoices. Inspect table header. |
| Expected result | Headers include Invoice Id, Order Id, Product Code, Customer Email, Amount, Invoice Date, Due Date, Status. |
TC-MP-INV-004
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-004 |
| Business Requirement ID | BR-MP-INV-01 |
| Category | Function |
| Use Case ID | UC-INV-01 |
| Test name | Pagination defaults to 10 rows per page |
| Preconditions | Merchant has at least 12 invoices. |
| Data | — |
| Steps | Open /invoices with default filters. |
| Expected result | Page 1 shows 10 rows. Footer shows Showing 1 to 10 of N entries. |
TC-MP-INV-005
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-005 |
| Business Requirement ID | BR-MP-INV-01 |
| Category | Function |
| Use Case ID | UC-INV-01 |
| Test name | Empty filter result shows no invoices message |
| Preconditions | Filters match none. |
| Data | Invoice Id = NO-MATCH-999 |
| Steps | Enter unmatched Invoice Id. Click Search. |
| Expected result | Table shows No invoices found. |
TC-MP-INV-006
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-006 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Filter invoices by Invoice Id |
| Preconditions | INV000001 exists. |
| Data | Invoice Id = INV000001 |
| Steps | Enter INV000001. Search. |
| Expected result | Only INV000001 is listed. |
TC-MP-INV-007
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-007 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Filter invoices by Order Id |
| Preconditions | ORD-1001 exists. |
| Data | Order Id = ORD-1001 |
| Steps | Enter ORD-1001. Search. |
| Expected result | Matching invoice for ORD-1001 is listed. |
TC-MP-INV-008
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-008 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Filter invoices by Customer Email |
| Preconditions | jane@example.com exists. |
| Data | Customer Email = jane@example.com |
| Steps | Enter email. Search. |
| Expected result | Only invoices for jane@example.com are listed. |
TC-MP-INV-009
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-009 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Filter invoices by Product Code |
| Preconditions | PRD-LAPTOP exists. |
| Data | Product Code = PRD-LAPTOP |
| Steps | Enter product code. Search. |
| Expected result | Matching invoice with PRD-LAPTOP is listed. |
TC-MP-INV-010
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-010 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Filter invoices by Status Pending |
| Preconditions | Mixed statuses exist. |
| Data | Status = Pending |
| Steps | Select Pending. Search. |
| Expected result | Only Pending invoices are listed. |
TC-MP-INV-011
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-011 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Filter invoices by Network TRON |
| Preconditions | INV with network TRON exists. |
| Data | Network = TRON |
| Steps | Select TRON. Search. |
| Expected result | Only TRON invoices are listed. |
TC-MP-INV-012
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-012 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Filter invoices by amount range |
| Preconditions | Amounts 100 and 1250 exist. |
| Data | Amount From = 1000; Amount To = 2000 |
| Steps | Enter amount range. Search. |
| Expected result | Only invoices with total in range are listed. |
TC-MP-INV-013
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-013 |
| Business Requirement ID | BR-MP-INV-02 |
| Category | Function |
| Use Case ID | UC-INV-02 |
| Test name | Search with unchanged filters still refreshes list |
| Preconditions | Filters already applied. API is available. |
| Data | Same Invoice Id already applied |
| Steps | Click Search again without changing filters. |
| Expected result | List request is issued again and results remain visible. |
TC-MP-INV-014
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-014 |
| Business Requirement ID | BR-MP-INV-03 |
| Category | Function |
| Use Case ID | UC-INV-03 |
| Test name | Create invoice succeeds for USDT |
| Preconditions | invoiceAdmin. Tax profile available. |
| Data | Order Id=ORD-E2E-1; Product Id=PRD-E2E; Product Name=Widget; Price=100; Qty=1; Asset=USDT |
| Steps | Open Create Invoice. Fill required fields. Submit. |
| Expected result | Toast shows Invoice INV... created. Modal closes. New invoice appears in list. |
TC-MP-INV-015
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-015 |
| Business Requirement ID | BR-MP-INV-03 |
| Category | Function |
| Use Case ID | UC-INV-03 |
| Test name | Create invoice discount reduces total |
| Preconditions | Create modal open with line total 100 and tax 0. |
| Data | Discount = 10 |
| Steps | Enter discount 10. Observe Invoice Total. |
| Expected result | Invoice Total shows 90.00 USDT before submit. |
TC-MP-INV-016
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-016 |
| Business Requirement ID | BR-MP-INV-03 |
| Category | Validation |
| Use Case ID | UC-INV-03 |
| Test name | Create invoice rejects negative discount |
| Preconditions | Create modal open with valid line item. |
| Data | Discount = -1 |
| Steps | Enter -1. Submit. |
| Expected result | Toast: Discount amount must be 0 or greater. No create POST. |
TC-MP-INV-017
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-017 |
| Business Requirement ID | BR-MP-INV-03 |
| Category | Validation |
| Use Case ID | UC-INV-03 |
| Test name | Create invoice rejects discount above subtotal plus tax |
| Preconditions | Line total 100 tax 0. |
| Data | Discount = 150 |
| Steps | Enter 150. Submit. |
| Expected result | Toast: Discount amount cannot exceed subtotal plus tax. No create POST. |
TC-MP-INV-018
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-018 |
| Business Requirement ID | BR-MP-INV-03 |
| Category | Validation |
| Use Case ID | UC-INV-03 |
| Test name | Create invoice requires future expiry |
| Preconditions | Create modal open. |
| Data | Expiry in the past |
| Steps | Set past due date. Submit. |
| Expected result | Toast: Expiry time must be in the future. |
TC-MP-INV-019
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-019 |
| Business Requirement ID | BR-MP-INV-03 |
| Category | Validation |
| Use Case ID | UC-INV-03 |
| Test name | Create invoice requires product id and name |
| Preconditions | Create modal open. |
| Data | Product Id empty |
| Steps | Clear product id. Submit. |
| Expected result | Toast: Product Id is required for each line item. |
TC-MP-INV-020
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-020 |
| Business Requirement ID | BR-MP-INV-03 |
| Category | Function |
| Use Case ID | UC-INV-03 |
| Test name | Create invoice refresh shows new code on page 1 |
| Preconditions | invoiceAdmin. |
| Data | Valid create payload |
| Steps | Create invoice successfully. |
| Expected result | List returns to page 1 and includes the new invoice code from toast. |
TC-MP-INV-021
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-021 |
| Business Requirement ID | BR-MP-INV-04 |
| Category | Function |
| Use Case ID | UC-INV-04 |
| Test name | Open invoice detail from Invoice Id |
| Preconditions | INV000001 exists with items. |
| Data | — |
| Steps | Click Invoice Id INV000001. |
| Expected result | Detail dialog opens with invoice preview for INV000001. |
TC-MP-INV-022
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-022 |
| Business Requirement ID | BR-MP-INV-04 |
| Category | Function |
| Use Case ID | UC-INV-04 |
| Test name | Detail shows subtotal tax discount and total |
| Preconditions | INV000001 detail has discount 1.50. |
| Data | — |
| Steps | Open INV000001 detail. |
| Expected result | Preview shows Subtotal Tax Discount and Total Amount rows. |
TC-MP-INV-023
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-023 |
| Business Requirement ID | BR-MP-INV-04 |
| Category | Function |
| Use Case ID | UC-INV-04 |
| Test name | Close invoice detail dialog |
| Preconditions | Detail dialog open. |
| Data | — |
| Steps | Click Close. |
| Expected result | Dialog closes. |
TC-MP-INV-024
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-024 |
| Business Requirement ID | BR-MP-INV-04 |
| Category | Function |
| Use Case ID | UC-INV-04 |
| Test name | Download invoice PDF for manage user |
| Preconditions | invoiceAdmin. INV000001 open in detail. |
| Data | — |
| Steps | Click Download PDF. |
| Expected result | PDF download starts with INV000001.pdf. |
TC-MP-INV-025
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-025 |
| Business Requirement ID | BR-MP-INV-04 |
| Category | Security |
| Use Case ID | UC-INV-04 |
| Test name | View-only user cannot download PDF |
| Preconditions | invoiceViewer logged in. |
| Data | — |
| Steps | Open invoice detail. |
| Expected result | Download PDF button is not shown. |
TC-MP-INV-026
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-026 |
| Business Requirement ID | BR-MP-INV-05 |
| Category | Function |
| Use Case ID | UC-INV-05 |
| Test name | Export invoices as CSV |
| Preconditions | invoiceAdmin. Filters applied or default. |
| Data | format=csv |
| Steps | Click Export CSV. |
| Expected result | CSV download starts. Toast Export ready. |
TC-MP-INV-027
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-027 |
| Business Requirement ID | BR-MP-INV-05 |
| Category | Function |
| Use Case ID | UC-INV-05 |
| Test name | Export invoices as Excel |
| Preconditions | invoiceAdmin. |
| Data | format=excel |
| Steps | Click Export Excel. |
| Expected result | Excel download starts. Toast Export ready. |
TC-MP-INV-028
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-028 |
| Business Requirement ID | BR-MP-INV-05 |
| Category | Function |
| Use Case ID | UC-INV-05 |
| Test name | Export invoices as PDF |
| Preconditions | invoiceAdmin. |
| Data | format=pdf |
| Steps | Click Export PDF. |
| Expected result | PDF download starts. Toast Export ready. |
TC-MP-INV-029
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-029 |
| Business Requirement ID | BR-MP-INV-06 |
| Category | Security |
| Use Case ID | UC-INV-06 |
| Test name | View-only user cannot create or export |
| Preconditions | invoiceViewer logged in. |
| Data | — |
| Steps | Open /invoices. |
| Expected result | Create Invoice and Export CSV/Excel/PDF buttons are hidden. |
TC-MP-INV-030
| Field | Value |
|---|---|
| Test ID | TC-MP-INV-030 |
| Business Requirement ID | BR-MP-INV-06 |
| Category | Security |
| Use Case ID | UC-INV-06 |
| Test name | Manage user can create and export |
| Preconditions | invoiceAdmin logged in. |
| Data | — |
| Steps | Open /invoices. |
| Expected result | Create Invoice and all Export buttons are visible. |