From cd587dcdfb5f8eb5c13bf38881b7058585fa1c0d Mon Sep 17 00:00:00 2001 From: mataotao Date: Thu, 4 Dec 2025 15:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8Btest=5Fdde?= =?UTF-8?q?=5F1958393?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- case/test_dde_1958393.py | 33 +++++++++++++++++++++++++++++++++ dde.csv | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 case/test_dde_1958393.py diff --git a/case/test_dde_1958393.py b/case/test_dde_1958393.py new file mode 100644 index 0000000..49a11bd --- /dev/null +++ b/case/test_dde_1958393.py @@ -0,0 +1,33 @@ +from time import sleep +from src import Src +import pytest +import subprocess +from src import CmdCtl as Cmd + +from apps.dde_autotest_euler.case.base_case import BaseCase +from apps.dde_autotest_euler.method.dde_method import DdeMethod + + +def assert_process_status(code, app_name): + # 执行命令 + result = subprocess.run(f"ps -aux|grep {app_name}|grep -v grep", stdout=subprocess.PIPE,stderr=subprocess.PIPE, shell=True) + + if code != int(result.returncode): + raise AssertionError(f'断言应用进程状态{app_name}与期望{code}不符') + + +class TestDdeCase(BaseCase): + + def test_dde_1958393_1(self): + """终端打开Onboard""" + Cmd.run_cmd("/usr/bin/onboard &") + sleep(5) + assert_process_status(0, "/usr/bin/onboard") + + @pytest.fixture(autouse=True) + def clear(self): + DdeMethod().kill_process("/usr/bin/onboard") + yield + DdeMethod().kill_process("/usr/bin/onboard") + DdeMethod().click_restore() + DdeMethod().esc() diff --git a/dde.csv b/dde.csv index a61d624..8b16430 100644 --- a/dde.csv +++ b/dde.csv @@ -138,4 +138,5 @@ 1955475,,, 1956753,,, 1956757,,, -1956209,,, \ No newline at end of file +1956209,,, +1958393,,, \ No newline at end of file -- Gitee