- 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.
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { test } from '@playwright/test';
|
|
|
|
test('Debug login form behavior', async ({ page }) => {
|
|
// Capture console messages
|
|
const messages: string[] = [];
|
|
page.on('console', msg => {
|
|
messages.push(`${msg.type()}: ${msg.text()}`);
|
|
});
|
|
|
|
// Go to login page
|
|
await page.goto('http://localhost:3000/login');
|
|
|
|
// Fill form
|
|
await page.fill('#username', 'brotha');
|
|
await page.fill('#password', 'makefood1');
|
|
|
|
// Submit form
|
|
await page.click('button[type="submit"]');
|
|
|
|
// Wait a bit
|
|
await page.waitForTimeout(3000);
|
|
|
|
// Check current URL
|
|
const currentUrl = page.url();
|
|
console.log('Current URL after login:', currentUrl);
|
|
|
|
// Print console messages
|
|
console.log('Console messages:');
|
|
messages.forEach(msg => console.log(' ', msg));
|
|
|
|
// Check if there are any error messages on page
|
|
const errorMessage = await page.locator('[class*="red"]').textContent();
|
|
if (errorMessage) {
|
|
console.log('Error message on page:', errorMessage);
|
|
}
|
|
|
|
// Check localStorage
|
|
const authToken = await page.evaluate(() => localStorage.getItem('authToken'));
|
|
console.log('Auth token in localStorage:', authToken ? 'Present' : 'Missing');
|
|
}); |