Skip to content

[AT] 语音记事本 AT-SPI 测试套件(场景化用例改进) - #522

Draft
dengzhongyuan365-dev wants to merge 16 commits into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:test/sync-at-cases-from-app-test-v25-snipe
Draft

dengzhongyuan365-dev wants to merge 16 commits into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:test/sync-at-cases-from-app-test-v25-snipe

Conversation

@dengzhongyuan365-dev

Copy link
Copy Markdown
Member

改进概要

本次提交对 deepin-voice-note 的 AT 测试用例进行场景化改进,提升用例质量和真实业务覆盖率。

改进内容

  1. 搜索功能用例修正(4 个)

    • 将 4 个原名为「打开语音记事本」的搜索功能用例重命名为有意义的场景标题
    • 补充真实的搜索操作(输入关键字、Enter 搜索、清空恢复、特殊字符搜索、无匹配退出)
    • 增加对 VoiceNoteMainWindow、NoteItemListView、NoteContentWebView 的业务结果断言
  2. 启用语音记事本用例增强(3 个)

    • 为空步骤用例补充真实 UI 交互(CreateFolderButton 点击、NewNoteButton 点击、Ctrl+N 新建笔记)
    • 单窗口验证用例增加第二次启动尝试动作
  3. 快捷键使用用例增强(2 个)

    • 在快捷键操作前增加 NewNoteButton 点击创建笔记上下文
    • 增加 NoteContentWebView 断言验证业务结果
  4. 语音记事本V25 用例去重断言(5 个)

    • suite_001: 7→6 断言
    • suite_005: 10→2 断言(原 9× 重复 NoteContentWebView)
    • suite_006: 17→5 断言
    • suite_007: 16→4 断言
    • suite_008: 12→4 断言
  5. 新增场景补充用例(10 个)

    • 新增 场景补充 模块,覆盖笔记创建/编辑/删除/搜索/文件夹等完整业务场景
    • cases_mapped.yaml 从 38 条扩展至 48 条

验证结果

  • Gate 4 (Generation Gate): PASS
  • Gate 5 (Semantic Safety Gate): PASS(仅 WARN:keyboard_press 前无打开面板操作,非阻塞)
  • Smoke 测试(启用语音记事本模块): PASS(exit 0)

变更范围

仅修改 tests/at/ 目录下文件,不涉及应用源码。

Log: 同步语音记事本AT用例

Influence: 基于develop/snipe同步app-test-v25 main中的语音记事本AT用例到源码仓库tests/at目录。
- Rename 4 搜索功能 cases from generic '打开语音记事本' to meaningful
  scenario titles with real search actions and assertions
- Enrich 3 启用语音记事本 cases with actual UI interactions (CreateFolder,
  NewNote, Ctrl+N) instead of empty steps
- Enrich 2 快捷键使用 cases with NewNoteButton click before shortcuts and
  NoteContentWebView assertions
- Deduplicate excessive asserts in 5 语音记事本V25 cases (e.g. 10→2, 17→5,
  16→4) while keeping meaningful business assertions
- Update cases_mapped.yaml to reflect all suite changes (14 entries updated)
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengzhongyuan365-dev

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Log: 重新同步语音记事本AT用例

Influence: 将tests/at更新为app-test-v25 main中deepin-voice-note的最新AT用例内容。
Add privacy module AT test case (suite_privacy_001_s1) covering xlsx
case 1676361: open title bar menu, click Privacy Policy menu item,
verify browser external link is triggered and main window remains
operable.

Selector uses Accessible.name values confirmed from source:
- TitleBarMenu (Accessible.name in TitleBarMenu.qml)
- PrivacyPolicyMenuItem (Accessible.name in TitleBarMenu.qml)

No source code modified; only tests/at/ artifacts added.
Add 4 AT-SPI test cases for voice AI capabilities (阶段八):
- 8.1 语音朗读: select text, trigger via context menu, repeat, shortcut
- 8.2 语音听写: trigger via context menu, shortcut key
- 8.3 语音转文字: right-click voice note, trigger transcription, verify non-editable
- 8.4 转写文案折叠展开: marked unsupported (DOM-only elements, no AT-SPI name)

Uses dtk_context_menu for transient right-click menus (语音朗读/语音听写/语音转文字).
Selectors reference TiptapWebView (Accessible.name) for editor area.
Coverage remains 100% (47/47, no new persistent elements added).
Add save_exp module AT test suites covering 12 gap IDs across 4 cases:
- suite_save_exp_001: detail page save as TXT/HTML (1676345, 1676347, 1634939, 1634933)
- suite_save_exp_002: voice save for current note (1676343, 1634949, 1634947, 1634945)
- suite_save_exp_003: multi-select save TXT/HTML/voice (1676325, 1676323, 1676321, 1676313)
- suite_save_exp_004: empty note save entry disabled (1634931)

Update cases_mapped.yaml with the 4 new suite entries.
Gate 5/4 static validation passed.
…transcript

Add 5 AT test suite YAMLs under tests/at/yaml/edit_img/ covering 14 gap
IDs across editor context menu, image operations, and read-only voice
transcript scenarios:

- case_1676219: editor context menu blank/unselected text (1676219, 1676217, 1873449)
- case_1634975: editor context menu copy/cut/delete selected text (1634975, 1634973, 1634971)
- case_1676377: image paste and focus position persistence (1676377, 1676231, 1676229)
- case_1676227: image context menu copy/cut/save/delete (1676227, 1676225, 1676223, 1676221)
- case_1676439: voice transcript read-only and copy (1676439, 1680885, 1679613)

Update elements.yaml with TiptapWebView, TextContextMenu,
PictureContextMenu, VoiceContextMenu, and menu item elements.
Append 5 active case entries to cases_mapped.yaml.

Gate 4 validation PASS; Gate 5 no new errors (pre-existing only).
…lick module

Add play_voice module (Stage 7) with 5 test cases covering 17 coverage
items for voice note playback, Space shortcut, voice context menu
operations (copy/cut/paste/save as MP3/delete), and note context menu
operations (save voice/delete/edit).

- suite_play_voice_001: playback pause/resume + Space shortcut
- suite_play_voice_002: voice right-click menu copy/cut/paste/save/delete
- suite_play_voice_003: save voice + cancel delete + edit during playback
- suite_play_voice_004: switch playback target + right-click other notebook
- suite_play_voice_005: AT-SPI node existence assertions

New AT-SPI elements: VoiceContextMenu (WebEngineView.qml:1036),
NoteContextMenu (ItemListView.qml:626).

Coverage: 49/49 (100%), Gate 5/4 passed.
…25-snipe' into test/sync-at-cases-from-app-test-v25-snipe

# Conflicts:
#	tests/at/cases_mapped.yaml
#	tests/at/yaml/elements.yaml
Add 3 AT test suites for multi-select note batch operations (module: multi_sel):
- suite_multi_sel_001_s1: Ctrl/Shift multi-select (covers 1676335, 1676329)
- suite_multi_sel_002_s1: Move and delete via toolbar buttons (covers 1676327, 1676319)
- suite_multi_sel_003_s1: Right-click batch save/delete (covers 1676317, 1676315, 1676311, 1676309)

Add helper script multi_select_five_notes.py for Ctrl/Shift+click selection.
Add MoveNoteDialog, MoveDialogOk, 删除确认按钮 to elements.yaml and manifest.
Update coverage-report to 52 covered / 52 denominator / 100%.
…ses)

Add 4 test suites for base_flow module covering 7 coverage items:
- suite_base_flow_001: Smoke test - create folder/note/record/play
  (covers 1884375)
- suite_base_flow_002: Multi-entry note creation via right-click menus,
  Ctrl+B, and button+Enter (covers 1676341, 1676411)
- suite_base_flow_003: Stress test - 20x create/delete folders and
  notes (covers 1635299, 1635301)
- suite_base_flow_004: Long list scroll - Page_Down/End/Page_Up/Home
  on FolderListView and NoteItemListView (covers 1634901, 1634865)

Add 删除 (WarningButton) to elements.yaml and element-coverage-manifest.yaml
for delete confirmation dialog. Update coverage-report.yaml (50/50, 100%).

Gate 5/4 static validation: PASS
…ge and right-click menu

Add 4 AT test suites for search_ops module covering:
- Keyword search with match, no-match, and special characters (1676375, 1676373, 1635179)
- Search result delete via right-click context menu (1635203, 1635191)
- Search result save as TXT and save voice via right-click menu (1635195, 1635193)
- Search results page no recording button entry (1635185)

All suites use existing elements (VoiceNoteMainWindow, NoteItemListView,
NoteContentWebView, NewNoteButton, 删除 button) and the established
focus_search_and_query.py helper script for search box interaction.
No new elements added; coverage remains 100%.
Improve AT suites for voice recording, playback, image context menu,
multi-select, save/export and voice-to-text scenarios.

优化语音录制、播放、图片右键、多选、保存导出和语音转文字等
场景化 AT 用例。

Log: 优化语音记事本场景化 AT 用例
Influence: 提升图片、语音、多选和保存导出链路在流水线中的可执行性。
@github-actions

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "tests/at/yaml/base_flow/suite_base_flow_001_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk '\\''$2 != \"null-sink\" {print $2; exit}'\\''); fi; if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/edit_img/case_1676227_s1.suite.yaml": {
            "b": [
                "  command: \"bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'\""
            ]
        },
        "tests/at/yaml/edit_img/case_1676377_s1.suite.yaml": {
            "b": [
                "  command: \"bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'\""
            ]
        },
        "tests/at/yaml/edit_img/case_1676439_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk '\\''$2 != \"null-sink\" {print $2; exit}'\\''); fi; if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_001_s1.suite.yaml": {
            "b": [
                "    bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_002_s1.suite.yaml": {
            "b": [
                "    bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        }
    }
}

Wait for visible AT-SPI menu items before continuing AT steps.

等待 AT-SPI 菜单项真实可见后再继续执行用例步骤。

Log: 修复 AT helper 菜单可见性等待问题
Influence: 提升主菜单、设置弹窗和笔记右键菜单相关用例全量执行稳定性。
@github-actions

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "tests/at/yaml/base_flow/suite_base_flow_001_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk '\\''$2 != \"null-sink\" {print $2; exit}'\\''); fi; if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/edit_img/case_1676227_s1.suite.yaml": {
            "b": [
                "  command: \"bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'\""
            ]
        },
        "tests/at/yaml/edit_img/case_1676377_s1.suite.yaml": {
            "b": [
                "  command: \"bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'\""
            ]
        },
        "tests/at/yaml/edit_img/case_1676439_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk '\\''$2 != \"null-sink\" {print $2; exit}'\\''); fi; if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_001_s1.suite.yaml": {
            "b": [
                "    bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_002_s1.suite.yaml": {
            "b": [
                "    bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        }
    }
}

Click visible settings controls in the same AT-SPI helper action.\n\n在同一个 AT-SPI helper 动作中点击设置弹窗目标控件。\n\nLog: 修复设置弹窗控件跨步骤查找不稳定问题\nInfluence: 提升内部音频设置相关 AT 用例在全量流水线中的稳定性。
@github-actions

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "tests/at/yaml/base_flow/suite_base_flow_001_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk '\\''$2 != \"null-sink\" {print $2; exit}'\\''); fi; if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/edit_img/case_1676227_s1.suite.yaml": {
            "b": [
                "  command: \"bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'\""
            ]
        },
        "tests/at/yaml/edit_img/case_1676377_s1.suite.yaml": {
            "b": [
                "  command: \"bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'\""
            ]
        },
        "tests/at/yaml/edit_img/case_1676439_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk '\\''$2 != \"null-sink\" {print $2; exit}'\\''); fi; if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_001_s1.suite.yaml": {
            "b": [
                "    bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_002_s1.suite.yaml": {
            "b": [
                "    bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source \"$SINK.monitor\" 2>/dev/null || true; fi; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        }
    }
}

Replace webengine_eval_js and webengine_mouse_event actions (not in
youqu's valid action set) with standard AT-SPI actions from
cases_mapped.yaml: dtk_context_menu, keyboard_hot_key, keyboard_type,
keyboard_press, element_action, and mouse_click.

Affected files (10):
- base_flow/suite_base_flow_001_s1.suite.yaml
- play_voice/suite_play_voice_001_s1.suite.yaml
- play_voice/suite_play_voice_002_s1.suite.yaml
- play_voice/suite_play_voice_003_s1.suite.yaml
- play_voice/suite_play_voice_004_s1.suite.yaml
- save_exp/suite_save_exp_002_s1.suite.yaml
- voice_ai/suite_voice_ai_003_s1.suite.yaml
- edit_img/case_1676227_s1.suite.yaml
- edit_img/case_1676377_s1.suite.yaml
- edit_img/case_1676439_s1.suite.yaml

Gate 4 (Generation Gate): PASS
Gate 5 (Semantic Safety Gate): PASS (WARN only)
@github-actions

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "tests/at/yaml/base_flow/suite_base_flow_001_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk"
            ]
        },
        "tests/at/yaml/edit_img/case_1676227_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/edit_img/case_1676377_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; exec ./tests/at/setup_voice_note_at.sh'"
            ]
        },
        "tests/at/yaml/edit_img/case_1676439_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -z \"$SINK\" ] || [ \"$SINK\" = null-sink ]; then SINK=$(pactl list short sinks | awk"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_001_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source"
            ]
        },
        "tests/at/yaml/play_voice/suite_play_voice_002_s1.suite.yaml": {
            "b": [
                "  command: bash -lc 'export QTWEBENGINE_REMOTE_DEBUGGING=9222; SINK=$(pactl get-default-sink 2>/dev/null || true); if [ -n \"$SINK\" ]; then pactl set-default-sink \"$SINK\" 2>/dev/null || true; pactl set-default-source"
            ]
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants