test: 将卸载测试移至单独文件并优化关闭逻辑

将test_mumu.py中的卸载测试移至单独的test_uninstall.py文件
在卸载测试中添加模拟器关闭操作
移除test_mumu.py中冗余的关闭模拟器测试
This commit is contained in:
2026-03-12 21:50:46 +08:00
parent 7ef91abee1
commit beb885f77c
5 changed files with 23 additions and 18 deletions

View File

@@ -49,21 +49,3 @@ def test_run_sequence(emulator):
pytest.skip("模拟器未运行")
emulator.run_sequence()
def test_close_emulator(emulator):
"""测试关闭模拟器"""
time.sleep(3)
if emulator.is_running():
emulator.close()
assert not emulator.is_running(), "模拟器关闭失败"
def test_uninstall_app(emulator):
"""测试卸载 flomo app"""
time.sleep(3)
if not emulator.is_running():
pytest.skip("模拟器未运行")
result = emulator.uninstall_app_ui()
assert result, "卸载 app 失败"

View File

@@ -0,0 +1,23 @@
"""
Mumu模拟器测试 - 卸载测试(结尾)
"""
import pytest
import pyautogui
import time
def test_uninstall_app(emulator):
"""测试卸载 flomo app"""
time.sleep(3)
if not emulator.is_running():
pytest.skip("模拟器未运行")
result = emulator.uninstall_app_ui()
assert result, "卸载 app 失败"
time.sleep(2)
emulator.bring_to_front()
time.sleep(1)
pyautogui.hotkey("alt", "f4")
print("已按 Alt+F4 关闭模拟器")