Introduce complete test coverage for the ARTEMIS platform across multiple layers: Unit tests: Add tests for agent nodes (Planner, Operator, Validator, Diagnoser, FlashRunner, Explorer), tools, utils (OCR/XML fusion, UI hierarchy), and data engine. Integration tests: Add live tool verification, reactive runner, IME, and standalone workflow tests. E2E tests: Add end-to-end scenario tests for media playback and failure recovery flows. Fixtures & mocks: Add mock inputs (audio, video, screenshot) and test utilities.
31 lines
782 B
Python
31 lines
782 B
Python
import asyncio
|
|
import pytest
|
|
from artemis.context import ArtemisContext, DeviceContext, DevicePlatform
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_artemis_context_waits_for_background_tasks():
|
|
device = DeviceContext(
|
|
host_platform="LINUX",
|
|
mobile_platform=DevicePlatform.ANDROID,
|
|
device_id="dummy",
|
|
device_width=1080,
|
|
device_height=2400,
|
|
)
|
|
|
|
context = ArtemisContext(device=device)
|
|
|
|
task_run = False
|
|
|
|
async def dummy_task():
|
|
nonlocal task_run
|
|
await asyncio.sleep(0.1)
|
|
task_run = True
|
|
|
|
async with context:
|
|
task = asyncio.create_task(dummy_task())
|
|
context.background_tasks.append(task)
|
|
|
|
# After exiting the context, the task should have run to completion
|
|
assert task_run is True
|