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:
@@ -0,0 +1,23 @@
|
||||
import { Page, expect } from "@playwright/test"
|
||||
|
||||
export class LoginPage {
|
||||
constructor(private readonly page: Page) {}
|
||||
|
||||
async goto() {
|
||||
await this.page.goto("/login")
|
||||
}
|
||||
|
||||
async login(email: string, password: string) {
|
||||
await this.page.locator("#email").fill(email)
|
||||
await this.page.locator("#password").fill(password)
|
||||
await this.page.getByRole("button", { name: /sign in/i }).click()
|
||||
}
|
||||
|
||||
async expectLoggedIn() {
|
||||
await expect(this.page).toHaveURL(/\/dashboard/)
|
||||
}
|
||||
|
||||
async expectError() {
|
||||
await expect(this.page.getByRole("alert")).toBeVisible()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user