test: 将卸载测试移至单独文件并优化关闭逻辑
将test_mumu.py中的卸载测试移至单独的test_uninstall.py文件 在卸载测试中添加模拟器关闭操作 移除test_mumu.py中冗余的关闭模拟器测试
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -49,21 +49,3 @@ def test_run_sequence(emulator):
|
|||||||
pytest.skip("模拟器未运行")
|
pytest.skip("模拟器未运行")
|
||||||
|
|
||||||
emulator.run_sequence()
|
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 失败"
|
|
||||||
|
|||||||
23
mumu-pytest/test_uninstall.py
Normal file
23
mumu-pytest/test_uninstall.py
Normal 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 关闭模拟器")
|
||||||
Reference in New Issue
Block a user