fusiontest 0.2.18__tar.gz → 0.2.20__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.18 → fusiontest-0.2.20}/PKG-INFO +7 -4
- {fusiontest-0.2.18 → fusiontest-0.2.20}/README.md +5 -3
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/cli.py +78 -4
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/replay.py +20 -2
- fusiontest-0.2.20/fusiontest/core/shared_traces.py +70 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest.egg-info/PKG-INFO +7 -4
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest.egg-info/SOURCES.txt +1 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest.egg-info/requires.txt +1 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/pyproject.toml +2 -1
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/bench/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/bench/sites/shop/index.html +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/bench/suites/shop.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/bench/suites/todomvc.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/action_model.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/goal_verifier.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/netguard.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/runner.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/screen_parser.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/secrets.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/core/tokens.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/demos/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/demos/fusiontest_dashboard.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/demos/github.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/demos/hacker_news.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/demos/httpbin.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/demos/todomvc.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/demos/wikipedia.yaml +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/desktop/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/desktop/macos_adapter.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/desktop/playwright_adapter.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/desktop/windows_adapter.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/discovery/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/discovery/goal_generator.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/guardrails/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/guardrails/engine.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/mobile/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/mobile/android_adapter.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/mobile/ios_adapter.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/reporting/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/reporting/reporter.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/training/__init__.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/training/data_collector.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/training/dataset_builder.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest/training/trainer.py +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest.egg-info/dependency_links.txt +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest.egg-info/entry_points.txt +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest.egg-info/not-zip-safe +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/fusiontest.egg-info/top_level.txt +0 -0
- {fusiontest-0.2.18 → fusiontest-0.2.20}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fusiontest
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.20
|
|
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
|
|
@@ -47,6 +47,7 @@ Requires-Dist: python-jose[cryptography]>=3.3; extra == "api"
|
|
|
47
47
|
Requires-Dist: cryptography>=42; extra == "api"
|
|
48
48
|
Requires-Dist: passlib[bcrypt]>=1.7; extra == "api"
|
|
49
49
|
Requires-Dist: psycopg2-binary>=2.9; extra == "api"
|
|
50
|
+
Requires-Dist: boto3>=1.34; extra == "api"
|
|
50
51
|
Provides-Extra: training
|
|
51
52
|
Requires-Dist: sentence-transformers>=2.7; extra == "training"
|
|
52
53
|
Requires-Dist: torch>=2.2; extra == "training"
|
|
@@ -98,7 +99,7 @@ without calling the AI at all.
|
|
|
98
99
|
| Multi-provider LLMs | Groq, Claude, Gemini, OpenAI or local Ollama, with automatic fallback |
|
|
99
100
|
| Safe secrets | `{{PASSWORD}}` placeholders — the AI never sees values, which are only typed on allowed sites |
|
|
100
101
|
| Guardrails | Invalid-action checks, loop detection, backtracking, no-progress detection |
|
|
101
|
-
| Reporting | JSON reports, dashboard uploads, Slack, GitHub Actions annotations, webhooks |
|
|
102
|
+
| Reporting | JSON reports, dashboard uploads, failure screenshots, Slack, GitHub Actions annotations, webhooks |
|
|
102
103
|
| Platforms | Web (Playwright), Electron, Android & iOS (Appium), Windows, macOS |
|
|
103
104
|
|
|
104
105
|
---
|
|
@@ -202,8 +203,10 @@ replay:
|
|
|
202
203
|
|
|
203
204
|
## 🔌 CI/CD
|
|
204
205
|
|
|
205
|
-
Run `fusiontest run --headless` in any CI system
|
|
206
|
-
|
|
206
|
+
Run `fusiontest run --headless` in any CI system. With `FUSIONTEST_API_KEY`
|
|
207
|
+
set, replay recordings are shared through your FusionTest account (laptop, CI
|
|
208
|
+
and dashboard all replay each other's passing goals); without it, cache
|
|
209
|
+
`.fusiontest/traces`. Guides for GitHub Actions, Bitrise,
|
|
207
210
|
Fastlane and Jenkins: [docs/ci-integrations.md](docs/ci-integrations.md).
|
|
208
211
|
|
|
209
212
|
---
|
|
@@ -20,7 +20,7 @@ without calling the AI at all.
|
|
|
20
20
|
| Multi-provider LLMs | Groq, Claude, Gemini, OpenAI or local Ollama, with automatic fallback |
|
|
21
21
|
| Safe secrets | `{{PASSWORD}}` placeholders — the AI never sees values, which are only typed on allowed sites |
|
|
22
22
|
| Guardrails | Invalid-action checks, loop detection, backtracking, no-progress detection |
|
|
23
|
-
| Reporting | JSON reports, dashboard uploads, Slack, GitHub Actions annotations, webhooks |
|
|
23
|
+
| Reporting | JSON reports, dashboard uploads, failure screenshots, Slack, GitHub Actions annotations, webhooks |
|
|
24
24
|
| Platforms | Web (Playwright), Electron, Android & iOS (Appium), Windows, macOS |
|
|
25
25
|
|
|
26
26
|
---
|
|
@@ -124,8 +124,10 @@ replay:
|
|
|
124
124
|
|
|
125
125
|
## 🔌 CI/CD
|
|
126
126
|
|
|
127
|
-
Run `fusiontest run --headless` in any CI system
|
|
128
|
-
|
|
127
|
+
Run `fusiontest run --headless` in any CI system. With `FUSIONTEST_API_KEY`
|
|
128
|
+
set, replay recordings are shared through your FusionTest account (laptop, CI
|
|
129
|
+
and dashboard all replay each other's passing goals); without it, cache
|
|
130
|
+
`.fusiontest/traces`. Guides for GitHub Actions, Bitrise,
|
|
129
131
|
Fastlane and Jenkins: [docs/ci-integrations.md](docs/ci-integrations.md).
|
|
130
132
|
|
|
131
133
|
---
|
|
@@ -32,6 +32,7 @@ console = Console()
|
|
|
32
32
|
# Replay recordings for `fusiontest run` (ADR-007). No secret values are stored —
|
|
33
33
|
# safe to commit or cache in CI so later runs can replay.
|
|
34
34
|
DEFAULT_TRACE_DIR = ".fusiontest/traces"
|
|
35
|
+
DEFAULT_SCREENSHOT_DIR = ".fusiontest/screenshots"
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
@click.group()
|
|
@@ -132,7 +133,6 @@ def run(goal, goal_file, platform, app, url, locale, backend, headless, output,
|
|
|
132
133
|
_fd, _step_log_tmp = tempfile.mkstemp(suffix=".jsonl", prefix="ft-steps-")
|
|
133
134
|
_os.close(_fd)
|
|
134
135
|
|
|
135
|
-
from fusiontest.core.replay import FileTraceStore
|
|
136
136
|
from fusiontest.core.runner import FusionTestRunner, RunnerConfig
|
|
137
137
|
from fusiontest.guardrails.engine import GuardrailsConfig
|
|
138
138
|
|
|
@@ -175,7 +175,7 @@ def run(goal, goal_file, platform, app, url, locale, backend, headless, output,
|
|
|
175
175
|
screenshot_on_failure=True,
|
|
176
176
|
step_log_path=_step_log_tmp,
|
|
177
177
|
secrets=cfg_secrets,
|
|
178
|
-
trace_store=
|
|
178
|
+
trace_store=_trace_store(Path(trace_dir), bool(replay_cfg.get("shared", True))),
|
|
179
179
|
# 0 = never replay: every goal goes through the LLM and re-records.
|
|
180
180
|
reverify_every=reverify_every if replay else 0,
|
|
181
181
|
)
|
|
@@ -229,8 +229,11 @@ def run(goal, goal_file, platform, app, url, locale, backend, headless, output,
|
|
|
229
229
|
finally:
|
|
230
230
|
progress.stop()
|
|
231
231
|
|
|
232
|
+
# Failure screenshots: saved next to the project, shown in the results.
|
|
233
|
+
shots = _save_screenshots(result, Path(cfg.get("screenshots", {}).get("dir", DEFAULT_SCREENSHOT_DIR)))
|
|
234
|
+
|
|
232
235
|
# Print results table, then Slack / GitHub annotations if configured
|
|
233
|
-
_print_results(result)
|
|
236
|
+
_print_results(result, shots)
|
|
234
237
|
_notify(result)
|
|
235
238
|
|
|
236
239
|
# Save JSON report locally
|
|
@@ -240,6 +243,8 @@ def run(goal, goal_file, platform, app, url, locale, backend, headless, output,
|
|
|
240
243
|
|
|
241
244
|
# Upload report to FusionTest dashboard
|
|
242
245
|
uploaded_run_id = _upload_report(result)
|
|
246
|
+
if uploaded_run_id and shots and cfg.get("screenshots", {}).get("upload", True):
|
|
247
|
+
_upload_screenshots(uploaded_run_id, shots)
|
|
243
248
|
|
|
244
249
|
# Upload step telemetry (best-effort, non-blocking)
|
|
245
250
|
if _api_key and _step_log_tmp:
|
|
@@ -253,6 +258,48 @@ def run(goal, goal_file, platform, app, url, locale, backend, headless, output,
|
|
|
253
258
|
sys.exit(_exit_code(result))
|
|
254
259
|
|
|
255
260
|
|
|
261
|
+
def _save_screenshots(result, root: Path) -> dict[int, Path]:
|
|
262
|
+
"""Write each failed goal's screenshot to <root>/<time>/<NN>-<goal>.png.
|
|
263
|
+
Returns {goal index: path}."""
|
|
264
|
+
import re
|
|
265
|
+
from datetime import datetime, timezone
|
|
266
|
+
|
|
267
|
+
failed = [(i, s) for i, s in enumerate(result.steps) if not s.success and s.screenshots]
|
|
268
|
+
if not failed:
|
|
269
|
+
return {}
|
|
270
|
+
run_dir = root / datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
|
|
271
|
+
run_dir.mkdir(parents=True, exist_ok=True)
|
|
272
|
+
saved: dict[int, Path] = {}
|
|
273
|
+
for i, step in failed:
|
|
274
|
+
slug = re.sub(r"[^a-z0-9]+", "-", step.goal.lower()).strip("-")[:50] or "goal"
|
|
275
|
+
path = run_dir / f"{i + 1:02d}-{slug}.png"
|
|
276
|
+
path.write_bytes(step.screenshots[-1])
|
|
277
|
+
saved[i] = path
|
|
278
|
+
return saved
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def _upload_screenshots(run_id: str, shots: dict[int, Path]) -> None:
|
|
282
|
+
"""Attach failure screenshots to the uploaded run (best effort). The org can
|
|
283
|
+
turn storage off in the dashboard; screenshots are kept 30 days."""
|
|
284
|
+
import os
|
|
285
|
+
|
|
286
|
+
import httpx
|
|
287
|
+
|
|
288
|
+
api_url = os.getenv("FUSIONTEST_API_URL", "https://api.fusiontest.fusionleap.io")
|
|
289
|
+
headers = {"Authorization": f"Bearer {os.getenv('FUSIONTEST_API_KEY', '')}", "Content-Type": "image/png"}
|
|
290
|
+
stored = 0
|
|
291
|
+
for index, path in shots.items():
|
|
292
|
+
try:
|
|
293
|
+
resp = httpx.post(f"{api_url}/api/runs/{run_id}/screenshots/{index}",
|
|
294
|
+
content=path.read_bytes(), headers=headers, timeout=30)
|
|
295
|
+
resp.raise_for_status()
|
|
296
|
+
stored += bool(resp.json().get("stored"))
|
|
297
|
+
except Exception as e: # noqa: BLE001 — never fail a run over a screenshot
|
|
298
|
+
console.print(f"[yellow]Warning:[/yellow] Could not upload screenshot {path.name}: {e}")
|
|
299
|
+
if stored:
|
|
300
|
+
console.print(f"[dim]{stored} failure screenshot(s) attached to the run (kept 30 days).[/dim]")
|
|
301
|
+
|
|
302
|
+
|
|
256
303
|
def _load_env() -> None:
|
|
257
304
|
"""Load .env from the directory the command runs in (or a parent).
|
|
258
305
|
|
|
@@ -264,6 +311,25 @@ def _load_env() -> None:
|
|
|
264
311
|
load_dotenv(find_dotenv(usecwd=True))
|
|
265
312
|
|
|
266
313
|
|
|
314
|
+
def _trace_store(trace_dir: Path, shared: bool):
|
|
315
|
+
"""Recordings for replay: shared through your account when FUSIONTEST_API_KEY is
|
|
316
|
+
set (and replay.shared isn't false), otherwise local files only."""
|
|
317
|
+
import os
|
|
318
|
+
|
|
319
|
+
from fusiontest.core.replay import FileTraceStore
|
|
320
|
+
local = FileTraceStore(trace_dir)
|
|
321
|
+
api_key = os.getenv("FUSIONTEST_API_KEY")
|
|
322
|
+
if not (shared and api_key):
|
|
323
|
+
return local
|
|
324
|
+
from fusiontest.core.shared_traces import SharedTraceStore
|
|
325
|
+
console.print("[dim]Recordings: shared with your FusionTest account "
|
|
326
|
+
"(replay.shared: false to keep them local)[/dim]")
|
|
327
|
+
return SharedTraceStore(
|
|
328
|
+
api_url=os.getenv("FUSIONTEST_API_URL", "https://api.fusiontest.fusionleap.io"),
|
|
329
|
+
api_key=api_key, local=local,
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
|
|
267
333
|
def _resolve_backend(backend: str, cfg: dict) -> str:
|
|
268
334
|
"""Pick the backend when --backend wasn't given: config file, then whichever API key is set.
|
|
269
335
|
|
|
@@ -884,7 +950,7 @@ def _providers(result, fallback: str) -> str:
|
|
|
884
950
|
return first + (f" (and {', '.join(names[1:])})" if len(names) > 1 else "")
|
|
885
951
|
|
|
886
952
|
|
|
887
|
-
def _print_results(result) -> None:
|
|
953
|
+
def _print_results(result, screenshots: dict[int, Path] | None = None) -> None:
|
|
888
954
|
if result.success:
|
|
889
955
|
status = "[green]PASS ✓[/green]"
|
|
890
956
|
elif _exit_code(result) == 2:
|
|
@@ -912,6 +978,8 @@ def _print_results(result) -> None:
|
|
|
912
978
|
else:
|
|
913
979
|
status_cell = "[red]FAIL[/red]"
|
|
914
980
|
error_note = f"\n [dim red]{escape(step.error)}[/dim red]" if step.error else ""
|
|
981
|
+
if screenshots and (i - 1) in screenshots:
|
|
982
|
+
error_note += "\n [dim]screenshot saved (listed below)[/dim]"
|
|
915
983
|
table.add_row(
|
|
916
984
|
str(i),
|
|
917
985
|
escape(step.goal) + error_note,
|
|
@@ -923,6 +991,12 @@ def _print_results(result) -> None:
|
|
|
923
991
|
|
|
924
992
|
console.print(table)
|
|
925
993
|
|
|
994
|
+
if screenshots:
|
|
995
|
+
console.print("\n[bold]Failure screenshots[/bold]")
|
|
996
|
+
for index, path in sorted(screenshots.items()):
|
|
997
|
+
# One line per path, never wrapped, so it can be copied or clicked.
|
|
998
|
+
console.print(f" {index + 1}. {escape(str(path))}", soft_wrap=True)
|
|
999
|
+
|
|
926
1000
|
if result.error:
|
|
927
1001
|
console.print(f"\n[yellow]Run stopped early:[/yellow] {escape(result.error)}")
|
|
928
1002
|
|
|
@@ -93,9 +93,27 @@ class FileTraceStore:
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
def trace_key(goal: str, start_url: str) -> str:
|
|
96
|
-
"""Stable identity of a goal: its text (with placeholders) and starting URL.
|
|
96
|
+
"""Stable identity of a goal: its text (with placeholders) and starting URL.
|
|
97
|
+
|
|
98
|
+
The CLI and the dashboard share recordings by this key, so equivalent
|
|
99
|
+
spellings of a URL must agree: scheme and host are case-insensitive and a
|
|
100
|
+
trailing slash is ignored ("https://Acme.com/" == "https://acme.com").
|
|
101
|
+
"""
|
|
97
102
|
normalized = " ".join(goal.split()).lower()
|
|
98
|
-
return hashlib.sha256(f"{normalized}\n{start_url
|
|
103
|
+
return hashlib.sha256(f"{normalized}\n{_normalize_url(start_url)}".encode()).hexdigest()[:32]
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def _normalize_url(url: str) -> str:
|
|
107
|
+
url = url.strip()
|
|
108
|
+
if not url:
|
|
109
|
+
return ""
|
|
110
|
+
parts = urlsplit(url)
|
|
111
|
+
if not parts.scheme or not parts.netloc:
|
|
112
|
+
return url.rstrip("/")
|
|
113
|
+
path = parts.path.rstrip("/")
|
|
114
|
+
query = f"?{parts.query}" if parts.query else ""
|
|
115
|
+
fragment = f"#{parts.fragment}" if parts.fragment else ""
|
|
116
|
+
return f"{parts.scheme.lower()}://{parts.netloc.lower()}{path}{query}{fragment}"
|
|
99
117
|
|
|
100
118
|
|
|
101
119
|
def url_path(url: str) -> str:
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""
|
|
2
|
+
fusiontest/core/shared_traces.py
|
|
3
|
+
|
|
4
|
+
Replay recordings shared through your FusionTest account.
|
|
5
|
+
|
|
6
|
+
With FUSIONTEST_API_KEY set, the CLI reads and writes recordings via the API
|
|
7
|
+
(/api/traces), the same store dashboard-triggered runs use, so a goal that
|
|
8
|
+
passed anywhere — laptop, CI, or the dashboard — replays everywhere in the org.
|
|
9
|
+
|
|
10
|
+
Local files stay the fallback: every recording is also written to disk, and if
|
|
11
|
+
the API can't be reached the store goes local-only for the rest of the run
|
|
12
|
+
instead of slowing every goal down.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import logging
|
|
18
|
+
from dataclasses import dataclass, field
|
|
19
|
+
|
|
20
|
+
import httpx
|
|
21
|
+
|
|
22
|
+
from fusiontest.core.replay import FileTraceStore, GoalTrace
|
|
23
|
+
|
|
24
|
+
logger = logging.getLogger("fusiontest.shared_traces")
|
|
25
|
+
|
|
26
|
+
_TIMEOUT_SECONDS = 10.0
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class SharedTraceStore:
|
|
31
|
+
api_url: str
|
|
32
|
+
api_key: str
|
|
33
|
+
local: FileTraceStore = field(default_factory=FileTraceStore)
|
|
34
|
+
offline: bool = False
|
|
35
|
+
|
|
36
|
+
def _url(self, key: str) -> str:
|
|
37
|
+
return f"{self.api_url.rstrip('/')}/api/traces/{key}"
|
|
38
|
+
|
|
39
|
+
def _headers(self) -> dict:
|
|
40
|
+
return {"Authorization": f"Bearer {self.api_key}"}
|
|
41
|
+
|
|
42
|
+
def _go_offline(self, err: Exception) -> None:
|
|
43
|
+
if not self.offline:
|
|
44
|
+
logger.warning("Shared recordings unavailable (%s) — using local recordings for this run.", err)
|
|
45
|
+
self.offline = True
|
|
46
|
+
|
|
47
|
+
def get(self, key: str) -> GoalTrace | None:
|
|
48
|
+
if not self.offline:
|
|
49
|
+
try:
|
|
50
|
+
resp = httpx.get(self._url(key), headers=self._headers(), timeout=_TIMEOUT_SECONDS)
|
|
51
|
+
if resp.status_code == 200:
|
|
52
|
+
trace = GoalTrace.from_dict(resp.json())
|
|
53
|
+
self.local.save(trace) # keep a local copy for offline runs
|
|
54
|
+
return trace
|
|
55
|
+
if resp.status_code != 404:
|
|
56
|
+
resp.raise_for_status()
|
|
57
|
+
except Exception as err: # noqa: BLE001 — never fail a test run over sharing
|
|
58
|
+
self._go_offline(err)
|
|
59
|
+
return self.local.get(key)
|
|
60
|
+
|
|
61
|
+
def save(self, trace: GoalTrace) -> None:
|
|
62
|
+
self.local.save(trace)
|
|
63
|
+
if self.offline:
|
|
64
|
+
return
|
|
65
|
+
try:
|
|
66
|
+
resp = httpx.put(self._url(trace.key), json=trace.to_dict(), headers=self._headers(),
|
|
67
|
+
timeout=_TIMEOUT_SECONDS)
|
|
68
|
+
resp.raise_for_status()
|
|
69
|
+
except Exception as err: # noqa: BLE001
|
|
70
|
+
self._go_offline(err)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fusiontest
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.20
|
|
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
|
|
@@ -47,6 +47,7 @@ Requires-Dist: python-jose[cryptography]>=3.3; extra == "api"
|
|
|
47
47
|
Requires-Dist: cryptography>=42; extra == "api"
|
|
48
48
|
Requires-Dist: passlib[bcrypt]>=1.7; extra == "api"
|
|
49
49
|
Requires-Dist: psycopg2-binary>=2.9; extra == "api"
|
|
50
|
+
Requires-Dist: boto3>=1.34; extra == "api"
|
|
50
51
|
Provides-Extra: training
|
|
51
52
|
Requires-Dist: sentence-transformers>=2.7; extra == "training"
|
|
52
53
|
Requires-Dist: torch>=2.2; extra == "training"
|
|
@@ -98,7 +99,7 @@ without calling the AI at all.
|
|
|
98
99
|
| Multi-provider LLMs | Groq, Claude, Gemini, OpenAI or local Ollama, with automatic fallback |
|
|
99
100
|
| Safe secrets | `{{PASSWORD}}` placeholders — the AI never sees values, which are only typed on allowed sites |
|
|
100
101
|
| Guardrails | Invalid-action checks, loop detection, backtracking, no-progress detection |
|
|
101
|
-
| Reporting | JSON reports, dashboard uploads, Slack, GitHub Actions annotations, webhooks |
|
|
102
|
+
| Reporting | JSON reports, dashboard uploads, failure screenshots, Slack, GitHub Actions annotations, webhooks |
|
|
102
103
|
| Platforms | Web (Playwright), Electron, Android & iOS (Appium), Windows, macOS |
|
|
103
104
|
|
|
104
105
|
---
|
|
@@ -202,8 +203,10 @@ replay:
|
|
|
202
203
|
|
|
203
204
|
## 🔌 CI/CD
|
|
204
205
|
|
|
205
|
-
Run `fusiontest run --headless` in any CI system
|
|
206
|
-
|
|
206
|
+
Run `fusiontest run --headless` in any CI system. With `FUSIONTEST_API_KEY`
|
|
207
|
+
set, replay recordings are shared through your FusionTest account (laptop, CI
|
|
208
|
+
and dashboard all replay each other's passing goals); without it, cache
|
|
209
|
+
`.fusiontest/traces`. Guides for GitHub Actions, Bitrise,
|
|
207
210
|
Fastlane and Jenkins: [docs/ci-integrations.md](docs/ci-integrations.md).
|
|
208
211
|
|
|
209
212
|
---
|
|
@@ -21,6 +21,7 @@ fusiontest/core/replay.py
|
|
|
21
21
|
fusiontest/core/runner.py
|
|
22
22
|
fusiontest/core/screen_parser.py
|
|
23
23
|
fusiontest/core/secrets.py
|
|
24
|
+
fusiontest/core/shared_traces.py
|
|
24
25
|
fusiontest/core/tokens.py
|
|
25
26
|
fusiontest/demos/__init__.py
|
|
26
27
|
fusiontest/demos/fusiontest_dashboard.yaml
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fusiontest"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.20"
|
|
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"
|
|
@@ -61,6 +61,7 @@ api = [
|
|
|
61
61
|
"cryptography>=42",
|
|
62
62
|
"passlib[bcrypt]>=1.7",
|
|
63
63
|
"psycopg2-binary>=2.9",
|
|
64
|
+
"boto3>=1.34", # failure screenshots in S3
|
|
64
65
|
]
|
|
65
66
|
training = [
|
|
66
67
|
"sentence-transformers>=2.7",
|
|
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
|