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