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