c31e23c2b9
- 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.
24 lines
584 B
TypeScript
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()
|
|
}
|
|
}
|