e7b1f270a5
- Implemented VendorOptionalFields component to handle optional vendor details (mobile, email, address) with validation. - Created useCustomerConfig hook to load optional customer field settings from Sales configuration. - Developed useProcurementConfig hook to manage Procurement configuration flags. - Introduced accessConfigApi for managing access configuration settings. - Added openingBalancesApi for handling opening balances operations. - Created procurementConfigApi for managing procurement configuration settings. - Implemented nav-routes for permission-based routing. - Developed PDF generation for purchase orders with dynamic vendor and item details. - Added purchase-order tax helpers for tax calculations and formatting. - Defined types for opening balances and related operations.
20 lines
1001 B
TypeScript
20 lines
1001 B
TypeScript
import { test as setup } from "@playwright/test"
|
|
import { LoginPage } from "../pages/LoginPage"
|
|
import { env, AUTH_STORAGE_STATE } from "../support/env"
|
|
|
|
// NOTE: E2E_ADMIN_EMAIL must be an administrator in the ERP itself (users.RoleId -> the role flagged IsAdmin; Settings -> Users).
|
|
// Being "admin" in AuthHex no longer grants anything: the ERP reads the role from its own database on every request.
|
|
//
|
|
// Runs once before the "chromium" project (see playwright.config.ts `dependencies`). Logs
|
|
// in through the real UI form - the session is an httpOnly cookie (docs/11 §2.0), so there
|
|
// is no token to inject; driving the form is the only way to obtain it - then saves cookies
|
|
// to disk so every other spec starts already authenticated.
|
|
setup("authenticate", async ({ page }) => {
|
|
const login = new LoginPage(page)
|
|
await login.goto()
|
|
await login.login(env.adminEmail, env.adminPassword)
|
|
await login.expectLoggedIn()
|
|
|
|
await page.context().storageState({ path: AUTH_STORAGE_STATE })
|
|
})
|