feat: implement Save & Taste flow in CameraCapture
This commit is contained in:
15
tests/e2e/auth.test.ts
Normal file
15
tests/e2e/auth.test.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Authentication', () => {
|
||||
test('should show error on invalid login', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
await page.getByPlaceholder('name@beispiel.de').fill('wrong@example.com');
|
||||
await page.getByPlaceholder('••••••••').fill('wrongpassword');
|
||||
await page.getByRole('button', { name: 'Einloggen' }).click();
|
||||
|
||||
// Expect error message
|
||||
// Note: This content depends on Supabase error message
|
||||
await expect(page.locator('div:has-text("Invalid login credentials")')).toBeVisible();
|
||||
});
|
||||
});
|
||||
22
tests/e2e/collection.test.ts
Normal file
22
tests/e2e/collection.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Collection View', () => {
|
||||
test('should show empty state message if no bottles found', async ({ page }) => {
|
||||
// This test assumes a clean or specific state.
|
||||
// In a real environment, we'd use a test user with 0 bottles.
|
||||
await page.goto('/');
|
||||
|
||||
// If we can't control the user, we at least check that we don't see the technical error message
|
||||
const errorBox = page.locator('text=Hoppla');
|
||||
await expect(errorBox).not.toBeVisible();
|
||||
|
||||
// Check for either the grid or the empty state message
|
||||
const emptyMessage = page.locator('text=Noch keine Flaschen im Vault');
|
||||
const bottleGrid = page.locator('.grid');
|
||||
|
||||
const isGridVisible = await bottleGrid.isVisible();
|
||||
if (!isGridVisible) {
|
||||
await expect(emptyMessage).toBeVisible();
|
||||
}
|
||||
});
|
||||
});
|
||||
12
tests/e2e/landing.test.ts
Normal file
12
tests/e2e/landing.test.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('has title and login form', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
// Expect a title "to contain" a substring.
|
||||
await expect(page.locator('h1')).toContainText('WHISKYVAULT');
|
||||
|
||||
// Expect login form to be visible
|
||||
await expect(page.getByPlaceholder('name@beispiel.de')).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Einloggen' })).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user