fusiontest 0.2.34__tar.gz → 0.2.36__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.34 → fusiontest-0.2.36}/PKG-INFO +1 -1
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/action_model.py +1 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/goal_verifier.py +3 -1
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/runner.py +59 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest.egg-info/PKG-INFO +1 -1
- {fusiontest-0.2.34 → fusiontest-0.2.36}/pyproject.toml +1 -1
- {fusiontest-0.2.34 → fusiontest-0.2.36}/README.md +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/bench/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/bench/sites/shop/bugs.js +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/bench/sites/shop/help.html +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/bench/sites/shop/index.html +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/bench/suites/shop-bugs.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/bench/suites/shop.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/bench/suites/todomvc.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/cli.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/app_errors.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/bugs.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/netguard.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/promise_checker.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/replay.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/reproduce.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/screen_parser.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/secrets.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/shared_traces.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/core/tokens.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/demos/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/demos/fusiontest_dashboard.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/demos/github.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/demos/hacker_news.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/demos/httpbin.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/demos/todomvc.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/demos/wikipedia.yaml +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/desktop/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/desktop/macos_adapter.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/desktop/playwright_adapter.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/desktop/windows_adapter.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/discovery/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/discovery/goal_generator.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/guardrails/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/guardrails/engine.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/mobile/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/mobile/android_adapter.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/mobile/ios_adapter.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/reporting/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/reporting/reporter.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/training/__init__.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/training/data_collector.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/training/dataset_builder.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest/training/trainer.py +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest.egg-info/SOURCES.txt +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest.egg-info/dependency_links.txt +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest.egg-info/entry_points.txt +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest.egg-info/not-zip-safe +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest.egg-info/requires.txt +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/fusiontest.egg-info/top_level.txt +0 -0
- {fusiontest-0.2.34 → fusiontest-0.2.36}/setup.cfg +0 -0
|
@@ -1049,6 +1049,7 @@ class ActionModel(LLMCaller):
|
|
|
1049
1049
|
"- If the goal is purely about VERIFYING or CHECKING that something is visible, and the relevant content IS already visible on screen, use action_type 'done' with a reasoning explaining what you see.",
|
|
1050
1050
|
"- If the goal cannot be satisfied with the current screen (wrong page, required control missing, blocker, etc.), use action_type 'fail' with a short reasoning. NEVER use 'done' for failure or 'not achievable' outcomes.",
|
|
1051
1051
|
"- If the goal requires navigation or interaction, use the appropriate action.",
|
|
1052
|
+
"- Each action taken so far notes what it changed on screen (→ …). That is what you observed: once those notes show what the goal asks you to verify, use 'done' rather than repeating actions to check again.",
|
|
1052
1053
|
"- Match elements FLEXIBLY: if the goal says 'click Visitor Identification' but you see a link like 'Anonymous Visitors Unknown' or a link with href containing 'visitor-identification', those are the same thing. Use the element that's actually on screen.",
|
|
1053
1054
|
"- When the goal says 'navigate back', use the 'back' action type, not look for a back button.",
|
|
1054
1055
|
"- 'type' replaces the field's whole content (value \"\" clears it) and only fills it. To submit it (search boxes, add-item inputs, forms without a visible submit button), next use 'press' with value 'Enter' on the same element. 'press' also takes Escape, Tab, ArrowDown, ArrowUp.",
|
|
@@ -217,7 +217,9 @@ class GoalVerifier:
|
|
|
217
217
|
parts += ["", "ACTIONS TAKEN:", *[f" - {a}" for a in history[-5:]]]
|
|
218
218
|
parts += [
|
|
219
219
|
"",
|
|
220
|
-
"Has the goal been achieved
|
|
220
|
+
"Has the goal been achieved, judging by what is visible on screen now and by "
|
|
221
|
+
"what the actions above changed (each \"→\" note is what was observed on "
|
|
222
|
+
"screen right after that action)?",
|
|
221
223
|
]
|
|
222
224
|
return "\n".join(parts)
|
|
223
225
|
|
|
@@ -13,6 +13,7 @@ The FusionTest main runner — orchestrates the full test loop:
|
|
|
13
13
|
from __future__ import annotations
|
|
14
14
|
|
|
15
15
|
import logging
|
|
16
|
+
import re
|
|
16
17
|
import threading
|
|
17
18
|
import time
|
|
18
19
|
from collections.abc import Callable
|
|
@@ -513,6 +514,7 @@ class FusionTestRunner:
|
|
|
513
514
|
prev_screen: str | None = None # screen at the previous step
|
|
514
515
|
stalled = 0 # consecutive steps with an unchanged screen
|
|
515
516
|
last_typed = False # the previous step typed into a field
|
|
517
|
+
acted = False # the previous step executed an action
|
|
516
518
|
# Each executed action with the screens before and after it, for the
|
|
517
519
|
# broken-promise check (ADR-009). pending: an action awaiting its "after".
|
|
518
520
|
transitions: list[Transition] = []
|
|
@@ -551,8 +553,16 @@ class FusionTestRunner:
|
|
|
551
553
|
history[-1] += _NO_EFFECT_NOTE
|
|
552
554
|
else:
|
|
553
555
|
stalled = 0
|
|
556
|
+
# Say what the last action changed. The model sees only the
|
|
557
|
+
# current screen, so without this a goal like "verify each tab
|
|
558
|
+
# updates the content" has no record of the updates it caused,
|
|
559
|
+
# and it keeps re-clicking to check (seen: Phase 0 ↔ Phase 1 for
|
|
560
|
+
# 10 steps on fusionleap.io/how-we-work).
|
|
561
|
+
if acted and prev_screen is not None and history:
|
|
562
|
+
history[-1] += _change_note(prev_screen, screen_text)
|
|
554
563
|
prev_screen = screen_text
|
|
555
564
|
last_typed = False
|
|
565
|
+
acted = False
|
|
556
566
|
if stalled >= self.config.max_stalled_steps:
|
|
557
567
|
logger.info(f" No progress for {stalled} steps — stopping this goal")
|
|
558
568
|
self._last_chance_verify(
|
|
@@ -684,6 +694,7 @@ class FusionTestRunner:
|
|
|
684
694
|
success = self.adapter.execute(exec_action, elements)
|
|
685
695
|
if success:
|
|
686
696
|
last_typed = gr.action.action_type == "type"
|
|
697
|
+
acted = True
|
|
687
698
|
recorded.append(record_action(gr.action, elements)) # placeholders, not values
|
|
688
699
|
last_action_screen = screen_text
|
|
689
700
|
# Which row the control was in ("Remove" near "Notebook × 1"):
|
|
@@ -1214,6 +1225,54 @@ class FusionTestRunner:
|
|
|
1214
1225
|
# Appended to the model's history entry for an action that changed nothing.
|
|
1215
1226
|
_NO_EFFECT_NOTE = " → no visible change on screen"
|
|
1216
1227
|
|
|
1228
|
+
_ELEMENT_INDEX_RE = re.compile(r"^\s*\[\d+\]\s*")
|
|
1229
|
+
_STATE_WORDS = (" selected", " expanded", " checked", " pressed")
|
|
1230
|
+
_CHANGE_NOTE_ITEMS = 3
|
|
1231
|
+
_CHANGE_NOTE_ITEM_CHARS = 70
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
def _change_note(before: str, after: str) -> str:
|
|
1235
|
+
"""What an action changed on screen, for the model's history entry, in up to
|
|
1236
|
+
a few items: elements that became selected/expanded, new headings, other new
|
|
1237
|
+
text. When nothing gained a state, elements that lost one ("no longer
|
|
1238
|
+
expanded": a collapsed accordion); then, if there's room, text that's gone.
|
|
1239
|
+
Element indexes are ignored, since a re-render renumbers every element
|
|
1240
|
+
without anything visibly changing."""
|
|
1241
|
+
def lines(screen: str) -> list[str]:
|
|
1242
|
+
return list(dict.fromkeys(_ELEMENT_INDEX_RE.sub("", line).strip() for line in screen.splitlines()))
|
|
1243
|
+
|
|
1244
|
+
def state_of(line: str) -> str:
|
|
1245
|
+
return next((w.strip() for w in _STATE_WORDS if line.endswith(w) or f"{w} " in line), "")
|
|
1246
|
+
|
|
1247
|
+
old, new = lines(before), lines(after)
|
|
1248
|
+
old_set, new_set = set(old), set(new)
|
|
1249
|
+
lost_state = {line: w.strip() for line in new for w in _STATE_WORDS
|
|
1250
|
+
if line not in old_set and line + w in old_set}
|
|
1251
|
+
added = [line for line in new
|
|
1252
|
+
if line and line not in old_set and not line.startswith("-- ") and line not in lost_state]
|
|
1253
|
+
gone = [line for line in old
|
|
1254
|
+
if line and line not in new_set and not line.startswith("-- ") and not state_of(line)
|
|
1255
|
+
and not any(line + w in new_set for w in _STATE_WORDS)] # just gained a state
|
|
1256
|
+
|
|
1257
|
+
def cut(line: str) -> str:
|
|
1258
|
+
if len(line) <= _CHANGE_NOTE_ITEM_CHARS:
|
|
1259
|
+
return line
|
|
1260
|
+
state = next((w for w in _STATE_WORDS if line.endswith(w)), "") # keep "… expanded" whole
|
|
1261
|
+
return line[:_CHANGE_NOTE_ITEM_CHARS] + "…" + state
|
|
1262
|
+
|
|
1263
|
+
gained = [line for line in added if state_of(line)]
|
|
1264
|
+
items = gained + [line for line in added if line.startswith("heading:") and line not in gained]
|
|
1265
|
+
items += [line for line in added if line not in items]
|
|
1266
|
+
if not gained:
|
|
1267
|
+
# A tab switch also deselects the old tab; only say so when nothing was selected.
|
|
1268
|
+
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[:_CHANGE_NOTE_ITEMS]]
|
|
1270
|
+
if len(items) < _CHANGE_NOTE_ITEMS and gone:
|
|
1271
|
+
items.append(f"gone: {cut(gone[0])}")
|
|
1272
|
+
if not items:
|
|
1273
|
+
return _NO_EFFECT_NOTE
|
|
1274
|
+
return " → screen changed: " + "; ".join(items)
|
|
1275
|
+
|
|
1217
1276
|
# Recorded actions that are dropped from a trace when they didn't change the screen.
|
|
1218
1277
|
_PRUNABLE_ACTIONS = {"tap", "scroll", "swipe", "wait"}
|
|
1219
1278
|
|
|
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
|