temp-check.spec.ts 1007 B

123456789101112131415161718192021222324
  1. import { test, expect } from '@playwright/test';
  2. test('检查人才小程序登录页面', async ({ page }) => {
  3. await page.goto('http://localhost:10087');
  4. await page.waitForTimeout(3000);
  5. const pageText = await page.textContent('body');
  6. console.log('=== 页面检查结果 ===');
  7. console.log('是否包含"用户协议":', pageText?.includes('用户协议') ? '是 ⚠️' : '否 ✓');
  8. console.log('是否包含"隐私政策":', pageText?.includes('隐私政策') ? '是 ⚠️' : '否 ✓');
  9. if (pageText?.includes('用户协议') || pageText?.includes('隐私政策')) {
  10. console.log('\n⚠️ 页面上仍显示协议文字,需要重启服务器!');
  11. } else {
  12. console.log('\n✓ 页面上没有协议文字');
  13. }
  14. // 获取页面源码片段
  15. const bodyHTML = await page.evaluate(() => document.body.innerHTML);
  16. if (bodyHTML.includes('用户协议') || bodyHTML.includes('隐私政策')) {
  17. console.log('⚠️ HTML 中发现协议相关文字');
  18. }
  19. });