From 6e3a7151ded708d011e538c8dc88bd1de5d97c79 Mon Sep 17 00:00:00 2001 From: re2zero Date: Mon, 14 Sep 2026 02:05:40 +0800 Subject: [PATCH] =?UTF-8?q?[AT]=20deepin-editor=20AT-SPI=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=A5=97=E4=BB=B6=EF=BC=88=E7=BC=96=E7=A0=81=E5=88=87?= =?UTF-8?q?=E6=8D=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 场景四(定向生成,形态 A)— 编码切换用例 - 新增 enc_switch 模块测试套件(编码切换场景) - element-map 双字段管线:PToolButton/PActUtf8/PTextEdit 均以 accessible_id 定位 - GB18030 菜单项无 objectName/setAccessibleName → dtk_dropdown_menu + items 显示文本 - 覆盖门禁 100%(3/3 持久定位键全部覆盖) - Gate 4/5 静态校验通过 --- tests/at/cases_mapped.yaml | 40 +++++++++++++++ tests/at/coverage-report.yaml | 9 ++++ tests/at/element-coverage-manifest.yaml | 26 ++++++++++ tests/at/yaml/elements.yaml | 7 +++ .../at/yaml/enc_switch/enc_switch.suite.yaml | 49 +++++++++++++++++++ 5 files changed, 131 insertions(+) create mode 100644 tests/at/cases_mapped.yaml create mode 100644 tests/at/coverage-report.yaml create mode 100644 tests/at/element-coverage-manifest.yaml create mode 100644 tests/at/yaml/elements.yaml create mode 100644 tests/at/yaml/enc_switch/enc_switch.suite.yaml diff --git a/tests/at/cases_mapped.yaml b/tests/at/cases_mapped.yaml new file mode 100644 index 00000000..3ac53d77 --- /dev/null +++ b/tests/at/cases_mapped.yaml @@ -0,0 +1,40 @@ +version: '1.0' +cases: +- id: suite_enc_switch_001_s1 + name: 编码切换 + module: enc_switch + steps: + - step_type: action + action: keyboard_hot_key + key: ctrl+t + - step_type: action + action: dtk_dropdown_menu + selector: + accessible_id: PToolButton + items: + - GB18030 + - step_type: action + action: keyboard_type + text: UOS给世界更好的选择 + - step_type: action + action: element_action + selector: + accessible_id: PActUtf8 + do: click + - step_type: action + action: keyboard_press + key: enter + - step_type: action + action: keyboard_hot_key + key: ctrl+s + - step_type: action + action: file_dialog_select + path: /tmp/enc_switch_test.txt + wait: 3.0 + - step_type: assert + action: assert_element + selector: + accessible_id: PTextEdit + - step_type: assert + action: assert_file_exists + path: /tmp/enc_switch_test.txt diff --git a/tests/at/coverage-report.yaml b/tests/at/coverage-report.yaml new file mode 100644 index 00000000..f22543fb --- /dev/null +++ b/tests/at/coverage-report.yaml @@ -0,0 +1,9 @@ +scan_total: 3 +transient_items: [] +unreachable: 0 +denominator: 3 +covered: 3 +uncovered: 0 +coverage: 100.0 +passed: true +uncovered_elements: [] diff --git a/tests/at/element-coverage-manifest.yaml b/tests/at/element-coverage-manifest.yaml new file mode 100644 index 00000000..ec990db3 --- /dev/null +++ b/tests/at/element-coverage-manifest.yaml @@ -0,0 +1,26 @@ +version: '1.0' +source: at-case-authoring:element-map.yaml +scan_total: 3 +elements: + PToolButton: + role: push button + ui_name: UTF-8菜单 + desc: 底部编码下拉菜单触发按钮(DDropdownMenu PToolButton) + locator: accessible_id + PActUtf8: + role: menu item + ui_name: UTF-8 + desc: 编码菜单中 Unicode 组下的 UTF-8 选项(QAction,有 objectName) + locator: accessible_id + PTextEdit: + role: text + ui_name: 文本编辑区 + desc: 文本编辑区域(TextEdit,键盘输入目标) + locator: accessible_id +transient_items: [] +unresolved: +- name: GB18030 + role: menu item + ui_name: GB18030 + desc: 编码菜单中简体中文组下的 GB18030 选项(QAction,无 setObjectName/setAccessibleName) + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 diff --git a/tests/at/yaml/elements.yaml b/tests/at/yaml/elements.yaml new file mode 100644 index 00000000..3401f348 --- /dev/null +++ b/tests/at/yaml/elements.yaml @@ -0,0 +1,7 @@ +elements: + PToolButton: + accessible_id: PToolButton + PActUtf8: + accessible_id: PActUtf8 + PTextEdit: + accessible_id: PTextEdit diff --git a/tests/at/yaml/enc_switch/enc_switch.suite.yaml b/tests/at/yaml/enc_switch/enc_switch.suite.yaml new file mode 100644 index 00000000..6b38360d --- /dev/null +++ b/tests/at/yaml/enc_switch/enc_switch.suite.yaml @@ -0,0 +1,49 @@ +name: enc_switch_suite +app: deepin-editor +module: enc_switch +setup: +- action: session_start + command: deepin-editor + wait: 3.0 +suites: +- id: suite_enc_switch_001_s1 + name: 编码切换 + description: '' + steps: + - step_type: action + action: keyboard_hot_key + key: ctrl+t + - step_type: action + action: dtk_dropdown_menu + selector: + accessible_id: PToolButton + items: + - GB18030 + - step_type: action + action: keyboard_type + text: UOS给世界更好的选择 + - step_type: action + action: element_action + selector: + accessible_id: PActUtf8 + do: click + - step_type: action + action: keyboard_press + key: enter + - step_type: action + action: keyboard_hot_key + key: ctrl+s + - step_type: action + action: file_dialog_select + path: /tmp/enc_switch_test.txt + wait: 3.0 + assert_steps: + - step_type: assert + action: assert_element + selector: + accessible_id: PTextEdit + - step_type: assert + action: assert_file_exists + path: /tmp/enc_switch_test.txt +teardown: +- action: session_stop