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 8e24ed6375
commit c31e23c2b9
36 changed files with 20627 additions and 137 deletions
+35
View File
@@ -0,0 +1,35 @@
import { defineConfig, devices } from "@playwright/test"
import { env, AUTH_STORAGE_STATE } from "./support/env"
export default defineConfig({
testDir: "./specs",
fullyParallel: false, // specs share warehouse/item reference data via the ledger - keep runs serial per file
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
// Multiple workers hit the local dev backend concurrently across spec files and it can't
// take it: confirmed reference-data GETs (e.g. /warehouses) intermittently 500 under 2+
// workers against a plain `dotnet run` + local Postgres, and pass every time at workers: 1.
// Bump this only against a backend that can actually take concurrent load (a real CI service
// container, not a single dev-mode process).
workers: 1,
reporter: [["html", { open: "never" }], ["list"]],
timeout: 45_000,
expect: { timeout: 10_000 },
use: {
baseURL: env.baseUrl,
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "setup",
testMatch: /global\.setup\.ts/,
},
{
name: "chromium",
use: { ...devices["Desktop Chrome"], storageState: AUTH_STORAGE_STATE },
dependencies: ["setup"],
},
],
})