Implement Apex Agent MVP scaffold
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from core.models import Bounds, Scene, SceneElement
|
||||
from tools.find_icon import find_icon
|
||||
from tools.find_text import find_text
|
||||
|
||||
|
||||
def test_find_text_found_and_not_found() -> None:
|
||||
scene = Scene(
|
||||
width=100,
|
||||
height=100,
|
||||
elements=[
|
||||
SceneElement(
|
||||
id="button",
|
||||
type="button",
|
||||
text="Search",
|
||||
bounds=Bounds(10, 20, 40, 20),
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
assert find_text(scene, "sea")["found"] is True
|
||||
assert find_text(scene, "missing") == {
|
||||
"found": False,
|
||||
"query": "missing",
|
||||
"reason": "not found",
|
||||
}
|
||||
|
||||
|
||||
def test_find_icon_found_and_not_found() -> None:
|
||||
scene = Scene(
|
||||
width=100,
|
||||
height=100,
|
||||
elements=[
|
||||
SceneElement(
|
||||
id="settings-icon",
|
||||
type="image",
|
||||
text="Settings",
|
||||
bounds=Bounds(50, 50, 20, 20),
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
assert find_icon(scene, "settings")["found"] is True
|
||||
assert find_icon(scene, "profile")["reason"] == "not found"
|
||||
|
||||
Reference in New Issue
Block a user