Files
ERP-core/Testing/e2e/pages/LoginPage.ts
T
ImanThiyanga c31e23c2b9 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.
2026-08-05 13:26:41 +05:30

24 lines
584 B
TypeScript

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()
}
}