同步新版首页文案关键词并更新测试以匹配 v2/v3 视觉改版;部署脚本增加未同步改动保护

这个提交包含在:
wikiboss
2026-11-05 15:13:22 +08:00
父节点 77495769c4
当前提交 96a3f8b672
共有 9 个文件被更改,包括 175 次插入 和 119 次删除

查看文件

@@ -1,17 +1,15 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
站点配图与视觉丰富度自动化测试 (TDD)
验证:
1. 所有核心配图资产物理存在、非空且格式正确
2. PC 首页与移动端首页正确展示服务、产品、案例等丰富配图
3. 独立服务页、产品页、案例页包含深度高保真系统与业务界面配图
4. 关于我们页面包含专家徽章与资质认证图
4. 关于我们页面包含专家团队专业徽标与资质认证图
5. CSS 针对配图有严格的响应式(max-width: 100%、圆角、细线边框、悬停微光)控制
6. 无破损路径或 404 资源引用
"""
import os
import re
import unittest
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -62,35 +60,35 @@ class SiteImagesTest(unittest.TestCase):
self.assertGreater(size, 100, f"图片文件 {img_name} 大小不能过小")
def test_02_pc_and_mobile_homepage_service_images(self):
"""首页服务卡片必须包含对应的服务系统配图"""
with open(self.pc_home_path, 'r', encoding='utf-8') as f:
"""首页服务入口必须包含三个一致的服务视觉卡片"""
with open(self.pc_home_path, encoding='utf-8') as f:
pc_content = f.read()
with open(self.mobile_home_path, 'r', encoding='utf-8') as f:
with open(self.mobile_home_path, encoding='utf-8') as f:
mobile_content = f.read()
for content, page_name in [(pc_content, "PC 首页"), (mobile_content, "移动端首页")]:
self.assertIn('service_middle.svg', content, f"{page_name} 应包含软件中台服务配图")
self.assertIn('service_app.svg', content, f"{page_name} 应包含APP小程序定制服务配图")
self.assertIn('service_agent.svg', content, f"{page_name} 应包含智能体定制服务配图")
self.assertEqual(content.count('hn-service-top'), 3, f"{page_name} 应包含三个服务视觉卡片")
for service_name in ['软件开发', 'APP与小程序定制', '智能体开发']:
self.assertIn(service_name, content, f"{page_name} 应包含服务入口:{service_name}")
def test_03_pc_and_mobile_homepage_product_images(self):
"""首页产品卡片必须包含产品界面示意配图"""
with open(self.pc_home_path, 'r', encoding='utf-8') as f:
"""首页产品区必须包含经营工作台示意与四类产品入口"""
with open(self.pc_home_path, encoding='utf-8') as f:
pc_content = f.read()
with open(self.mobile_home_path, 'r', encoding='utf-8') as f:
with open(self.mobile_home_path, encoding='utf-8') as f:
mobile_content = f.read()
for content, page_name in [(pc_content, "PC 首页"), (mobile_content, "移动端首页")]:
self.assertIn('product_mall.svg', content, f"{page_name} 应包含商城产品配图")
self.assertIn('product_pos.svg', content, f"{page_name} 应包含收银产品配图")
self.assertIn('product_erp.svg', content, f"{page_name} 应包含进销存产品配图")
self.assertIn('product_saas.svg', content, f"{page_name} 应包含SaaS产品配图")
self.assertIn('hn-app-window', content, f"{page_name} 应包含经营工作台界面示意")
self.assertIn('hn-chart', content, f"{page_name} 应包含经营趋势示意")
for product_name in ['商城', '收银', '进销存', 'SaaS版本']:
self.assertIn(product_name, content, f"{page_name} 应包含产品入口:{product_name}")
def test_04_cases_pages_have_preview_images(self):
"""标杆案例卡片必须配有真实的业务系统视窗图"""
with open(self.case_page_path, 'r', encoding='utf-8') as f:
with open(self.case_page_path, encoding='utf-8') as f:
case_pc = f.read()
with open(self.case_mobile_path, 'r', encoding='utf-8') as f:
with open(self.case_mobile_path, encoding='utf-8') as f:
case_mobile = f.read()
for content, page_name in [(case_pc, "PC 案例独立页"), (case_mobile, "移动端案例独立页")]:
@@ -101,9 +99,9 @@ class SiteImagesTest(unittest.TestCase):
def test_05_service_and_product_pages_have_showcases(self):
"""独立服务页与产品页必须嵌入高质量系统拓扑与界面大图"""
with open(self.service_page_path, 'r', encoding='utf-8') as f:
with open(self.service_page_path, encoding='utf-8') as f:
service_content = f.read()
with open(self.product_page_path, 'r', encoding='utf-8') as f:
with open(self.product_page_path, encoding='utf-8') as f:
product_content = f.read()
self.assertIn('service_middle.svg', service_content)
@@ -117,9 +115,9 @@ class SiteImagesTest(unittest.TestCase):
def test_06_about_pages_have_expert_and_cert_badges(self):
"""关于我们页必须包含专家团队专业徽标与资质认证图"""
with open(self.about_page_path, 'r', encoding='utf-8') as f:
with open(self.about_page_path, encoding='utf-8') as f:
about_pc = f.read()
with open(self.about_mobile_path, 'r', encoding='utf-8') as f:
with open(self.about_mobile_path, encoding='utf-8') as f:
about_mobile = f.read()
for content, page_name in [(about_pc, "PC 关于我们页"), (about_mobile, "移动端关于我们页")]:
@@ -132,7 +130,7 @@ class SiteImagesTest(unittest.TestCase):
def test_07_responsive_image_styles_in_css(self):
"""CSS 必须具备严谨的配图自适应与质感样式定义"""
with open(self.css_path, 'r', encoding='utf-8') as f:
with open(self.css_path, encoding='utf-8') as f:
css = f.read()
self.assertIn('.nhc-card-thumb', css, "CSS 应定义 .nhc-card-thumb 图片容器类")