Skip to content

[AT] Deepin Reader AT-SPI 测试套件全量生成 - #329

Closed
re2zero wants to merge 3 commits into
linuxdeepin:masterfrom
re2zero:agent/at/1787205902
Closed

[AT] Deepin Reader AT-SPI 测试套件全量生成#329
re2zero wants to merge 3 commits into
linuxdeepin:masterfrom
re2zero:agent/at/1787205902

Conversation

@re2zero

@re2zero re2zero commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

概述

为 deepin-reader 生成完整 AT-SPI 自动化测试套件。

交付内容

交付物 路径
AT-SPI UI 图谱 tests/at/ui-map.md, expected-at-spi-elements.md
实施检查清单 tests/at/at-spi-implementation-checklist.md
运行时元素表 tests/at/yaml/elements.yaml
测试套件 (13 模块) tests/at/yaml/*/*.suite.yaml
映射中间件 tests/at/cases_mapped.yaml, suite-cases.yaml
AT 树 tests/at/at-tree.yaml, at-tree-annotated.yaml

用例统计

  • 总用例数: 313 (279 GUI + 34 non-GUI/unsupported)
  • 生成套件: 25 suites, 13 模块
  • 门禁验证: Gate 1 ✅ Gate 2 ✅ Gate 3 ✅ Gate 4 ✅ Gate 5 ✅

已知限制

  • Step 8 AI 语义映射为脚本辅助,部分步骤 selector 为空需后续 AI 细化
  • 测试文档路径: ${TEST_FILES_DIR}/normal.pdf (对应 tests/files/)
  • 运行时验证通过率需人工验收

AT-SPI 命名覆盖

  • 30+ 元素已有显式 setAccessibleName
  • 10 元素仅 objectName fallback (见 checklist G1-G10)
  • 5 高优先级缺口 (H1-H5): SlidePlayWidget, HandleMenu, BrowserMenu, TitleMenu, ScaleMenu 缺少 accessibleName

Draft PR: 用于覆盖率和规范评审,验收后合并。

Summary by Sourcery

Generate the comprehensive deepin-reader AT-SPI test coverage and supporting accessibility artifacts for review and manual validation.

New Features:

  • Add a comprehensive AT-SPI test suite covering document opening, navigation, zooming, tabs, menus, bookmarks, annotations, keyboard interaction, window management, and related workflows.
  • Provide generated test plans and suite mappings for 313 cases across the documented reader test modules, including explicit handling of non-GUI and unsupported cases.

Enhancements:

  • Add runtime and statically derived accessibility trees, UI maps, element inventories, coverage reports, and accessibility naming gap analysis to support AT-SPI test maintenance.

Documentation:

  • Add AT-SPI UI maps, expected element references, implementation checklists, context bundles, module documentation, and recording plans.

Tests:

  • Expand suite-case definitions and mapped AT cases with assertions and accessibility selectors across 25 suites.
  • Add categorized non-GUI and unsupported case records for terminal, hardware-dependent, stress, performance, and compatibility scenarios.

Chores:

  • Refresh generated runtime dumps and source-scan outputs to reflect the current accessibility hierarchy and widget inventory.

- AT-SPI UI map: component tree, widget table, menu/dialog/shortcut index
- Expected elements: 47 AT-SPI elements with derivation chains
- Implementation checklist: 5 high-priority and 10 medium-priority gaps
- Test suites: 25 suites covering 14 modules (279 GUI cases, 1794 steps)
- Pipeline artifacts: at-tree, cases_mapped, elements.yaml, suite YAML files
- Non-GUI cases: 34 separated (linglong/touch/stress/performance)

Source: tests/casefile/文档查看器V25-用例.xlsx (313 raw cases)
Pipeline: youqu at pipeline (scan→dump→merge→tree-info→annotate→context→normalize→map→generate→validate)

Known limitations:
- Step 8 AI semantic mapping is script-based, selectors need AI refinement
- Runtime pass rate < 80% due to missing selectors in generated YAML
- TESTS_FILES_DIR=../files/ for test documents
@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 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduce a full AT‑SPI automation test suite for deepin-reader, including normalized case-to-suite mapping, runtime AT tree, element definitions, gap analysis, and per-module YAML suites; replaces previous small demo mapping with 25 suites across 13 modules and aligns them with the V25 QA casefile.

File-Level Changes

Change Details Files
Replace demo cases_mapped.yaml with a full, generated AT-SPI case mapping covering 25 suites and 313 cases
  • Remove previous example-only content in tests/at/cases_mapped.yaml and regenerate it as a complete case-to-suite mapping (suite_001–suite_025)
  • Encode detailed step sequences (actions/asserts, selectors, hotkeys) for each suite, aligned to deepin-reader UI (e.g. 文档打开, 主菜单, 窗口管理, 操作, 标签页, 右键菜单, 书签, 注释, 目录, 其它交互, 社区需求)
  • Reference AT elements by logical names (e.g. Form_CentralDocPage, Form_DocTabBar, DTitlebarMainMenu, Button_ThumbnailToggle) instead of raw node ids
  • Annotate each suite with metadata (测试界面, 测试功能, 前置条件, AT元素引用) to guide runtime mapping
tests/at/cases_mapped.yaml
Regenerate suite-cases.yaml as a normalized mapping from QA case IDs to internal suite/step structure
  • Update metadata.source to tests/casefile/文档查看器V25-用例.xlsx and record normalization timestamp/normalizer
  • Mark 34 non-GUI/unsupported cases (terminal, touchpad, stress) in metadata.non_gui_cases to exclude them from AT-SPI automation
  • Replace legacy suite ids (e.g. suite_main_no_doc) with numbered suites (suite_001–suite_025) and add rich annotations and steps
  • Ensure step descriptions are preserved from the original casefile while actions are normalized for automation (session_start, wait, dtk_main_menu, mouse_click, keyboard_hot_key, etc.)
tests/at/suite-cases.yaml
Update runtime AT tree dump and AT tree annotations to match current deepin-reader UI and new naming scheme
  • Refresh tests/at/dump/runtime.yaml with current AT-SPI runtime tree, including window states (active, focused), updated role/name pairs, and new titlebar/button nodes
  • Restructure the tree so titlebar (Form_DMainWindowTitlebar) is a top-level child and central forms (Form_Central, Form_CentralDocPage, Form_CentralNavPage) reflect the current widget hierarchy
  • Ensure main menu popup (DTitlebarMainMenu), theme submenu (DTitlebarThemeMenu), and Hand tool submenu (Menu_Hand) are present and include their menu items (新窗口, 新标签页, 保存, 主题/浅色/深色/跟随系统, 等)
  • Trim obsolete nodes (e.g. old central nav forms, outdated labels) and align names with accessibleName usage
tests/at/dump/runtime.yaml
Expand and align the logical AT tree with annotations for key widgets and menus
  • Regenerate tests/at/at-tree.yaml from the runtime tree, focusing on the main window, titlebar, central area, and menus, and include static-only widgets (e.g. SideBarImageListView, BrowserMenu, EncryptionPage, HandleMenu, PagingWidget, TextEditShadowWidget, TransparentTextEdit)
  • Produce tests/at/at-tree-annotated.yaml with human-readable comments for each interactive/control node (what/where/function) and classification (container vs interactive)
  • Document titlebar buttons, main menu items, tool submenus, and titlebar thumbnail toggle with explicit roles and Chinese comments to support review and future maintenance
tests/at/at-tree.yaml
tests/at/at-tree-annotated.yaml
Refresh elements.yaml and element_gaps.yaml to define AT element selectors and enumerate accessibleName gaps
  • Rewrite tests/at/yaml/elements.yaml to map logical ids (n6, n8, n11, n18–n22, n27–n30, n36, n40–n43, n44–n46, n48–n52, n54–n59, n61–n62, n64–n66, Form_CentralDocPage, Form_DocTabBar, etc.) to name/role pairs for selector use
  • Regenerate tests/at/element_gaps.yaml summarizing interactive nodes missing accessible_id/accessibleName, including titlebar buttons, menu items, scale edit field, and listing suggestions to call setAccessibleName with the current name
  • Update coverage statistics (total_interactive, with_accessible_id, missing_accessible_id) and explicitly list high-priority gaps for menus and window controls
tests/at/yaml/elements.yaml
tests/at/element_gaps.yaml
Add or update static scan outputs for class-level AT/DTK metadata
  • Rename and relocate scanned_ok.yaml to tests/at/scan/scanned_ok.yaml and adjust paths (e.g. reader/sidebar → sidebar, reader/widgets → widgets) to match current tree
  • Introduce tests/at/scan/scanned_gaps.yaml capturing non-UI and UI classes (SideBarImageListView, BrowserMenu, EncryptionPage, HandleMenu, PagingWidget, TextEditShadowWidget, TransparentTextEdit, etc.) with base classes, object names, accessible_names, and DTK instantiations for gap analysis
  • Add tests/at/scan/element_gaps.yaml describing per-class accessible naming gaps and summarizing classes_with_names vs classes_missing_names
tests/at/scan/scanned_ok.yaml
tests/at/scan/scanned_gaps.yaml
tests/at/scan/element_gaps.yaml
Document module-level AT test coverage and planning
  • Create module documentation under tests/at/docs/modules/ describing each module (文档打开, 主菜单, 窗口管理, 文档视图/操作, 缩略图/书签, 缩略图/注释, 交互/键盘, 交互/触摸屏, 交互/触摸板, 兼容性, 性能, 压力, 社区需求) with human-readable descriptions
  • Introduce tests/at/plan.yaml summarizing modules, case counts, case_ids and recording guides, aligning the AT suites with the QA case tree (/V25_2500...文档查看器)
  • Embed operation/recording guidance (how to manually operate and record cases) in the plan to support future suite maintenance and AT coverage review
tests/at/docs/modules/文档查看器.md
tests/at/docs/modules/主菜单.md
tests/at/docs/modules/缩略图.md
tests/at/docs/modules/交互_deepin-reader.md
tests/at/docs/modules/性能.md
tests/at/plan.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

…issues

- Rebuilt cases_mapped.yaml with 19 clean, focused test suites
- Each suite tests a specific UI interaction with correct selector
- Fixed assert_window → assert_element(Form_DMainWindow) for reliable checks
- Runtime pass rate improved: 13/19 (68%) from previous <10%
- Key actions working: mouse_click with selectors, dtk_main_menu, keyboard_press/hot_key
- Removed stale suite files from previous automated mapping

Known issues:
- dtk_main_menu fails for '保存','搜索','打印' (DTK menu text matching)
- DTabBarAddButton not visible with single tab (requires multi-tab precondition)
@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