export interface TestStep {
action: string;
checkpoint: string;
}
export interface TestCase {
id: string;
title: string;
level: string;
moduleCode: string;
moduleName: string;
preconditions: string;
testSteps: TestStep[];
expectedResult: string;
postconditions: string;
}
export interface Module {
code: string;
name: string;
testCases: TestCase[];
}
export const modules: Module[] = [
{
"code": "F-01",
"name": "系统音量读取",
"testCases": [
{
"id": "F01-001",
"title": "能读取系统音量并显示归一化值及各音频流字段",
"level": "L0",
"moduleCode": "F-01",
"moduleName": "系统音量读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【系统音量读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【能读取系统音量并显示归一化值及各音频流字段】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【获取系统音量】按钮 (API: getVolume)",
"checkpoint": "【音量结果】区域开始刷新"
},
{
"action": "等待【音量结果】区域显示数值",
"checkpoint": "【音量结果】区域显示音量数值"
},
{
"action": "观察【音量结果】区域",
"checkpoint": "显示主音量归一化值(0-1 区间)及 music、ring、system 等音频流音量"
}
],
"expectedResult": "音量结果区域显示主音量归一化值(介于 0 与 1 之间)及各音频流音量值,数值合理",
"postconditions": ""
},
{
"id": "F01-002",
"title": "系统音量调至最小后读取结果接近 0",
"level": "L1",
"moduleCode": "F-01",
"moduleName": "系统音量读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【系统音量读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【系统音量调至最小后读取结果接近 0】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "通过系统【设置】将设备音量调至最小",
"checkpoint": "设备音量处于最小状态"
},
{
"action": "点击【获取系统音量】按钮 (API: getVolume)",
"checkpoint": "【音量结果】区域刷新"
},
{
"action": "观察【音量结果】区域",
"checkpoint": "音量值接近 0"
}
],
"expectedResult": "音量结果区域显示音量值接近 0(设备处于静音状态)",
"postconditions": ""
},
{
"id": "F01-003",
"title": "系统音量调至最大后读取结果接近 1",
"level": "L1",
"moduleCode": "F-01",
"moduleName": "系统音量读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【系统音量读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【系统音量调至最大后读取结果接近 1】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "通过系统【设置】将设备音量调至最大",
"checkpoint": "设备音量处于最大状态"
},
{
"action": "点击【获取系统音量】按钮 (API: getVolume)",
"checkpoint": "【音量结果】区域刷新"
},
{
"action": "观察【音量结果】区域",
"checkpoint": "音量值接近 1"
}
],
"expectedResult": "音量结果区域显示音量值接近 1(设备处于满音量状态)",
"postconditions": ""
}
]
},
{
"code": "F-02",
"name": "系统音量变化监听",
"testCases": [
{
"id": "F02-001",
"title": "调节系统音量时能收到音量变化通知",
"level": "L0",
"moduleCode": "F-02",
"moduleName": "系统音量变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【系统音量变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【调节系统音量时能收到音量变化通知】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【启动音量监听】按钮 (API: addVolumeListener)",
"checkpoint": "【监听状态】开始切换为“监听中”"
},
{
"action": "等待【监听状态】显示为“监听中”",
"checkpoint": "音量监听已开启"
},
{
"action": "调节设备系统音量",
"checkpoint": "系统音量发生变化"
},
{
"action": "观察【音量事件】区域",
"checkpoint": "显示音量变化通知,负载包含音量值与音频流类型"
}
],
"expectedResult": "音量事件区域显示音量变化通知,负载包含 volume 音量值与 type 音频流类型字段",
"postconditions": ""
},
{
"id": "F02-002",
"title": "停止音量监听后不再收到变化通知",
"level": "L1",
"moduleCode": "F-02",
"moduleName": "系统音量变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【系统音量变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【停止音量监听后不再收到变化通知】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【启动音量监听】按钮 (API: addVolumeListener)",
"checkpoint": "音量监听已开启"
},
{
"action": "点击【停止音量监听】按钮 (API: subscription.remove())",
"checkpoint": "【监听状态】显示为“已停止”"
},
{
"action": "调节设备系统音量",
"checkpoint": "系统音量发生变化"
},
{
"action": "观察【音量事件】区域",
"checkpoint": "无新的音量变化通知"
}
],
"expectedResult": "停止监听后调节音量,音量事件区域不再出现新的变化通知",
"postconditions": ""
}
]
},
{
"code": "F-03",
"name": "铃声模式读取",
"testCases": [
{
"id": "F03-001",
"title": "能读取当前铃声模式并显示对应模式值",
"level": "L0",
"moduleCode": "F-03",
"moduleName": "铃声模式读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【能读取当前铃声模式并显示对应模式值】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【获取铃声模式】按钮 (API: getRingerMode)",
"checkpoint": "【铃声模式】区域刷新"
},
{
"action": "观察【铃声模式】区域",
"checkpoint": "显示当前模式值"
}
],
"expectedResult": "铃声模式区域显示当前模式值,为 0(静音)、1(振动)或 2(正常)之一,且与系统当前状态一致",
"postconditions": ""
},
{
"id": "F03-002",
"title": "静音模式下读取铃声模式值为 0",
"level": "L1",
"moduleCode": "F-03",
"moduleName": "铃声模式读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【静音模式下读取铃声模式值为 0】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "通过系统【设置】将铃声模式切换为静音",
"checkpoint": "铃声模式为静音"
},
{
"action": "点击【获取铃声模式】按钮 (API: getRingerMode)",
"checkpoint": "【铃声模式】区域刷新"
},
{
"action": "观察【铃声模式】区域",
"checkpoint": "显示值为 0"
}
],
"expectedResult": "铃声模式区域显示值为 0(silent,静音)",
"postconditions": ""
},
{
"id": "F03-003",
"title": "振动模式下读取铃声模式值为 1",
"level": "L1",
"moduleCode": "F-03",
"moduleName": "铃声模式读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【振动模式下读取铃声模式值为 1】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "通过系统【设置】将铃声模式切换为振动",
"checkpoint": "铃声模式为振动"
},
{
"action": "点击【获取铃声模式】按钮 (API: getRingerMode)",
"checkpoint": "【铃声模式】区域刷新"
},
{
"action": "观察【铃声模式】区域",
"checkpoint": "显示值为 1"
}
],
"expectedResult": "铃声模式区域显示值为 1(vibrate,振动)",
"postconditions": ""
},
{
"id": "F03-004",
"title": "铃声模式切换过渡期读取结果反映稳定模式",
"level": "L2",
"moduleCode": "F-03",
"moduleName": "铃声模式读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【铃声模式切换过渡期读取结果反映稳定模式】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【获取铃声模式】按钮 (API: getRingerMode) 记录当前模式",
"checkpoint": "【铃声模式】区域显示当前模式"
},
{
"action": "通过系统【设置】快速切换铃声模式",
"checkpoint": "铃声模式发生变化"
},
{
"action": "再次点击【获取铃声模式】按钮 (API: getRingerMode)",
"checkpoint": "【铃声模式】区域刷新"
},
{
"action": "观察【铃声模式】区域",
"checkpoint": "显示切换稳定后的模式值,无报错"
}
],
"expectedResult": "模式切换稳定后读取,铃声模式区域显示与系统最终状态一致的模式值,应用不报错",
"postconditions": ""
},
{
"id": "F03-005",
"title": "连续多次读取铃声模式结果稳定一致",
"level": "L2",
"moduleCode": "F-03",
"moduleName": "铃声模式读取",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式读取】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【连续多次读取铃声模式结果稳定一致】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "连续多次点击【获取铃声模式】按钮 (API: getRingerMode)",
"checkpoint": "【铃声模式】区域多次刷新"
},
{
"action": "观察【铃声模式】区域",
"checkpoint": "多次显示的值保持一致"
}
],
"expectedResult": "不改变系统状态下多次读取铃声模式,显示值稳定一致,无异常波动",
"postconditions": ""
}
]
},
{
"code": "F-04",
"name": "设备静音状态查询",
"testCases": [
{
"id": "F04-001",
"title": "静音模式下查询设备静音状态为是",
"level": "L0",
"moduleCode": "F-04",
"moduleName": "设备静音状态查询",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【设备静音状态查询】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【静音模式下查询设备静音状态为是】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "通过系统【设置】将铃声模式切换为静音",
"checkpoint": "铃声模式为静音"
},
{
"action": "点击【查询设备静音状态】按钮 (API: isAndroidDeviceSilent)",
"checkpoint": "【静音状态】区域刷新"
},
{
"action": "观察【静音状态】区域",
"checkpoint": "显示为“是”"
}
],
"expectedResult": "静音状态下查询,静音状态区域显示“是”(设备处于静音)",
"postconditions": ""
},
{
"id": "F04-002",
"title": "正常模式下查询设备静音状态为否",
"level": "L1",
"moduleCode": "F-04",
"moduleName": "设备静音状态查询",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【设备静音状态查询】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【正常模式下查询设备静音状态为否】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "通过系统【设置】将铃声模式切换为正常响铃",
"checkpoint": "铃声模式为正常"
},
{
"action": "点击【查询设备静音状态】按钮 (API: isAndroidDeviceSilent)",
"checkpoint": "【静音状态】区域刷新"
},
{
"action": "观察【静音状态】区域",
"checkpoint": "显示为“否”"
}
],
"expectedResult": "正常模式下查询,静音状态区域显示“否”(设备未静音)",
"postconditions": ""
},
{
"id": "F04-003",
"title": "铃声模式切换瞬间查询静音状态结果一致",
"level": "L2",
"moduleCode": "F-04",
"moduleName": "设备静音状态查询",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【设备静音状态查询】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【铃声模式切换瞬间查询静音状态结果一致】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "通过系统【设置】快速切换铃声模式",
"checkpoint": "铃声模式发生变化"
},
{
"action": "立即点击【查询设备静音状态】按钮 (API: isAndroidDeviceSilent)",
"checkpoint": "【静音状态】区域刷新"
},
{
"action": "观察【静音状态】区域",
"checkpoint": "显示值与切换后铃声模式一致,无报错"
}
],
"expectedResult": "模式切换瞬间查询,静音状态显示与切换后模式一致,应用不报错",
"postconditions": ""
},
{
"id": "F04-004",
"title": "连续多次查询设备静音状态结果稳定一致",
"level": "L2",
"moduleCode": "F-04",
"moduleName": "设备静音状态查询",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【设备静音状态查询】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【连续多次查询设备静音状态结果稳定一致】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "连续多次点击【查询设备静音状态】按钮 (API: isAndroidDeviceSilent)",
"checkpoint": "【静音状态】区域多次刷新"
},
{
"action": "观察【静音状态】区域",
"checkpoint": "多次显示的值保持一致"
}
],
"expectedResult": "不改变系统状态下多次查询静音状态,显示值稳定一致",
"postconditions": ""
}
]
},
{
"code": "F-05",
"name": "铃声模式变化监听",
"testCases": [
{
"id": "F05-001",
"title": "切换铃声模式时能收到模式变化通知",
"level": "L0",
"moduleCode": "F-05",
"moduleName": "铃声模式变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【切换铃声模式时能收到模式变化通知】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【启动铃声监听】按钮 (API: addRingerListener)",
"checkpoint": "【监听状态】开始切换为“监听中”"
},
{
"action": "等待【监听状态】显示为“监听中”",
"checkpoint": "铃声监听已开启"
},
{
"action": "通过系统【设置】切换铃声模式",
"checkpoint": "铃声模式发生变化"
},
{
"action": "观察【铃声事件】区域",
"checkpoint": "显示模式变化通知,负载包含 status 与 mode"
}
],
"expectedResult": "铃声事件区域显示模式变化通知,负载包含 status 布尔值与 mode(SILENT/VIBRATE/NORMAL)字段",
"postconditions": ""
},
{
"id": "F05-002",
"title": "停止铃声监听后不再收到变化通知",
"level": "L1",
"moduleCode": "F-05",
"moduleName": "铃声模式变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【停止铃声监听后不再收到变化通知】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【启动铃声监听】按钮 (API: addRingerListener)",
"checkpoint": "铃声监听已开启"
},
{
"action": "点击【停止铃声监听】按钮 (API: removeRingerListener)",
"checkpoint": "【监听状态】显示为“已停止”"
},
{
"action": "通过系统【设置】切换铃声模式",
"checkpoint": "铃声模式发生变化"
},
{
"action": "观察【铃声事件】区域",
"checkpoint": "无新的模式变化通知"
}
],
"expectedResult": "停止监听后切换模式,铃声事件区域不再出现新的变化通知",
"postconditions": ""
},
{
"id": "F05-003",
"title": "重复开启铃声监听不产生重复通知或崩溃",
"level": "L2",
"moduleCode": "F-05",
"moduleName": "铃声模式变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【重复开启铃声监听不产生重复通知或崩溃】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "连续多次点击【启动铃声监听】按钮 (API: addRingerListener)",
"checkpoint": "多次开启铃声监听"
},
{
"action": "通过系统【设置】切换铃声模式",
"checkpoint": "铃声模式发生变化"
},
{
"action": "观察【铃声事件】区域",
"checkpoint": "每次模式变化仅显示一条通知,应用运行正常"
}
],
"expectedResult": "重复开启监听后,每次模式变化仅触发一条通知,无重复通知,应用运行正常不崩溃",
"postconditions": ""
},
{
"id": "F05-004",
"title": "停止后重新开启铃声监听恢复正常通知",
"level": "L2",
"moduleCode": "F-05",
"moduleName": "铃声模式变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【停止后重新开启铃声监听恢复正常通知】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【启动铃声监听】按钮 (API: addRingerListener)",
"checkpoint": "铃声监听已开启"
},
{
"action": "点击【停止铃声监听】按钮 (API: removeRingerListener)",
"checkpoint": "铃声监听已停止"
},
{
"action": "再次点击【启动铃声监听】按钮 (API: addRingerListener)",
"checkpoint": "铃声监听重新开启"
},
{
"action": "通过系统【设置】切换铃声模式",
"checkpoint": "铃声模式发生变化"
},
{
"action": "观察【铃声事件】区域",
"checkpoint": "正常显示模式变化通知"
}
],
"expectedResult": "停止后重新开启监听,切换模式时能正常收到变化通知",
"postconditions": ""
},
{
"id": "F05-005",
"title": "快速连续切换铃声模式每次均收到通知",
"level": "L2",
"moduleCode": "F-05",
"moduleName": "铃声模式变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【快速连续切换铃声模式每次均收到通知】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【启动铃声监听】按钮 (API: addRingerListener)",
"checkpoint": "铃声监听已开启"
},
{
"action": "快速连续多次切换系统铃声模式",
"checkpoint": "铃声模式多次变化"
},
{
"action": "观察【铃声事件】区域",
"checkpoint": "每次切换均显示对应通知"
}
],
"expectedResult": "快速连续切换模式,每次切换都能收到对应的变化通知,无遗漏",
"postconditions": ""
},
{
"id": "F05-006",
"title": "静音开关兼容监听返回铃声静音状态",
"level": "L1",
"moduleCode": "F-05",
"moduleName": "铃声模式变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【静音开关兼容监听返回铃声静音状态】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【启动静音兼容监听】按钮 (API: addSilentListener)",
"checkpoint": "真实查询当前静音状态并建立铃声模式监听"
},
{
"action": "观察【静音兼容事件】区域",
"checkpoint": "首次事件包含 isMuted 布尔值与 initialQuery=true"
},
{
"action": "切换系统铃声模式后再次观察事件",
"checkpoint": "新增事件 initialQuery=false,isMuted 与铃声/媒体静音状态一致"
}
],
"expectedResult": "addSilentListener 返回真实的铃声/媒体静音兼容事件,并明确不代表 iOS 物理静音开关",
"postconditions": "停止静音兼容监听"
},
{
"id": "F05-007",
"title": "useSilentSwitch 随铃声模式变化更新兼容状态",
"level": "L1",
"moduleCode": "F-05",
"moduleName": "铃声模式变化监听",
"preconditions": "应用已启动",
"testSteps": [
{
"action": "点击【铃声模式变化监听】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【useSilentSwitch 随铃声模式变化更新兼容状态】进入用例详情页",
"checkpoint": "Hook 已挂载并开始监听"
},
{
"action": "观察【Hook 静音兼容状态】区域",
"checkpoint": "显示 isMuted 与 initialQuery 初始值"
},
{
"action": "通过系统设置切换铃声模式",
"checkpoint": "系统铃声模式发生变化"
},
{
"action": "再次观察【Hook 静音兼容状态】区域",
"checkpoint": "isMuted 随真实铃声/媒体静音状态更新"
}
],
"expectedResult": "useSilentSwitch 在 HarmonyOS 返回并持续更新兼容静音状态,页面明确标注非物理开关",
"postconditions": "退出页面时自动释放监听"
}
]
},
{
"code": "F-06",
"name": "音频会话与音量面板",
"testCases": [
{
"id": "F06-001",
"title": "激活与停用 HarmonyOS 音频会话",
"level": "L0",
"moduleCode": "F-06",
"moduleName": "音频会话与音量面板",
"preconditions": "应用已启动,设备为 HarmonyOS API20+",
"testSteps": [
{
"action": "点击【音频会话与音量面板】进入模块列表页",
"checkpoint": "成功进入模块列表页"
},
{
"action": "点击【激活与停用 HarmonyOS 音频会话】进入用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【enable(true)】按钮",
"checkpoint": "activateAudioSession 使用混音策略成功完成"
},
{
"action": "点击【setActive(false)】按钮",
"checkpoint": "deactivateAudioSession 成功完成"
},
{
"action": "观察【执行结果】区域",
"checkpoint": "每次真实原生调用完成后显示成功,错误路径显示失败原因"
}
],
"expectedResult": "enable/setActive 真实激活和停用 HarmonyOS 应用音频会话,不再是 no-op",
"postconditions": "音频会话处于停用状态"
},
{
"id": "F06-002",
"title": "音频类别映射为混音并发策略",
"level": "L1",
"moduleCode": "F-06",
"moduleName": "音频会话与音量面板",
"preconditions": "应用已启动,设备为 HarmonyOS API20+",
"testSteps": [
{
"action": "进入【音频类别映射为混音并发策略】用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【设置 Ambient + mixWithOthers】按钮 (API: setCategory)",
"checkpoint": "类别映射为 CONCURRENCY_MIX_WITH_OTHERS"
},
{
"action": "点击【激活会话】按钮 (API: setActive)",
"checkpoint": "使用当前混音策略调用 activateAudioSession"
},
{
"action": "点击【停用会话】按钮",
"checkpoint": "会话成功停用"
}
],
"expectedResult": "setCategory 保留混音近似语义,并在会话激活时应用 HarmonyOS 并发策略",
"postconditions": "音频会话处于停用状态"
},
{
"id": "F06-003",
"title": "音频模式映射为 HarmonyOS 会话场景",
"level": "L1",
"moduleCode": "F-06",
"moduleName": "音频会话与音量面板",
"preconditions": "应用已启动,设备为 HarmonyOS API20+",
"testSteps": [
{
"action": "进入【音频模式映射为 HarmonyOS 会话场景】用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【VoiceChat】按钮 (API: setMode)",
"checkpoint": "真实调用 setAudioSessionScene(VOICE_COMMUNICATION)"
},
{
"action": "点击【GameChat】按钮 (API: setMode)",
"checkpoint": "真实调用 setAudioSessionScene(GAME)"
},
{
"action": "点击【Default】按钮 (API: setMode)",
"checkpoint": "真实调用 setAudioSessionScene(MEDIA)"
}
],
"expectedResult": "三个模式均完成 API20 原生场景映射,失败时显示明确错误",
"postconditions": ""
},
{
"id": "F06-004",
"title": "setVolume showUI=false 时隐藏面板并调节媒体音量",
"level": "L0",
"moduleCode": "F-06",
"moduleName": "音频会话与音量面板",
"preconditions": "应用已启动,VolumePanelHost 已挂载,设备为 HarmonyOS API20+",
"testSteps": [
{
"action": "进入【setVolume showUI=false 时隐藏面板并调节媒体音量】用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【setVolume 25%(showUI=false)】按钮 (API: setVolume, 参数:showUI=false)",
"checkpoint": "AVVolumePanel 接收对应原始音量等级,不传屏幕内 position"
},
{
"action": "等待系统音量更新后调用 getVolume",
"checkpoint": "读取值接近 0.25,允许系统音量等级量化误差"
},
{
"action": "点击【setVolume 75%(showUI=false)】并再次读取",
"checkpoint": "读取值接近 0.75,应用页面没有显示音量条"
}
],
"expectedResult": "setVolume({showUI:false}) 通过已挂载的 AVVolumePanelHost 调整前台媒体音量,面板保持隐藏,getVolume 可复核结果",
"postconditions": "媒体音量保持最后一次测试值,宿主面板保持隐藏"
},
{
"id": "F06-005",
"title": "显示/关闭音量面板后再切换系统音量对比",
"level": "L1",
"moduleCode": "F-06",
"moduleName": "音频会话与音量面板",
"preconditions": "应用已启动,VolumePanelHost 已挂载",
"testSteps": [
{
"action": "进入【显示/关闭音量面板后再切换系统音量对比】用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【显示音量面板】按钮 (API: showNativeVolumeUI, 参数:enabled=true)",
"checkpoint": "仅切换为允许显示,不会立刻弹出音量条"
},
{
"action": "点击【切换系统音量 25%】或【切换系统音量 75%】按钮,或按硬件音量键",
"checkpoint": "系统默认位置出现音量条,档位跟随当前音量"
},
{
"action": "点击【关闭音量面板】按钮 (API: showNativeVolumeUI, 参数:enabled=false)",
"checkpoint": "仅切换为隐藏,点击本身不会弹出音量条,组件仍保持挂载"
},
{
"action": "再次点击【切换系统音量 25%】或【切换系统音量 75%】按钮",
"checkpoint": "音量仍可变化,宿主系统音量条不应再出现"
}
],
"expectedResult": "showNativeVolumeUI 只决定后续切音量时要不要出宿主系统条;显示或关闭都不会立刻弹条,需再切换系统音量才能对比",
"postconditions": "宿主音量面板保持关闭"
},
{
"id": "F06-006",
"title": "setVolume showUI=true 时显示系统默认音量面板",
"level": "L1",
"moduleCode": "F-06",
"moduleName": "音频会话与音量面板",
"preconditions": "应用已启动,VolumePanelHost 已挂载,设备为 HarmonyOS API20+",
"testSteps": [
{
"action": "进入【setVolume showUI=true 时显示系统默认音量面板】用例详情页",
"checkpoint": "成功进入用例详情页"
},
{
"action": "点击【setVolume 25%(showUI=true)】按钮 (API: setVolume, 参数:showUI=true)",
"checkpoint": "媒体音量接近 0.25,音量条出现在系统默认位置(通常右上角),不出现在左上角"
},
{
"action": "点击【setVolume 75%(showUI=true)】按钮 (API: setVolume, 参数:showUI=true)",
"checkpoint": "媒体音量接近 0.75,音量条仍出现在系统默认位置"
}
],
"expectedResult": "setVolume({showUI:true}) 调节前台媒体音量,并单独控制宿主面板显示;显示时不传自定义 position",
"postconditions": "媒体音量保持最后一次测试值"
}
]
}
];