feat(06-04): Playwright E2E test suite execution
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test.describe("Gravl API Tests", () => {
|
||||
const BASE_URL = process.env.STAGING_URL || "http://localhost:5173";
|
||||
|
||||
test("homepage loads successfully", async ({ request }) => {
|
||||
const response = await request.get(`${BASE_URL}/`);
|
||||
expect(response.status()).toBe(200);
|
||||
const html = await response.text();
|
||||
expect(html).toContain("Gravl");
|
||||
});
|
||||
|
||||
test("login page is accessible", async ({ request }) => {
|
||||
const response = await request.get(`${BASE_URL}/login`);
|
||||
expect([200, 301, 302]).toContain(response.status());
|
||||
});
|
||||
|
||||
test("API connectivity check", async ({ request }) => {
|
||||
// Check if backend API is accessible
|
||||
const response = await request.get(`${BASE_URL}/`);
|
||||
expect(response.status()).toBeLessThan(500);
|
||||
});
|
||||
});
|
||||
@@ -1,17 +1,23 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test("login page loads", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
await expect(page.locator("form")).toBeVisible();
|
||||
});
|
||||
test.describe("Gravl UI Tests (Browser-based)", () => {
|
||||
// NOTE: These tests require system graphics libraries (libXcomposite, libX11, etc.)
|
||||
// which are not available in the current environment.
|
||||
// See: TESTING.md for browser setup instructions
|
||||
|
||||
test("login page loads", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
await expect(page.locator("form")).toBeVisible();
|
||||
});
|
||||
|
||||
test("logo exists", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
const logo = await page.locator("svg, img[class*=logo], .logo").first();
|
||||
await expect(logo).toBeVisible();
|
||||
});
|
||||
test("logo exists", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
const logo = await page.locator("svg, img[class*=logo], .logo").first();
|
||||
await expect(logo).toBeVisible();
|
||||
});
|
||||
|
||||
test("dashboard loads", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await expect(page).toHaveTitle(/Gravl/);
|
||||
test("dashboard loads", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await expect(page).toHaveTitle(/Gravl/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user