talent-login-detail.spec.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { test, expect } from '@playwright/test';
  2. test('人才小程序登录页面详细检查', async ({ page }) => {
  3. await page.goto('http://localhost:10087/pages/login/index.html');
  4. await page.waitForTimeout(3000);
  5. const pageText = await page.textContent('body');
  6. console.log('=== 登录页面检查 ===');
  7. console.log('页面标题:', await page.title());
  8. const hasLoginTitle = pageText?.includes('人才登录') || pageText?.includes('人才服务平台');
  9. console.log('是否有登录标题:', hasLoginTitle ? '是' : '否');
  10. const hasAgreement = pageText?.includes('用户协议') || pageText?.includes('隐私政策');
  11. console.log('是否包含协议文字:', hasAgreement ? '是 ⚠️' : '否 ✓');
  12. const bottomContent = await page.evaluate(() => {
  13. const allText = document.body.innerText;
  14. const lines = allText.split('\n').filter(line => line.trim());
  15. return {
  16. lastLines: lines.slice(-5)
  17. };
  18. });
  19. console.log('\n页面最后几行内容:');
  20. bottomContent.lastLines.forEach((line, idx) => {
  21. console.log(' ' + (idx + 1) + ': ' + line);
  22. });
  23. if (hasAgreement) {
  24. console.log('\n⚠️ 页面上发现协议相关文字');
  25. } else {
  26. console.log('\n✓ 登录页面没有协议文字');
  27. }
  28. });