Files
kokken/force-refresh-test.spec.ts
Alex Polo cbc1e31440 feat: Add address column and booking extras to bookings table
- Implemented a script to add an 'address' column to the 'bookings' table if it doesn't exist.
- Created a script to add 'include_service', 'include_cleanup', and 'total_price' columns to the 'bookings' table.
- Set up a 'users' table with an admin user and password hashing using bcrypt.
- Developed login and logout API routes with JWT authentication.
- Created a login page with form handling and error display.
- Designed a profile page for Christian Wärme showcasing skills and experience.
- Added a logout button component for admin interface.
- Implemented tests for login functionality and visual calendar layout.
2025-11-07 10:58:19 +01:00

40 lines
1.3 KiB
TypeScript

import { test } from '@playwright/test';
test('Force browser refresh and check cache', async ({ page }) => {
// Set basic auth header
await page.setExtraHTTPHeaders({
'Authorization': 'Basic ' + Buffer.from('brotha:makefood1').toString('base64')
});
// Force hard reload
await page.goto('http://localhost:3000/admin/availability', {
waitUntil: 'networkidle'
});
// Bypass cache
await page.reload({ waitUntil: 'networkidle' });
await page.waitForSelector('.cook-calendar');
await page.waitForTimeout(3000);
// Take screenshot
await page.screenshot({ path: 'current-calendar.png', fullPage: true });
// Check if there are any console errors
const logs = [];
page.on('console', msg => {
logs.push(`${msg.type()}: ${msg.text()}`);
});
// Reload one more time and check
await page.reload({ waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
const tableHTML = await page.locator('.cook-calendar table').innerHTML();
console.log('Table HTML (first 500 chars):');
console.log(tableHTML.substring(0, 500) + '...');
// Check actual layout one more time
const firstRowCells = await page.locator('.cook-calendar tbody tr:first-child td button').allTextContents();
console.log('After hard refresh - First row:', firstRowCells);
});