From 36cca5ddb4bcc31f696ffc7902dc9796207d6ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=B9=BF=E7=94=9F?= Date: Thu, 11 Sep 2025 17:23:18 +0800 Subject: [PATCH] add xts test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 马广生 --- .../screenshot32/new_script/testcases.json | 4 ++++ .../new_script/testcases/test_xts.py | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 cases/smoke/basic/screenshot32/new_script/testcases/test_xts.py diff --git a/cases/smoke/basic/screenshot32/new_script/testcases.json b/cases/smoke/basic/screenshot32/new_script/testcases.json index e0cce51..ad416c1 100644 --- a/cases/smoke/basic/screenshot32/new_script/testcases.json +++ b/cases/smoke/basic/screenshot32/new_script/testcases.json @@ -58,5 +58,9 @@ { "case_file": "testcases/test_ui_hap.py", "description": "ui_hap包测试" + }, + { + "case_file": "testcases/test_xts.py", + "description": "xts测试" } ] \ No newline at end of file diff --git a/cases/smoke/basic/screenshot32/new_script/testcases/test_xts.py b/cases/smoke/basic/screenshot32/new_script/testcases/test_xts.py new file mode 100644 index 0000000..64779d4 --- /dev/null +++ b/cases/smoke/basic/screenshot32/new_script/testcases/test_xts.py @@ -0,0 +1,23 @@ +import logging +import os +import time +import re +import pytest + + +class Test: + + + @pytest.mark.parametrize('setup_teardown', [None], indirect=True) + def test(self, setup_teardown, device): + logging.info('ActsStartAbilityStaticTest.hap start') + hap_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(device.resource_path))), 'suites\acts\acts\testcases','ActsStartAbilityStaticTest.hap') + device.install_hap(hap_path) + output = device.hdc_shell('aa test -b com.acts.startabilitytest.static -m entry -s unittest /ets/testrunner/OpenHarmonyTestRunner -s timeout 15000') + run = re.search(r'run: (?P\d+),', output) + passed = re.search(r'Pass: (?P\d+),', output) + assert run, '失败' + assert passed, '失败' + run_num = int(run.group('run')) + passed_num = int(passed.group('pass')) + assert run_num == passed_num, '失败' -- Gitee