Files
metabuilder/e2e/crud.spec.ts
johndoe6345789 4b0d8ae6e8 chore: Major nextjs cleanup - consolidate lib folders, remove redundant TSX, move e2e to root
- Moved e2e folder to project root with playwright configs
- Removed (auth) route group (handled by packages)
- Removed redundant API routes (codegen, levels, native-prisma, etc.)
- Deleted lib folders now covered by packages: security, schema, seed, api, auth, routing, navigation
- Removed *-lib duplicates: database-lib, types-lib, rendering-lib, package-lib
- Deleted duplicate dbal-client folders
- Cleaned up eslint config and removed eslint-plugins folder
- Removed old workflow scripts and build outputs
- Consolidated hooks folder
- Total: Reduced ~43 TS files
2026-01-02 22:58:39 +00:00

59 lines
2.0 KiB
TypeScript

import { expect, Page,test } from '@playwright/test';
// Helper function to navigate to login page
async function navigateToLogin(page: Page) {
await page.goto('/');
// Click "Sign In" button to navigate to login page
await page.getByRole('button', { name: /sign in|get started/i }).first().click();
// Wait for login form to appear
await page.waitForLoadState('networkidle');
}
test.describe('Application Interface', () => {
test('should have landing page with navigation options', async ({ page }) => {
await page.goto('/');
await page.waitForLoadState('domcontentloaded');
// Check for navigation buttons
const signInButton = page.getByRole('button', { name: /sign in/i });
await expect(signInButton).toBeVisible();
});
test('should navigate to login when clicking sign in', async ({ page }) => {
await page.goto('/');
// Click sign in
await page.getByRole('button', { name: /sign in|get started/i }).first().click();
// Should see login form
await expect(page.getByLabel(/username/i)).toBeVisible({ timeout: 5000 });
});
test('should have descriptive content on landing page', async ({ page }) => {
await page.goto('/');
await page.waitForLoadState('networkidle');
// Check if landing page has meaningful content
const bodyText = await page.textContent('body');
expect(bodyText).toBeTruthy();
expect(bodyText!.length).toBeGreaterThan(100);
});
});
test.describe('Login Interface', () => {
test('should have username and password fields', async ({ page }) => {
await navigateToLogin(page);
// Check for form elements
await expect(page.getByLabel(/username/i)).toBeVisible();
await expect(page.getByLabel(/password/i)).toBeVisible();
});
test('should have submit button', async ({ page }) => {
await navigateToLogin(page);
// Check for login button
await expect(page.getByRole('button', { name: /login|sign in/i })).toBeVisible();
});
});