Skip to content

[AT] deepin-reader AT-SPI 测试套件 - #326

Closed
re2zero wants to merge 2 commits into
linuxdeepin:masterfrom
re2zero:agent/at/1787121877
Closed

[AT] deepin-reader AT-SPI 测试套件#326
re2zero wants to merge 2 commits into
linuxdeepin:masterfrom
re2zero:agent/at/1787121877

Conversation

@re2zero

@re2zero re2zero commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

概述

为 deepin-reader(文档查看器)生成 AT-SPI YAML 测试套件,基于测试用例文档 文档查看器V25-用例.xlsx(313 个原始用例)。

交付物

测试套件核心资产(14 个模块)

模块 用例数 说明
doc_open 2 文档打开/保存
doc_ops 1 页面导航/缩放
context_menu 1 右键菜单
main_menu 2 主菜单操作
tabs 1 标签页管理
thumbnails 1 缩略图显示
bookmarks 1 书签管理
annotations 3 注释管理
toc 1 目录导航
keyboard 2 键盘交互
other_interact 1 其它交互
window_mgmt 1 窗口管理
community 1 社区需求

图谱三件套

  • tests/at/ui-map.md — 组件树 + 控件表 + 菜单/快捷键索引
  • tests/at/expected-at-spi-elements.md — 预期元素清单
  • tests/at/at-spi-implementation-checklist.md — 缺口分析和修复模板

不可自动化用例(5 个)

触摸屏/触摸板/压力/性能/兼容性测试需硬件或环境支持。

AT-SPI 覆盖状况

  • 运行时元素覆盖率: 100%(基于 7 个可用元素)
  • 源码可访问性覆盖率: 4.6%(173 UI 类中仅 8 个有 AT 名称)
  • 主要缺口: 主菜单按钮/查找输入框/缩放控件缺少 accessibleName

生成管线

  1. Parse → Docs → Plan(Step 0)
  2. Scan + Dump + Merge — auto 模式(Step 1)
  3. Tree-info + AI 标注(Step 2-3)
  4. 用例规范化(Step 5-6)
  5. AI 语义映射(Step 7)
  6. Gate 1/2/3/4/5 校验全部通过
  7. 覆盖率报告(Step 10)

后续建议

  1. at-spi-implementation-checklist.md 为高频控件补 setAccessibleName
  2. 在有桌面环境时执行 youqu at run 运行时验收
  3. 补充运行时 AT-SPI dump,更新 elements.yaml 增强元素覆盖率

Summary by Sourcery

Establish a generated, module-based AT-SPI testing package for deepin-reader from the complete document-viewer test-case set.

New Features:

  • Add a comprehensive AT-SPI YAML test suite for deepin-reader covering document operations, menus, tabs, sidebars, annotations, keyboard interaction, window management, and community scenarios.
  • Add generated UI maps, expected element inventories, source-scan results, runtime dumps, recording plans, and module documentation for the test suite.

Enhancements:

  • Normalize the test-case model around the 313 source cases and map suites to reusable AT-SPI elements and actions.
  • Document AT-SPI accessibility coverage, missing accessible names, automation limitations, and recommended implementation priorities.

Documentation:

  • Add UI structure, menu, shortcut, coverage, and AT-SPI implementation guidance documentation.

Tests:

  • Expand and reorganize the AT test definitions into module-based suites, while explicitly separating non-GUI and hardware- or environment-dependent cases.

Chores:

  • Refresh generated scan, dump, mapping, and coverage artifacts for the deepin-reader test assets.

- 基于 文档查看器V25-用例.xlsx 生成 AT 测试套件
- 14 个模块,18 个可执行用例 + 5 个不可自动化用例标记
- AT-SPI 元素覆盖率:100%(口径 A,基于运行时 7 个元素)
- 源码可访问性覆盖率:4.6%(173 个 UI 类中仅 8 个有 AT 名称)
- 含 UI 图谱三件套:ui-map.md / expected-at-spi-elements.md / at-spi-implementation-checklist.md

生成管线:
- youqu at parse/docs/plan (Step 0)
- youqu at scan + dump + merge (Step 1, auto 模式)
- youqu at tree-info + AI 标注 (Step 2-3)
- 用例规范化 + 语义映射 (Step 5-7)
- Gate 1/2/3/4/5 校验全部通过
- 覆盖率报告 (Step 10)
@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: re2zero

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

@sourcery-ai

sourcery-ai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR completely rebuilds the deepin-reader AT-SPI YAML test suite and supporting assets: it replaces the previous small set of suites and element maps with a module-based, high-coverage suite, adds UI/scan/coverage documentation, and refactors AT tree/element metadata and source scan outputs to match the new pipeline and naming conventions.

File-Level Changes

Change Details Files
Replace the monolithic suite-cases.yaml with a structured, module-based AT-SPI case suite for deepin-reader.
  • Reorganize 313 raw test cases into logical modules such as doc_open, doc_ops, context_menu, main_menu, tabs, thumbnails, bookmarks, annotations, toc, keyboard, other_interact, window_mgmt, community, and hardware/perf/compatibility modules.
  • Add rich per-suite metadata (module, annotation, case_ids, steps with needs_accessible_name) and normalize steps into action/assert types.
  • Mark non-GUI linglong-related cases separately and add a dedicated cases_non_gui.yaml.
tests/at/suite-cases.yaml
Refactor cases_mapped.yaml format and content to align with the new mapping pipeline and strip legacy examples.
  • Replace legacy example header and version metadata with a concise format example and new metadata (generated_at, source).
  • Update suite entries to use new id/module naming and simplified step skeletons compatible with the mapping pipeline.
  • Remove old, highly specific mapped suites and leave a minimal, generic mapping example plus new suites for doc_open, doc_ops, context_menu, main_menu, tabs, thumbnails, bookmarks, annotations, toc, keyboard, other_interact, window_mgmt, community, touchscreen/trackpad/stress/performance/compatibility, and linglong.
tests/at/cases_mapped.yaml
Redefine the AT tree and element metadata to reflect runtime-scanned widgets and new static UI abstractions.
  • Replace the old at-tree.yaml (n0/n1/etc IDs) with a v2.0 tree that describes key widgets by class-based names (SideBarImageListView, BrowserMenu, EncryptionPage, HandleMenu, PagingWidget, TextEditShadowWidget, TransparentTextEdit) with roles, classifications, and states.
  • Strip interactive gap entries in element_gaps.yaml and reset summary to 0 to indicate no per-element accessible_id tracking in this revision.
  • Add an annotated AT tree (at-tree-annotated.yaml) that provides human-readable comments for each important widget for reviewers and implementers.
tests/at/at-tree.yaml
tests/at/element_gaps.yaml
tests/at/at-tree-annotated.yaml
Update scanned_ok.yaml and add scanned_gaps.yaml to represent the source-level AT-relevant widgets and their properties.
  • Normalize source_file paths to shorter, module-relative paths (e.g., sidebar/SideBarImageListview.cpp instead of reader/sidebar/...).
  • Extend scanned_ok entries with action_texts and menu_actions lists and mark is_ui_widget appropriately for widgets like BrowserMenu, HandleMenu, PagingWidget, TextEditShadowWidget, TransparentTextEdit.
  • Introduce scanned_gaps.yaml containing a full dump of UI and non-UI classes, their base classes, object_names, accessible_names, and DTK instantiations to support gap analysis at the class level.
tests/at/scan/scanned_ok.yaml
tests/at/scan/scanned_gaps.yaml
Add planning and documentation artifacts to describe the AT recording pipeline and module structure.
  • Create plan.yaml to list all modules, their case counts, ids, and high-level recording guide text, and mark status=pending.
  • Generate plan.md as a human-friendly rendering of plan.yaml with per-module recording instructions for testers.
  • Add module-specific documentation stubs under tests/at/docs/modules/ for community, bookmarks, doc_open, doc_ops, etc., and a high-level deepin-reader module overview.
tests/at/plan.yaml
tests/at/plan.md
tests/at/docs/modules/社区需求.md
tests/at/docs/modules/书签管理.md
tests/at/docs/modules/文档打开.md
tests/at/docs/modules/文档视图 操作.md
tests/at/docs/modules/元素图谱_deepin-reader.md
Introduce per-module YAML suites under tests/at/yaml/ that are directly runnable by the AT harness.
  • Add suites for annotations, main_menu, doc_open, keyboard, doc_ops, context_menu, other_interact, bookmarks, tabs, thumbnails, toc, window_mgmt, and community modules, each with setup (session_start), concrete steps (mouse_click, keyboard_hot_key, dtk_main_menu, dtk_context_menu, element_action), and assert_steps.
  • Use simple selectors that reference the new element names (PagingWidget, SideBarImageListView, TransparentTextEdit, HandleMenu) rather than legacy numeric IDs.
  • Separate non-GUI linglong cases into cases_non_gui.yaml to keep GUI automation focused.
tests/at/yaml/annotations/annotations.suite.yaml
tests/at/yaml/main_menu/main_menu.suite.yaml
tests/at/yaml/doc_open/doc_open.suite.yaml
tests/at/yaml/keyboard/keyboard.suite.yaml
tests/at/yaml/doc_ops/doc_ops.suite.yaml
tests/at/yaml/context_menu/context_menu.suite.yaml
tests/at/yaml/other_interact/other_interact.suite.yaml
tests/at/yaml/bookmarks/bookmarks.suite.yaml
tests/at/yaml/tabs/tabs.suite.yaml
tests/at/yaml/thumbnails/thumbnails.suite.yaml
tests/at/yaml/toc/toc.suite.yaml
tests/at/yaml/window_mgmt/window_mgmt.suite.yaml
tests/at/cases_non_gui.yaml
Add UI map and coverage report documentation to help understand AT-SPI mapping and test coverage.
  • Create ui-map.md with a mermaid diagram of the main UI components and a table mapping class names to roles and their source files, plus menus, sidebars, dialogs, and shortcuts.
  • Add expected-at-spi-elements.md to list expected AT-SPI names, their roles, and enabling conditions with a gap analysis section for missing anchors.
  • Introduce at-spi-implementation-checklist.md summarizing current coverage (classes with names vs total UI classes) and prioritizing where to add setAccessibleName or other accessible naming.
  • Add yaml/report.md with an automatically generated coverage summary (suite counts, element coverage, non-automatable suites).
tests/at/ui-map.md
tests/at/expected-at-spi-elements.md
tests/at/at-spi-implementation-checklist.md
tests/at/yaml/report.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@re2zero re2zero closed this Aug 20, 2026
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