Files
clg-kit/e2e/app.spec.ts
Aditya Gupta 87b07728b5 feat: unify app navigation and add today attendance overview
- Replace floating pill tab dock with a full-width system-aligned navigation bar.
- Give active tabs cobalt icon chips and clean cobalt labels while keeping inactive tabs muted.
- Add compact live attendance summary above the day picker on Today.
- Add Playwright verification for the new metrics and navigation surface.
2026-09-05 09:56:55 +05:30

71 lines
2.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test, expect } from '@playwright/test';
test.describe('College Kit E2E & Visual Verification', () => {
test.beforeEach(async ({ page }) => {
// Ensure profile is setup so we are on the main tabs
await page.request.put('http://localhost:4000/api/v1/profile', {
data: {
name: 'Sam Taylor',
college: 'Northbridge University',
programme: 'B.Tech Computer Science',
semester: 'Semester 3',
},
});
});
test('Today screen loads with date, week strip, and classes', async ({ page }) => {
await page.goto('/');
await expect(page.locator('text=Todays classes')).toBeVisible();
await expect(page.getByRole('button', { name: 'Timetable' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Attendance' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Settings' })).toBeVisible();
});
test('Navigation between all bottom tabs works smoothly', async ({ page }) => {
await page.goto('/');
// Navigate to Timetable
await page.locator('text=Timetable').click();
await expect(page.locator('text=Week of')).toBeVisible();
// Navigate to Attendance
await page.getByRole('button', { name: 'Attendance' }).click();
await expect(page.locator('text=By subject')).toBeVisible();
await expect(page.locator('text=Classes held')).toBeVisible();
// Navigate to Settings
await page.getByRole('button', { name: 'Settings' }).click();
await expect(page.locator('text=Shape your class day')).toBeVisible();
await expect(page.locator('text=Default class length')).toBeVisible();
// Navigate back to Today
await page.getByRole('button', { name: 'Today' }).click();
await expect(page.locator('text=classes').first()).toBeVisible();
});
test('Account screen displays profile information correctly', async ({ page }) => {
await page.goto('/account');
await expect(page.locator('text=Sam Taylor')).toBeVisible();
await expect(page.getByText('Northbridge University').first()).toBeVisible();
await expect(page.locator('text=B.Tech Computer Science')).toBeVisible();
});
test('Subject Details screen loads subject metrics', async ({ page }) => {
// Get subjects list
const subjectsRes = await page.request.get('http://localhost:4000/api/v1/subjects');
const subjects = await subjectsRes.json();
if (subjects.length > 0) {
await page.goto(`/subjects/${subjects[0].id}`);
await expect(page.locator('text=Subject details')).toBeVisible();
await expect(page.locator('text=Recent classes')).toBeVisible();
}
});
test('Settings can be updated and saved', async ({ page }) => {
await page.goto('/settings');
await expect(page.locator('text=Save settings')).toBeVisible();
await page.locator('text=Save settings').click();
await expect(page.locator('text=Settings saved')).toBeVisible();
});
});