diff --git a/tests/clazz-dual-view.spec.ts b/tests/clazz-dual-view.spec.ts index 5f9229e..99b3f6f 100644 --- a/tests/clazz-dual-view.spec.ts +++ b/tests/clazz-dual-view.spec.ts @@ -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 });