Skip to content

feat(e2e): Epic #491 - Prerequisites and Test Data Setup#624

Merged
africanitem merged 12 commits intoSimpleAccounts:developfrom
africanitem:feature/e2e-workflow-tests-epic-0-prerequisites
Jan 17, 2026
Merged

feat(e2e): Epic #491 - Prerequisites and Test Data Setup#624
africanitem merged 12 commits intoSimpleAccounts:developfrom
africanitem:feature/e2e-workflow-tests-epic-0-prerequisites

Conversation

@africanitem
Copy link
Copy Markdown
Contributor

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 setup
  • apps/frontend/e2e/helpers/test-user-helpers.ts - User creation/login
  • apps/frontend/e2e/helpers/bank-account-helpers.ts - Bank account setup
  • apps/frontend/e2e/helpers/customer-helpers.ts - Customer setup
  • apps/frontend/e2e/helpers/supplier-helpers.ts - Supplier setup
  • apps/frontend/e2e/helpers/product-helpers.ts - Product/service setup
  • apps/frontend/e2e/helpers/vat-helpers.ts - VAT code verification
  • apps/frontend/e2e/helpers/chart-of-accounts-helpers.ts - COA verification
  • apps/frontend/e2e/prerequisites-test-data-setup.spec.ts - Comprehensive test

Features

  • All helpers follow standardized patterns (credentials, naming)
  • API-first approach with UI fallback
  • Proper billing/shipping address support
  • Petty cash account creation (essential for payments)
  • Comprehensive test validates all helpers

Closes #491

@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. Excellent foundation for E2E workflow tests. Well-structured helper functions with API-first approach and UI fallbacks. Comprehensive prerequisites test validates all helpers.

@africanitem africanitem dismissed MohsinHashmi-DataInn’s stale review January 14, 2026 15:57

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
@africanitem africanitem force-pushed the feature/e2e-workflow-tests-epic-0-prerequisites branch from 826ae48 to 51d26be Compare January 17, 2026 15:18
@africanitem africanitem merged commit 320b7f8 into SimpleAccounts:develop Jan 17, 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] Prerequisites and Test Data Setup Workflow E2E Tests

2 participants