debug(clazz-e2e): add page state debugging for CI view-toolbar failure
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,19 @@ test.describe('排课双视图切换(阿难账号)', () => {
|
||||
await expect(page.locator('#app')).toBeVisible({ timeout: 60_000 });
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
// Debug: capture page state before assertion
|
||||
const debugUrl = page.url();
|
||||
console.log(`[debug] URL after login+goto: ${debugUrl}`);
|
||||
const pageTitle = await page.title().catch(() => 'N/A');
|
||||
console.log(`[debug] Page title: ${pageTitle}`);
|
||||
const bodyText = await page.evaluate(() => document.body?.innerText?.substring(0, 500) || 'no body');
|
||||
console.log(`[debug] Body text (first 500): ${bodyText.replace(/\n/g, '↵')}`);
|
||||
const appHtml = await page.evaluate(() => {
|
||||
const app = document.getElementById('app');
|
||||
return app ? app.innerHTML.substring(0, 800) : 'no #app';
|
||||
});
|
||||
console.log(`[debug] #app innerHTML (first 800): ${appHtml}`);
|
||||
|
||||
// Check toggle buttons exist
|
||||
const toggleBar = page.locator('.view-toolbar');
|
||||
await expect(toggleBar).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
Reference in New Issue
Block a user