Skip to content

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

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

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

Conversation

@re2zero

@re2zero re2zero commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

变更内容

为 deepin-reader 生成 AT-SPI YAML 测试套件,基于 V25 测试用例文档(313 用例)。

测试套件覆盖

套件 说明
主界面 — 无文档打开 无文档时主界面文件打开按钮
标题栏主菜单 主菜单导航(新建/保存/搜索/打印/工具/主题)
标题栏主题菜单 浅色/深色/跟随系统主题切换
标题栏缩放输入框 缩放比例输入
顶部标签页栏 标签页新建/滚动/切换
左侧栏 — 按钮切换 侧边栏展开/收起
右键文档区域菜单 文档右键菜单项
右键缩放区域菜单 缩放输入框右键菜单
窗口管理 最小化/最大化/关闭按钮
键盘交互 快捷键操作(Ctrl+F 搜索)
文档打开 文件选择对话框打开

交付物

  • 11 个 suite.yaml 套件文件(100% 断言覆盖率)
  • elements.yaml(62 个运行时 AT-SPI 元素)
  • at-tree.yaml(运行时 AT-SPI 树)
  • suite-cases.yaml / cases_mapped.yaml(规范化用例与映射)

运行时验证

  • 桌面环境通过率: 7/11 (63.6%)
  • 失败原因:
    • 右键菜单操作需坐标定位(待生成器支持 x/y)
    • DTabBarAddButton 运行时查找不一致
    • 菜单项计数与运行时排序偏差

备注

  • 仅基于运行时元素表(无源码 MCP,跳过 UI 图谱推导)
  • 完整覆盖率报告见 issue 附件

Summary by Sourcery

Provide a runtime-validated AT-SPI test suite for deepin-reader's primary user interface workflows.

New Features:

  • Add 11 AT-SPI YAML test suites covering core deepin-reader UI interactions, document opening, menus, tabs, sidebar controls, context menus, window management, zoom input, and keyboard shortcuts.

Enhancements:

  • Replace the prior design-oriented accessibility tree and numeric element references with a runtime AT-SPI tree and named element mappings.
  • Normalize and consolidate the V25 test cases and suite metadata for executable AT-SPI coverage.

Tests:

  • Add runtime element definitions and suite case mappings for the deepin-reader accessibility test coverage.

Chores:

  • Remove obsolete raw-case, runtime-dump, gap-report, and superseded suite artifacts.

Generate AT-SPI YAML test suites from V25 test case document (313 cases).
Cover 11 modules: main window, titlebar menu, sidebar toggle, tab bar,
context menus, window management, zoom control, and keyboard shortcuts.

- 11 suite files with 100% assertion coverage
- 63.6% runtime pass rate (7/11) on current environment
- Auto mode pipeline: scan + dump dtk + merge + tree-info + mapping

Log: add AT-SPI test suites for deepin-reader
@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 introduces a complete AT-SPI YAML test suite for deepin-reader based purely on runtime AT tree data, refactors element identifiers into stable semantic names, and rewrites mapped/normalized test cases to use the new schema and cover the defined UI areas and interactions.

File-Level Changes

Change Details Files
Rebuild the AT-SPI runtime tree for deepin-reader with richer metadata and explicit titlebar/tabbar/menu structures to drive the test suite.
  • Set top-level app metadata and mark all nodes as source: runtime with detailed states/actions.
  • Restructured the main window tree to expose titlebar left/right areas, central doc/nav pages, and tab bar as distinct forms.
  • Added explicit nodes for window control buttons, tab scrolling/add buttons, main menu, theme menu, tool submenus, and their menu items.
tests/at/at-tree.yaml
Normalize AT elements into semantic keys and roles for use in suites and cases instead of numeric IDs.
  • Replaced numeric element IDs (n6, n224, etc.) with named keys like Button_SelectFile, DTabBarAddButton, 向左滚动, DLineEditChildLineEdit.
  • Added roles and minimal selector data to elements used by automation (buttons, text fields, popup menus, menu items, forms).
  • Updated the element list to match the rebuilt runtime tree, including titlebar, tab bar, main menu, theme menu, and popup menus.
tests/at/yaml/elements.yaml
Redesigned the mapped case format and populated suites with deepin-reader specific flows using the new selectors.
  • Introduced metadata and a stricter schema in cases_mapped.yaml (id, name, module, status, annotation, steps).
  • Rewrote mapped cases to use semantic AT元素引用 arrays and selectors with name/role, aligning actions like session_start, dtk_main_menu, dtk_context_menu, mouse_click, keyboard_*.
  • Added coordinate-based dtk_context_menu calls for document-area and zoom-area right-click tests where required.
tests/at/cases_mapped.yaml
Regenerated normalized suite cases from V25 spec to align with the mapped format and updated AT elements.
  • Updated metadata (normalized_at, normalizer) and referenced source document in suite-cases.yaml.
  • Reworked each suite case to use AT元素引用 as strings, assert_element instead of legacy assert_visible, and consistent selector structures.
  • Adjusted steps and descriptions for all 11 suites (main window, titlebar main menu, theme menu, tab management, sidebar toggle, context menus, window controls, scale input, keyboard, doc open) to reflect runtime behavior and new actions.
tests/at/suite-cases.yaml
Add per-suite YAML definitions for the deepin-reader AT-SPI test suites and remove obsolete generation artifacts.
  • Added 11 suite.yaml files under tests/at/yaml/, one per functional area (主界面, 标题栏主菜单, 标题栏主题菜单, 标签页栏, 左侧栏按钮切换, 文档区域右键菜单, 缩放区域右键菜单, 窗口管理, 键盘交互, 文档打开等).
  • Removed intermediate dump and gap-analysis files (runtime.yaml, scanned_gaps.yaml, scanned_ok.yaml, states/00_all.yaml, element_gaps.yaml, cases_raw.yaml) no longer needed.
  • Ensured suite files reference the new semantic elements and case IDs for 100% assertion coverage of the 313 V25 cases subset implemented.
tests/at/yaml/…
tests/at/cases_raw.yaml
tests/at/dump/runtime.yaml
tests/at/dump/scanned_gaps.yaml
tests/at/dump/scanned_ok.yaml
tests/at/dump/states/00_all.yaml
tests/at/element_gaps.yaml

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