Some checks failed
Deploy / deploy (push) Has been cancelled
Full-stack web application for Telegram management - Frontend: Vue 3 + Vben Admin - Backend: NestJS - Features: User management, group broadcast, statistics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test('调试登录页面', async ({ page }) => {
|
|
// 访问登录页面
|
|
await page.goto('http://localhost:5174');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// 截图查看页面内容
|
|
await page.screenshot({
|
|
path: 'test-results/screenshots/debug-login-page.png',
|
|
fullPage: true,
|
|
});
|
|
|
|
console.log('当前页面URL:', page.url());
|
|
console.log('页面标题:', await page.title());
|
|
|
|
// 查找所有输入框
|
|
const inputs = await page.locator('input').all();
|
|
console.log(`找到 ${inputs.length} 个输入框`);
|
|
|
|
for (let i = 0; i < inputs.length; i++) {
|
|
const input = inputs[i];
|
|
const placeholder = await input.getAttribute('placeholder');
|
|
const type = await input.getAttribute('type');
|
|
const name = await input.getAttribute('name');
|
|
console.log(
|
|
`输入框 ${i + 1}: placeholder="${placeholder}", type="${type}", name="${name}"`,
|
|
);
|
|
}
|
|
|
|
// 查找登录相关的按钮
|
|
const buttons = await page.locator('button').all();
|
|
console.log(`找到 ${buttons.length} 个按钮`);
|
|
|
|
for (let i = 0; i < buttons.length; i++) {
|
|
const button = buttons[i];
|
|
const text = await button.textContent();
|
|
const type = await button.getAttribute('type');
|
|
console.log(`按钮 ${i + 1}: text="${text}", type="${type}"`);
|
|
}
|
|
|
|
// 检查页面内容
|
|
const pageContent = await page.content();
|
|
console.log(
|
|
'页面是否包含登录相关内容:',
|
|
pageContent.includes('登录') ||
|
|
pageContent.includes('用户名') ||
|
|
pageContent.includes('密码'),
|
|
);
|
|
});
|