feat(web): Playwright E2E test suite for critical paths (#152)
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #152.
This commit is contained in:
56
apps/web/e2e/settings.spec.ts
Normal file
56
apps/web/e2e/settings.spec.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { loginAs, TEST_USER } from './helpers/auth.js';
|
||||
|
||||
test.describe('Settings page', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await loginAs(page, TEST_USER.email, TEST_USER.password);
|
||||
const url = page.url();
|
||||
test.skip(!url.includes('/chat'), 'No seeded test user — skipping authenticated tests');
|
||||
});
|
||||
|
||||
test('settings page loads with heading', async ({ page }) => {
|
||||
await page.goto('/settings');
|
||||
await expect(page.getByRole('heading', { name: /^settings$/i })).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
});
|
||||
|
||||
test('shows the four settings tabs', async ({ page }) => {
|
||||
await page.goto('/settings');
|
||||
await expect(page.getByRole('button', { name: /profile/i })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: /appearance/i })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: /notifications/i })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: /providers/i })).toBeVisible();
|
||||
});
|
||||
|
||||
test('profile tab is active by default', async ({ page }) => {
|
||||
await page.goto('/settings');
|
||||
await expect(page.getByRole('heading', { name: /^profile$/i })).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
});
|
||||
|
||||
test('clicking Appearance tab switches content', async ({ page }) => {
|
||||
await page.goto('/settings');
|
||||
await page.getByRole('button', { name: /appearance/i }).click();
|
||||
await expect(page.getByRole('heading', { name: /appearance/i })).toBeVisible({
|
||||
timeout: 5_000,
|
||||
});
|
||||
});
|
||||
|
||||
test('clicking Notifications tab switches content', async ({ page }) => {
|
||||
await page.goto('/settings');
|
||||
await page.getByRole('button', { name: /notifications/i }).click();
|
||||
await expect(page.getByRole('heading', { name: /notifications/i })).toBeVisible({
|
||||
timeout: 5_000,
|
||||
});
|
||||
});
|
||||
|
||||
test('clicking Providers tab switches content', async ({ page }) => {
|
||||
await page.goto('/settings');
|
||||
await page.getByRole('button', { name: /providers/i }).click();
|
||||
await expect(page.getByRole('heading', { name: /llm providers/i })).toBeVisible({
|
||||
timeout: 5_000,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user