- Implemented tests for debugging browser cache vs server response. - Verified calendar displays correct dates for November 2025. - Added visual inspection screenshot for calendar layout. - Created tests to ensure calendar fits within its container. - Checked for correct styling of available and blocked dates. - Debugged login form behavior and cookie handling. - Added tests for forced browser refresh and cache verification. - Conducted visual tests to compare actual calendar layout with expected. - Enhanced logging for better traceability during test execution.
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { test } from '@playwright/test';
|
|
|
|
test('Check cookie and redirect after login', async ({ page }) => {
|
|
// Go to login page
|
|
await page.goto('http://localhost:3000/login');
|
|
|
|
// Fill and submit form
|
|
await page.fill('#username', 'brotha');
|
|
await page.fill('#password', 'makefood1');
|
|
await page.click('button[type="submit"]');
|
|
|
|
// Wait for response
|
|
await page.waitForTimeout(2000);
|
|
|
|
// Check cookies
|
|
const cookies = await page.context().cookies();
|
|
const authCookie = cookies.find(c => c.name === 'authToken');
|
|
|
|
console.log('Auth cookie:', authCookie ? 'Present' : 'Missing');
|
|
if (authCookie) {
|
|
console.log('Cookie value length:', authCookie.value.length);
|
|
console.log('Cookie secure:', authCookie.secure);
|
|
console.log('Cookie httpOnly:', authCookie.httpOnly);
|
|
}
|
|
|
|
// Try to navigate to admin manually
|
|
console.log('Trying to navigate to /admin...');
|
|
await page.goto('http://localhost:3000/admin');
|
|
await page.waitForTimeout(1000);
|
|
|
|
const finalUrl = page.url();
|
|
console.log('Final URL:', finalUrl);
|
|
|
|
if (finalUrl.includes('/login')) {
|
|
console.log('❌ Redirected back to login - middleware issue');
|
|
} else if (finalUrl.includes('/admin')) {
|
|
console.log('✅ Successfully accessed admin');
|
|
}
|
|
}); |