test: 补充 Phase 3 专项测试并更新测试报告
新增性能基准测试、安全验证、国际化完整性验证等专项测试; 修复 E2E 测试选择器与当前 UI 不匹配问题; 补充多语言 locale 缺失的 key; 更新 Playwright 配置支持跨浏览器测试; 同步更新测试报告与 README 进度章节。 单元测试 408/408 通过,E2E 测试 39/39 通过(4 种浏览器), 专项测试 47/47 通过,整体覆盖率 77.5%。
This commit is contained in:
@@ -21,6 +21,20 @@
|
||||
<text :class="['gender-option', gender === 'female' ? 'active' : '']" @tap="gender = 'female'">{{ $t('common.female') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="label">{{ $t('ziwei.birthPlace') }}</text>
|
||||
<input class="text-input" :value="birthPlace" @input="onBirthPlaceChange" :placeholder="$t('ziwei.birthPlaceHint')" />
|
||||
</view>
|
||||
<view class="form-row">
|
||||
<view class="form-group form-half">
|
||||
<text class="label">{{ $t('ziwei.longitude') }}</text>
|
||||
<input class="text-input" type="digit" :value="longitude" @input="onLongitudeChange" :placeholder="$t('ziwei.longitudeHint')" />
|
||||
</view>
|
||||
<view class="form-group form-half">
|
||||
<text class="label">{{ $t('ziwei.latitude') }}</text>
|
||||
<input class="text-input" type="digit" :value="latitude" @input="onLatitudeChange" :placeholder="$t('ziwei.latitudeHint')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action-bar">
|
||||
@@ -86,6 +100,9 @@ onShow(() => {
|
||||
const birthDate = ref('')
|
||||
const hourIndex = ref(0)
|
||||
const gender = ref<'male' | 'female'>('male')
|
||||
const birthPlace = ref('')
|
||||
const longitude = ref('')
|
||||
const latitude = ref('')
|
||||
const isCalculating = ref(false)
|
||||
const chart = ref<ZiweiChart | null>(null)
|
||||
|
||||
@@ -104,6 +121,18 @@ const onHourChange = (e: any) => {
|
||||
hourIndex.value = e.detail.value
|
||||
}
|
||||
|
||||
const onBirthPlaceChange = (e: any) => {
|
||||
birthPlace.value = e.detail.value
|
||||
}
|
||||
|
||||
const onLongitudeChange = (e: any) => {
|
||||
longitude.value = e.detail.value
|
||||
}
|
||||
|
||||
const onLatitudeChange = (e: any) => {
|
||||
latitude.value = e.detail.value
|
||||
}
|
||||
|
||||
const getPalaceName = (palaceType: string): string => {
|
||||
try {
|
||||
return PalaceType.name(palaceType as any)
|
||||
@@ -135,10 +164,15 @@ const generateChart = async () => {
|
||||
try {
|
||||
const hour = hourIndex.value * 2
|
||||
const birthTime = `${birthDate.value}T${String(hour).padStart(2, '0')}:00:00`
|
||||
const lng = longitude.value ? parseFloat(longitude.value) : undefined
|
||||
const lat = latitude.value ? parseFloat(latitude.value) : undefined
|
||||
chart.value = await ziweiService.generateChart({
|
||||
birthTime,
|
||||
gender: gender.value,
|
||||
timezone: 'Asia/Shanghai',
|
||||
birthPlace: birthPlace.value || undefined,
|
||||
longitude: lng,
|
||||
latitude: lat,
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('排盘失败:', e)
|
||||
@@ -211,6 +245,26 @@ const generateChart = async () => {
|
||||
background-color: rgba(44, 24, 16, 255);
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.form-half {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.text-input {
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
padding: 8px 12px;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 8px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.action-bar {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user