fusiontest 0.2.37__tar.gz → 0.2.39__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fusiontest-0.2.37 → fusiontest-0.2.39}/PKG-INFO +1 -1
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/action_model.py +9 -3
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/runner.py +37 -9
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest.egg-info/PKG-INFO +1 -1
- {fusiontest-0.2.37 → fusiontest-0.2.39}/pyproject.toml +1 -1
- {fusiontest-0.2.37 → fusiontest-0.2.39}/README.md +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/bench/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/bench/sites/shop/bugs.js +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/bench/sites/shop/help.html +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/bench/sites/shop/index.html +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/bench/suites/shop-bugs.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/bench/suites/shop.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/bench/suites/todomvc.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/cli.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/app_errors.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/bugs.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/goal_verifier.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/netguard.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/promise_checker.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/replay.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/reproduce.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/screen_parser.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/secrets.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/shared_traces.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/core/tokens.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/demos/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/demos/fusiontest_dashboard.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/demos/github.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/demos/hacker_news.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/demos/httpbin.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/demos/todomvc.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/demos/wikipedia.yaml +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/desktop/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/desktop/macos_adapter.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/desktop/playwright_adapter.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/desktop/windows_adapter.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/discovery/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/discovery/goal_generator.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/guardrails/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/guardrails/engine.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/mobile/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/mobile/android_adapter.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/mobile/ios_adapter.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/reporting/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/reporting/reporter.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/training/__init__.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/training/data_collector.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/training/dataset_builder.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest/training/trainer.py +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest.egg-info/SOURCES.txt +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest.egg-info/dependency_links.txt +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest.egg-info/entry_points.txt +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest.egg-info/not-zip-safe +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest.egg-info/requires.txt +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/fusiontest.egg-info/top_level.txt +0 -0
- {fusiontest-0.2.37 → fusiontest-0.2.39}/setup.cfg +0 -0
|
@@ -283,6 +283,11 @@ LLM_REQUEST_TIMEOUT_SECONDS = 120
|
|
|
283
283
|
_ACTION_CONTENT_CHARS = 1500
|
|
284
284
|
_ACTION_LABEL_CHARS = 80
|
|
285
285
|
_ACTION_ELEMENT_CHARS = 120
|
|
286
|
+
# A long label keeps its end too: cards that are one big link end with the call
|
|
287
|
+
# to action ("… 12 weeks See the engagement"), and a goal that names it must
|
|
288
|
+
# still match the element (seen on fusionleap.io: the model hunted for a
|
|
289
|
+
# separate "See the engagement" link after tapping the card).
|
|
290
|
+
_ACTION_ELEMENT_TAIL_CHARS = 40
|
|
286
291
|
_CONTENT_LINE_RE = re.compile(r'^\s*(\w+): "(.*)"$')
|
|
287
292
|
_ELEMENT_LINE_RE = re.compile(r'^\s*\[\d+\] ')
|
|
288
293
|
|
|
@@ -291,8 +296,8 @@ def compact_screen_for_action(screen_text: str) -> str:
|
|
|
291
296
|
"""Trim a screen's page-content section for the per-step action prompt.
|
|
292
297
|
|
|
293
298
|
Every interactive element is kept (the model can only act on what it sees),
|
|
294
|
-
but very long labels — e.g. list items holding whole paragraphs — are cut
|
|
295
|
-
the model acts by index. In the page content, headings are kept whole,
|
|
299
|
+
but very long labels — e.g. list items holding whole paragraphs — are cut in
|
|
300
|
+
the middle, keeping both ends: the model acts by index. In the page content, headings are kept whole,
|
|
296
301
|
other text is cut to 80 characters, and the section stops at ~1,500 characters.
|
|
297
302
|
"""
|
|
298
303
|
lines: list[str] = []
|
|
@@ -306,7 +311,8 @@ def compact_screen_for_action(screen_text: str) -> str:
|
|
|
306
311
|
if not in_content:
|
|
307
312
|
if (len(line) > _ACTION_ELEMENT_CHARS and _ELEMENT_LINE_RE.match(line)
|
|
308
313
|
and " options: " not in line): # a picker's choices must stay visible
|
|
309
|
-
|
|
314
|
+
head = _ACTION_ELEMENT_CHARS - _ACTION_ELEMENT_TAIL_CHARS
|
|
315
|
+
line = line[:head] + "…" + line[-_ACTION_ELEMENT_TAIL_CHARS:]
|
|
310
316
|
lines.append(line)
|
|
311
317
|
continue
|
|
312
318
|
match = _CONTENT_LINE_RE.match(line)
|
|
@@ -19,6 +19,7 @@ import time
|
|
|
19
19
|
from collections.abc import Callable
|
|
20
20
|
from dataclasses import dataclass, field, replace
|
|
21
21
|
from typing import Protocol, runtime_checkable
|
|
22
|
+
from urllib.parse import urlsplit
|
|
22
23
|
|
|
23
24
|
from fusiontest.core import bugs
|
|
24
25
|
from fusiontest.core.action_model import Action, ActionBackend, ActionModel, LLMUnavailableError
|
|
@@ -1227,19 +1228,32 @@ _NO_EFFECT_NOTE = " → no visible change on screen"
|
|
|
1227
1228
|
|
|
1228
1229
|
_ELEMENT_INDEX_RE = re.compile(r"^\s*\[\d+\]\s*")
|
|
1229
1230
|
_STATE_WORDS = (" selected", " expanded", " checked", " pressed")
|
|
1231
|
+
_PAGE_HEADER_PREFIXES = ("=== PAGE: ", "URL: ") # PlaywrightAdapter.get_screen's first lines
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
def _page_of(screen: str) -> tuple[str, str]:
|
|
1235
|
+
"""(title, url) from a screen's page header; empty strings where it has none."""
|
|
1236
|
+
title = url = ""
|
|
1237
|
+
for line in screen.splitlines()[:5]:
|
|
1238
|
+
if line.startswith("=== PAGE: "):
|
|
1239
|
+
title = line[len("=== PAGE: "):].removesuffix("===").strip()
|
|
1240
|
+
elif line.startswith("URL: "):
|
|
1241
|
+
url = line[len("URL: "):].strip()
|
|
1242
|
+
return title, url
|
|
1230
1243
|
_CHANGE_NOTE_ITEMS = 3
|
|
1231
1244
|
_CHANGE_NOTE_ITEM_CHARS = 70
|
|
1232
1245
|
|
|
1233
1246
|
|
|
1234
1247
|
def _change_note(before: str, after: str) -> str:
|
|
1235
1248
|
"""What an action changed on screen, for the model's history entry, in up to
|
|
1236
|
-
a few items:
|
|
1237
|
-
text. When nothing gained a state,
|
|
1238
|
-
expanded": a collapsed accordion); then,
|
|
1239
|
-
Element indexes are ignored, since a
|
|
1240
|
-
without anything visibly changing."""
|
|
1249
|
+
a few items: the page it's now on, if that changed; elements that became
|
|
1250
|
+
selected/expanded, new headings, other new text. When nothing gained a state,
|
|
1251
|
+
elements that lost one ("no longer expanded": a collapsed accordion); then,
|
|
1252
|
+
if there's room, text that's gone. Element indexes are ignored, since a
|
|
1253
|
+
re-render renumbers every element without anything visibly changing."""
|
|
1241
1254
|
def lines(screen: str) -> list[str]:
|
|
1242
|
-
return list(dict.fromkeys(_ELEMENT_INDEX_RE.sub("", line).strip() for line in screen.splitlines()
|
|
1255
|
+
return list(dict.fromkeys(_ELEMENT_INDEX_RE.sub("", line).strip() for line in screen.splitlines()
|
|
1256
|
+
if not line.startswith(_PAGE_HEADER_PREFIXES)))
|
|
1243
1257
|
|
|
1244
1258
|
def state_of(line: str) -> str:
|
|
1245
1259
|
return next((w.strip() for w in _STATE_WORDS if line.endswith(w) or f"{w} " in line), "")
|
|
@@ -1258,7 +1272,7 @@ def _change_note(before: str, after: str) -> str:
|
|
|
1258
1272
|
if len(line) <= _CHANGE_NOTE_ITEM_CHARS:
|
|
1259
1273
|
return line
|
|
1260
1274
|
state = next((w for w in _STATE_WORDS if line.endswith(w)), "") # keep "… expanded" whole
|
|
1261
|
-
return line[:_CHANGE_NOTE_ITEM_CHARS] + "…" + state
|
|
1275
|
+
return line[:len(line) - len(state)][:_CHANGE_NOTE_ITEM_CHARS] + "…" + state
|
|
1262
1276
|
|
|
1263
1277
|
gained = [line for line in added if state_of(line)]
|
|
1264
1278
|
items = gained + [line for line in added if line.startswith("heading:") and line not in gained]
|
|
@@ -1266,7 +1280,22 @@ def _change_note(before: str, after: str) -> str:
|
|
|
1266
1280
|
if not gained:
|
|
1267
1281
|
# A tab switch also deselects the old tab; only say so when nothing was selected.
|
|
1268
1282
|
items = [f"{cut(line)} — no longer {w}" for line, w in lost_state.items()] + items
|
|
1269
|
-
items = [item if " — no longer " in item else cut(item) for item in items
|
|
1283
|
+
items = [item if " — no longer " in item else cut(item) for item in items]
|
|
1284
|
+
# Landing on another page (or another part of one: /services#pricing) matters
|
|
1285
|
+
# most — without it a model that followed a link can't tell it got anywhere.
|
|
1286
|
+
page = _page_of(after)
|
|
1287
|
+
if page != _page_of(before) and page != ("", ""):
|
|
1288
|
+
title, url = page
|
|
1289
|
+
parts = urlsplit(url)
|
|
1290
|
+
where = parts.path or "/"
|
|
1291
|
+
if parts.query:
|
|
1292
|
+
where += "?" + parts.query
|
|
1293
|
+
if parts.fragment:
|
|
1294
|
+
where += "#" + parts.fragment
|
|
1295
|
+
if parts.netloc != urlsplit(_page_of(before)[1]).netloc:
|
|
1296
|
+
where = parts.netloc + where
|
|
1297
|
+
items.insert(0, f'now on "{cut(title)}" ({where})' if title else f"now on {where}")
|
|
1298
|
+
items = items[:_CHANGE_NOTE_ITEMS]
|
|
1270
1299
|
if len(items) < _CHANGE_NOTE_ITEMS and gone:
|
|
1271
1300
|
items.append(f"gone: {cut(gone[0])}")
|
|
1272
1301
|
if not items:
|
|
@@ -1332,6 +1361,5 @@ def _current_url(adapter: object) -> str:
|
|
|
1332
1361
|
|
|
1333
1362
|
def _current_host(adapter: object) -> str:
|
|
1334
1363
|
"""Hostname of the adapter's current page, or "" if it can't be determined."""
|
|
1335
|
-
from urllib.parse import urlsplit # noqa: PLC0415
|
|
1336
1364
|
|
|
1337
1365
|
return (urlsplit(_current_url(adapter)).hostname or "").lower()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|