Skip to content

test(at): stabilize deepin reader yaml suites - #313

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
dengzhongyuan365-dev:fix/at-yaml-stability
Jul 30, 2026
Merged

test(at): stabilize deepin reader yaml suites#313
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
dengzhongyuan365-dev:fix/at-yaml-stability

Conversation

@dengzhongyuan365-dev

@dengzhongyuan365-dev dengzhongyuan365-dev commented Jul 30, 2026

Copy link
Copy Markdown
Member

Stabilize Deepin Reader accessibility test suites by updating element definitions and pruning flaky interactions.

Tests:

  • Adjust element roles and selectors in AT YAML to better reflect actual UI semantics and improve interaction stability.
  • Reorganize and trim YAML suites for sidebar, menu, search, tab bar, and document interactions to reduce flakiness and ensure consistent AT-SPI-based testing.

Use AT-SPI element actions for sidebar controls and trim flaky steps.

使用 AT-SPI 元素动作替代不稳定点击,并收敛易波动步骤。

Log: 稳定 deepin-reader AT YAML 用例

Influence: 提升 AT YAML 用例在本地和远端环境的执行稳定性,整套用例通过。
@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR stabilizes Deepin Reader AT YAML suites by updating element roles to better match actual accessibility semantics and trimming or adjusting flaky interaction steps across multiple suite files, particularly for sidebar, menu, search, and tab bar interactions.

File-Level Changes

Change Details Files
Update AT element definitions to reflect correct roles for sidebar and page edit controls.
  • Remove incorrect check box roles from thumbnail, catalog, bookmark, and annotation sidebar buttons so they are treated as standard buttons in AT-SPI.
  • Change the pageEdit element role from panel to text to align with how the control is exposed for editing interactions.
  • Maintain existing names for elements while refining role semantics to stabilize selector matching and actions.
tests/at/yaml/elements.yaml
Adjust and trim unstable AT YAML test steps in multiple Deepin Reader suites to rely on more stable AT-SPI actions and selectors.
  • Refactor sidebar-related interactions in suites to use element actions instead of mouse clicks for navigation and toggles.
  • Simplify or remove flaky steps in menu, search, and tab bar related suites to reduce timing and focus sensitivity.
  • Keep overall test coverage for core reader workflows while dropping only unstable or redundant steps.
tests/at/yaml/(multiple Deepin Reader Chinese-named suite files).suite.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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码实现了UI自动化测试用例的适配与精简,更新了控件角色与动作动词
逻辑正确且清理了冗余步骤,但因测试覆盖度缩减及硬编码等待时间扣5分

■ 【详细分析】

  • 1.语法逻辑(基本正确)✓

YAML 语法结构完整,缩进层级正确。将 mouse_click 替换为 element_action 并配合 do: click 的写法符合测试框架的新规范。在 elements.yaml 中移除部分控件的 role: check box 并将 pageEdit 的角色更新为 text,与实际 UI 控件属性变更保持一致。
潜在问题:部分测试套件(如 右键文档区域菜单)大幅删除了测试步骤,可能导致测试覆盖度下降,无法全面验证右键菜单的各项功能。
建议:评估被删除的测试步骤是否已被其他用例覆盖;若未覆盖,建议拆分为多个独立的测试用例以保证测试完整性。

  • 2.代码质量(良好)✓

统一将多个测试套件中的启动等待时间从 3.0 更新为 6.0,提升了测试执行的稳定性。清理了大量被注释掉的废弃代码和无效的断言步骤,提高了测试脚本的可读性和可维护性。selector 的更新准确匹配了当前 UI 结构。
潜在问题:硬编码的 wait: 6.0 仍然依赖于具体的机器性能,在不同配置的测试机上可能存在波动。
建议:考虑使用动态等待机制(如轮询检查特定元素是否出现)替代固定的 wait 时间,以增强跨环境兼容性。

  • 3.代码性能(无性能问题)✓

通过精简测试步骤,移除了不必要的 mouse_clickdtk_context_menu 操作,有效减少了单次测试套件的执行时间。同时减少了冗余的断言步骤,降低了测试框架的开销。
建议:保持当前的精简策略,避免在测试步骤中引入不必要的 UI 交互。

  • 4.代码安全(安全,存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次变更仅涉及 UI 自动化测试用例的 YAML 配置文件更新,不包含任何业务逻辑代码、网络请求或敏感数据处理,不存在命令注入、路径遍历等安全风险。

  • 建议:无需安全修复,保持现有的测试配置规范即可。

■ 【改进建议代码示例】

# 建议使用动态等待替代硬编码 wait,以提升稳定性(伪代码示例)
setup:
- action: session_start
  command: deepin-reader ${TEST_FILES_DIR}/normal.pdf
  wait_until: element_visible  # 动态等待条件
  selector:
    name: Form_CentralDocPage
    role: form
  timeout: 10.0  # 最大超时时间

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Several sidebar elements (thumbnail/catalog/bookmark/annotation) no longer constrain on role; if their AT-SPI roles are stable, consider retaining role filters to avoid over-broad matches when names collide or change.
  • Changing pageEdit from panel to text alters how interactions resolve; if this element needs both container and editable semantics, consider defining separate elements for the container and the editable field instead of overloading one.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several sidebar elements (thumbnail/catalog/bookmark/annotation) no longer constrain on role; if their AT-SPI roles are stable, consider retaining role filters to avoid over-broad matches when names collide or change.
- Changing `pageEdit` from `panel` to `text` alters how interactions resolve; if this element needs both container and editable semantics, consider defining separate elements for the container and the editable field instead of overloading one.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@dengzhongyuan365-dev

Copy link
Copy Markdown
Member Author

/forcemerge

@deepin-bot
deepin-bot Bot merged commit e052601 into linuxdeepin:master Jul 30, 2026
12 checks passed
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.

3 participants