feat(e2e): Epic #491 - Prerequisites and Test Data Setup#624
Merged
africanitem merged 12 commits intoSimpleAccounts:developfrom Jan 17, 2026
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
MohsinHashmi-DataInn
previously approved these changes
Jan 14, 2026
Contributor
MohsinHashmi-DataInn
left a comment
There was a problem hiding this comment.
Approved. Excellent foundation for E2E workflow tests. Well-structured helper functions with API-first approach and UI fallbacks. Comprehensive prerequisites test validates all helpers.
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
826ae48 to
51d26be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Epic: #491 - Prerequisites and Test Data Setup
This PR implements all helper functions and comprehensive test for Epic #491.
Completed Tasks
Files Created
apps/frontend/e2e/helpers/test-setup-helpers.ts- Environment setupapps/frontend/e2e/helpers/test-user-helpers.ts- User creation/loginapps/frontend/e2e/helpers/bank-account-helpers.ts- Bank account setupapps/frontend/e2e/helpers/customer-helpers.ts- Customer setupapps/frontend/e2e/helpers/supplier-helpers.ts- Supplier setupapps/frontend/e2e/helpers/product-helpers.ts- Product/service setupapps/frontend/e2e/helpers/vat-helpers.ts- VAT code verificationapps/frontend/e2e/helpers/chart-of-accounts-helpers.ts- COA verificationapps/frontend/e2e/prerequisites-test-data-setup.spec.ts- Comprehensive testFeatures
Closes #491