diff --git a/cases/smoke/basic/screenshot32/new_script/testcases.json b/cases/smoke/basic/screenshot32/new_script/testcases.json index e0cce51227d5e4313aa49499215683b0e50ac3c9..ad416c129bf7258e3551c16d151f00d17fc8ecbe 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 0000000000000000000000000000000000000000..64779d4a24e2fda54a1ff4330bab155d03b52337 --- /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, '失败'