fusiontest 0.2.34__tar.gz → 0.2.35__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.
Files changed (58) hide show
  1. {fusiontest-0.2.34 → fusiontest-0.2.35}/PKG-INFO +1 -1
  2. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/action_model.py +1 -0
  3. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/goal_verifier.py +3 -1
  4. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/runner.py +43 -0
  5. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest.egg-info/PKG-INFO +1 -1
  6. {fusiontest-0.2.34 → fusiontest-0.2.35}/pyproject.toml +1 -1
  7. {fusiontest-0.2.34 → fusiontest-0.2.35}/README.md +0 -0
  8. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/__init__.py +0 -0
  9. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/bench/__init__.py +0 -0
  10. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/bench/sites/shop/bugs.js +0 -0
  11. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/bench/sites/shop/help.html +0 -0
  12. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/bench/sites/shop/index.html +0 -0
  13. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/bench/suites/shop-bugs.yaml +0 -0
  14. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/bench/suites/shop.yaml +0 -0
  15. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/bench/suites/todomvc.yaml +0 -0
  16. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/cli.py +0 -0
  17. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/__init__.py +0 -0
  18. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/app_errors.py +0 -0
  19. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/bugs.py +0 -0
  20. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/netguard.py +0 -0
  21. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/promise_checker.py +0 -0
  22. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/replay.py +0 -0
  23. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/reproduce.py +0 -0
  24. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/screen_parser.py +0 -0
  25. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/secrets.py +0 -0
  26. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/shared_traces.py +0 -0
  27. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/core/tokens.py +0 -0
  28. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/demos/__init__.py +0 -0
  29. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/demos/fusiontest_dashboard.yaml +0 -0
  30. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/demos/github.yaml +0 -0
  31. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/demos/hacker_news.yaml +0 -0
  32. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/demos/httpbin.yaml +0 -0
  33. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/demos/todomvc.yaml +0 -0
  34. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/demos/wikipedia.yaml +0 -0
  35. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/desktop/__init__.py +0 -0
  36. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/desktop/macos_adapter.py +0 -0
  37. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/desktop/playwright_adapter.py +0 -0
  38. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/desktop/windows_adapter.py +0 -0
  39. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/discovery/__init__.py +0 -0
  40. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/discovery/goal_generator.py +0 -0
  41. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/guardrails/__init__.py +0 -0
  42. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/guardrails/engine.py +0 -0
  43. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/mobile/__init__.py +0 -0
  44. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/mobile/android_adapter.py +0 -0
  45. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/mobile/ios_adapter.py +0 -0
  46. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/reporting/__init__.py +0 -0
  47. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/reporting/reporter.py +0 -0
  48. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/training/__init__.py +0 -0
  49. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/training/data_collector.py +0 -0
  50. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/training/dataset_builder.py +0 -0
  51. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest/training/trainer.py +0 -0
  52. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest.egg-info/SOURCES.txt +0 -0
  53. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest.egg-info/dependency_links.txt +0 -0
  54. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest.egg-info/entry_points.txt +0 -0
  55. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest.egg-info/not-zip-safe +0 -0
  56. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest.egg-info/requires.txt +0 -0
  57. {fusiontest-0.2.34 → fusiontest-0.2.35}/fusiontest.egg-info/top_level.txt +0 -0
  58. {fusiontest-0.2.34 → fusiontest-0.2.35}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fusiontest
3
- Version: 0.2.34
3
+ Version: 0.2.35
4
4
  Summary: AI-powered UI testing for mobile and desktop — by FusionLeap.io
5
5
  Author-email: FusionLeap <hello@fusionleap.io>
6
6
  License: MIT
@@ -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 based on what is currently visible on screen?",
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,38 @@ 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: up to a
1236
+ few lines that are new on `after` — elements that became selected/expanded
1237
+ first, then headings, then other text. Element indexes are ignored, since a
1238
+ re-render renumbers every element without anything visibly changing."""
1239
+ def lines(screen: str) -> list[str]:
1240
+ return [_ELEMENT_INDEX_RE.sub("", line).strip() for line in screen.splitlines()]
1241
+
1242
+ seen = set(lines(before))
1243
+ # An element that only lost its state (the tab that's no longer selected) isn't news.
1244
+ added = [line for line in dict.fromkeys(lines(after))
1245
+ if line and line not in seen and not line.startswith("-- ")
1246
+ and not any(line + w in seen for w in _STATE_WORDS)]
1247
+ if not added:
1248
+ return _NO_EFFECT_NOTE
1249
+
1250
+ def rank(line: str) -> int:
1251
+ if any(line.endswith(w) or f"{w} " in line for w in _STATE_WORDS):
1252
+ return 0
1253
+ return 1 if line.startswith("heading:") else 2
1254
+
1255
+ picked = sorted(added, key=rank)[:_CHANGE_NOTE_ITEMS]
1256
+ shown = [line if len(line) <= _CHANGE_NOTE_ITEM_CHARS else line[:_CHANGE_NOTE_ITEM_CHARS] + "…"
1257
+ for line in picked]
1258
+ return " → screen changed, now shows: " + "; ".join(shown)
1259
+
1217
1260
  # Recorded actions that are dropped from a trace when they didn't change the screen.
1218
1261
  _PRUNABLE_ACTIONS = {"tap", "scroll", "swipe", "wait"}
1219
1262
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fusiontest
3
- Version: 0.2.34
3
+ Version: 0.2.35
4
4
  Summary: AI-powered UI testing for mobile and desktop — by FusionLeap.io
5
5
  Author-email: FusionLeap <hello@fusionleap.io>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fusiontest"
7
- version = "0.2.34"
7
+ version = "0.2.35"
8
8
  description = "AI-powered UI testing for mobile and desktop — by FusionLeap.io"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes