feat(e2e): add Playwright end-to-end tests for authentication, GRN, production, stock transfers, and adjustments

- Introduced Playwright configuration for e2e testing.
- Implemented authentication tests to validate login functionality.
- Created tests for GRN (Goods Receipt Note) to ensure proper stock handling.
- Developed production run tests to verify lifecycle and stock posting.
- Added stock transfer tests to check movement between warehouses.
- Implemented stock adjustment tests for positive and negative adjustments.
- Established API seeder for test data setup and verification.
- Enhanced utility functions for UI interactions and response handling.
This commit is contained in:
2026-08-05 13:23:07 +05:30
parent 26cf2a146a
commit 722b1e78ed
36 changed files with 20627 additions and 137 deletions
+16
View File
@@ -0,0 +1,16 @@
import { test as setup } from "@playwright/test"
import { LoginPage } from "../pages/LoginPage"
import { env, AUTH_STORAGE_STATE } from "../support/env"
// 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 })
})