Skip to content

Phase 2: Revenue Cycles E2E Workflow Tests#627

Merged
africanitem merged 19 commits intoSimpleAccounts:developfrom
africanitem:phase-2-revenue-cycles-e2e-tests
Jan 18, 2026
Merged

Phase 2: Revenue Cycles E2E Workflow Tests#627
africanitem merged 19 commits intoSimpleAccounts:developfrom
africanitem:phase-2-revenue-cycles-e2e-tests

Conversation

@africanitem
Copy link
Copy Markdown
Contributor

This PR implements Phase 2: Revenue Cycles E2E Workflow Tests (Milestone #4)

Epics Implemented

Epic #523: Quotation-to-Invoice Workflow

Epic #551: Credit Note and Refund Workflow

Files Added

  • apps/frontend/e2e/helpers/quotation-helpers.ts - Quotation operation helpers
  • apps/frontend/e2e/quotation-to-invoice-workflow.spec.ts - Quotation-to-invoice workflow tests
  • apps/frontend/e2e/helpers/credit-note-helpers.ts - Credit note operation helpers
  • apps/frontend/e2e/credit-note-refund-workflow.spec.ts - Credit note and refund workflow tests

Related Issues

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown
Contributor

@MohsinHashmi-DataInn MohsinHashmi-DataInn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Comprehensive Phase 2 revenue cycle tests including quotation-to-invoice and credit note/refund workflows. Good coverage of the complete revenue cycle.

@africanitem africanitem dismissed MohsinHashmi-DataInn’s stale review January 14, 2026 16:01

The merge-base changed after approval.

…#490)

- Add clearDatabase() function for database cleanup
- Add setupTestEnvironment() function for environment initialization
- Add utility functions for getting base URLs and paths
- Follows standard patterns from existing test helpers

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
- Add getTestUserCredentials() function following E2E_USERNAME/E2E_PASSWORD pattern
- Add generateTestUserEmail() function using pattern test-${workflow}-${Date.now()}@example.com
- Add loginTestUser() function using standardized login helper
- Add createTestUser() function for user registration via registration flow
- Follows standard patterns from existing test helpers

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
Depends on Task SimpleAccounts#490
- Add generateBankAccountName() using pattern: Test Bank Account ${Date.now()}
- Add generateAccountNumber() using pattern: ACC-${Date.now()}
- Add createBankAccountViaAPI() for API-based account creation
- Add createPettyCashAccount() for petty cash setup (essential for payments)
- Add createBankAccountViaUI() as fallback method
- Add createTestBankAccount() with API-first, UI-fallback strategy
- Supports proper chart of accounts linkage via bankAccountType

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
Depends on Task SimpleAccounts#493
- Add generateCustomerName() using pattern: Test Customer ${Date.now()}
- Add generateCustomerEmail() using pattern: customer-${Date.now()}@example.com
- Add createCustomerViaAPI() for API-based customer creation
- Add createCustomerViaUI() using standardized contact creation helper
- Add createTestCustomer() with API-first, UI-fallback strategy
- Supports proper billing/shipping addresses with isBillingAndShippingAddressSame flag
- Uses contactType = 1 for customers

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
Depends on Task SimpleAccounts#493
- Add generateSupplierName() using pattern: Test Supplier ${Date.now()}
- Add generateSupplierEmail() using pattern: supplier-${Date.now()}@example.com
- Add createSupplierViaAPI() for API-based supplier creation
- Add createSupplierViaUI() using standardized contact creation helper
- Add createTestSupplier() with API-first, UI-fallback strategy
- Supports proper billing/shipping addresses with isBillingAndShippingAddressSame flag
- Uses contactType = 2 for suppliers

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
Depends on Task SimpleAccounts#493
)

- Add generateProductCode() using pattern: PRD-${Date.now()}
- Add generateProductName() using pattern: Test Product ${Date.now()}
- Add createProductViaAPI() for API-based product creation
- Add createTestProduct() for product creation
- Add createTestService() for service creation (productType = SERVICE)
- Supports both products and services
- Supports proper VAT codes via vatCategoryId

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
Depends on Task SimpleAccounts#493
- Add getVatCategories() to retrieve all VAT categories
- Add verifyVatCategoryExists() to verify specific VAT category
- Add getVatCategoryById() to get VAT category by ID
- Add setupVATCodes() to verify VAT codes exist before transactions
- Functions verify VAT codes exist before creating transactions

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
Depends on Task SimpleAccounts#493
…s#499)

- Add getChartOfAccounts() to retrieve all Chart of Accounts
- Add verifyChartOfAccountExists() to verify specific COA
- Add getChartOfAccountById() to get COA by ID
- Add setupChartOfAccounts() to verify COA structure exists
- Functions verify COA structure exists before transactions

Part of Epic SimpleAccounts#491: Prerequisites and Test Data Setup
Depends on Task SimpleAccounts#493
…ounts#500)

- Add comprehensive test suite for Epic SimpleAccounts#491 prerequisites
- Tests all helper functions: VAT, COA, bank accounts, customers, suppliers, products, services
- Validates petty cash account creation (essential for payment workflows)
- Validates proper billing/shipping addresses for customers and suppliers
- Validates VAT codes and Chart of Accounts structure
- Includes end-to-end validation test that creates all prerequisites in sequence
- All tests follow standardized patterns and naming conventions

Part of Epic SimpleAccounts#491
Depends on SimpleAccounts#490, SimpleAccounts#493-499
- fix prerequisites test to use request fixture per-test instead of beforeAll
- fix banking test navigation URL matching
- make database cleanup non-blocking in test-setup-helpers
- add auto-user creation logic in prerequisites test

resolves playwright fixture reuse errors and improves test reliability.
4 tests now passing (up from 0).
- fix request usage in beforeAll to use page.request instead
- ensures api calls work correctly when request fixture is not available
…#502)

- Add transaction helpers for deposits, withdrawals
- Add balance verification helpers
- Add transaction list retrieval helpers
- Add navigation helpers for transactions and statements
- Add UI fallback methods for transaction creation

Implements Epic SimpleAccounts#501 Task SimpleAccounts#502
…impleAccounts#503-511)

- Task SimpleAccounts#503: Bank account creation test
- Task SimpleAccounts#504: Opening balance entry test
- Task SimpleAccounts#505: Deposit transaction creation test
- Task SimpleAccounts#506: Withdrawal transaction creation test
- Task SimpleAccounts#507: Transaction linking to receipts test
- Task SimpleAccounts#508: Transaction linking to payments test
- Task SimpleAccounts#509: Transaction history viewing test
- Task SimpleAccounts#510: Bank statement generation test
- Task SimpleAccounts#511: Account balance calculations verification test

Implements Epic SimpleAccounts#501 Tasks SimpleAccounts#503-511
- Add quotation-helpers.ts with helper functions
- Generate quotation numbers using pattern: QTN-${Date.now()}
- Support creating quotations via API
- Support getting quotation details and list
- Support sending/posting quotations
- Add navigation helpers for quotation pages
- Follows same pattern as invoice-helpers.ts
…ice workflow tests

- Task SimpleAccounts#525: Implement quotation creation test
- Task SimpleAccounts#526: Implement quotation viewing/sending test
- Task SimpleAccounts#527: Implement quotation-to-invoice conversion test
- Task SimpleAccounts#528: Implement complete quotation-to-payment workflow test
- Add quotation-to-invoice-workflow.spec.ts
- Update quotation-helpers.ts to retrieve quotation ID after creation
…pers

- Add credit-note-helpers.ts with helper functions
- Generate credit note numbers using pattern: CN-${Date.now()}
- Support creating credit notes via API
- Support getting credit note details and list
- Support posting credit notes
- Support applying credit notes to invoices
- Support processing refunds for credit notes
- Add navigation helpers for credit note pages
- Follows same pattern as invoice-helpers.ts
…efund workflow tests

- Task SimpleAccounts#553: Implement credit note creation from invoice test
- Task SimpleAccounts#554: Implement credit note posting test
- Task SimpleAccounts#555: Implement credit note application to invoice test
- Task SimpleAccounts#556: Implement invoice balance updates after credit note test
- Task SimpleAccounts#557: Implement refund processing test
- Task SimpleAccounts#558: Implement refund recording test
- Task SimpleAccounts#559: Implement accounts receivable updates verification test
- Task SimpleAccounts#560: Implement bank account updates verification test
- Add credit-note-refund-workflow.spec.ts
- Fix credit note helper variable naming issue
@africanitem africanitem force-pushed the phase-2-revenue-cycles-e2e-tests branch from 6b1ef98 to 1f3b502 Compare January 17, 2026 15:19
@africanitem africanitem merged commit b875928 into SimpleAccounts:develop Jan 18, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EPIC] Credit Note and Refund Workflow E2E Tests [EPIC] Quotation-to-Invoice Workflow E2E Tests

2 participants