|
|
|
|
@@ -23,6 +23,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should display welcome header with user name', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Check for welcome message
|
|
|
|
|
@@ -32,6 +33,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should display quick stats cards', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Check for stats cards
|
|
|
|
|
@@ -43,6 +45,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should display recent projects section', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Check recent projects heading
|
|
|
|
|
@@ -56,6 +59,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should navigate to projects page when clicking View all', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Click view all link
|
|
|
|
|
@@ -68,6 +72,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should have Create Project button', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Check for create project button
|
|
|
|
|
@@ -77,6 +82,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should display pending approvals when they exist', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Check for pending approvals section
|
|
|
|
|
@@ -87,6 +93,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should have accessible heading hierarchy', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Check for h1 (welcome message)
|
|
|
|
|
@@ -100,6 +107,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
test('should be keyboard navigable', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Tab through the page elements
|
|
|
|
|
@@ -115,6 +123,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
await page.setViewportSize({ width: 375, height: 667 });
|
|
|
|
|
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Page should still be functional on mobile
|
|
|
|
|
@@ -127,6 +136,7 @@ test.describe('Main Dashboard Page', () => {
|
|
|
|
|
|
|
|
|
|
// Measure navigation timing
|
|
|
|
|
const start = Date.now();
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
const duration = Date.now() - start;
|
|
|
|
|
|
|
|
|
|
@@ -144,6 +154,7 @@ test.describe('Main Dashboard Empty State', () => {
|
|
|
|
|
// This tests the empty state path - in demo mode we have mock data
|
|
|
|
|
// so we check for the empty state component being available
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// In demo mode we always have projects, but the empty state exists
|
|
|
|
|
@@ -160,6 +171,7 @@ test.describe('Main Dashboard Stats Interaction', () => {
|
|
|
|
|
|
|
|
|
|
test('should display stats with numeric values', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Stats should show numbers
|
|
|
|
|
@@ -169,6 +181,7 @@ test.describe('Main Dashboard Stats Interaction', () => {
|
|
|
|
|
|
|
|
|
|
test('should make stats cards clickable where appropriate', async ({ page }) => {
|
|
|
|
|
await loginViaUI(page);
|
|
|
|
|
await page.goto('/en/dashboard');
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
|
|
|
|
|
|
// Active Projects stat should link to projects
|
|
|
|
|
|