@capagents/forgeqe 2.7.1 → 2.7.2
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.
- package/HOW_TO_USE.md +81 -18
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/dist/docs-site/docs/index.html +69 -1
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +1545 -1500
- package/dist/web/THIRD_PARTY_NOTICES.md +18 -51
- package/dist/web/assets/Agent-CxCmYQU5.js +4 -0
- package/dist/web/assets/ApiTests-BYx-CDHt.js +10 -0
- package/dist/web/assets/Chat-C6tALAzM.js +3 -0
- package/dist/web/assets/Data-IpXp3YB-.js +3 -0
- package/dist/web/assets/Evidence-B9rcXYHM.js +1 -0
- package/dist/web/assets/Features-EGps6J7t.js +1 -0
- package/dist/web/assets/Jobs-DutW6w6P.js +5 -0
- package/dist/web/assets/KindPage-DOYNwJDp.js +6 -0
- package/dist/web/assets/Migration-5kPbd43c.js +2 -0
- package/dist/web/assets/Product-DSxgpqDA.js +1 -0
- package/dist/web/assets/Quality-Bo0GxWoZ.js +1 -0
- package/dist/web/assets/Record-gGESInMV.js +2 -0
- package/dist/web/assets/Regression-b5ykN8hf.js +5 -0
- package/dist/web/assets/Reports-BcIDq-yP.js +2 -0
- package/dist/web/assets/Response-DLbH7Zyc.js +4 -0
- package/dist/web/assets/Runs-C9YExlBk.js +2 -0
- package/dist/web/assets/Shell-DGv_Zqjs.js +3 -0
- package/dist/web/assets/TestCases-CynVHtUB.js +1 -0
- package/dist/web/assets/TestData-5ynuvxFS.js +2 -0
- package/dist/web/assets/Tosca-BMePLsZA.js +2 -0
- package/dist/web/assets/WhatsNew-gMY090GS.js +1 -0
- package/dist/web/assets/dataParts-PzO8u_dt.js +3 -0
- package/dist/web/assets/index-CrZYPHPP.css +2 -0
- package/dist/web/assets/index-DI1ST-gI.js +43 -0
- package/dist/web/assets/parts-BD8kP4IN.js +1 -0
- package/dist/web/assets/productParts-Q9GA6BML.js +1 -0
- package/dist/web/assets/qualityParts-Df8rJX4J.js +1 -0
- package/dist/web/assets/segmented-1nc3D7ML.js +1 -0
- package/dist/web/assets/{thread-CHhZJi-Y.js → thread-CE28Yblm.js} +2 -2
- package/dist/web/assets/{usePageChat-eO0J5JlP.js → usePageChat-3HvaQpPP.js} +1 -1
- package/dist/web/index.html +3 -3
- package/docs/prompts/graphify-evidence.md +164 -0
- package/docs/user-guide.html +69 -1
- package/forgeqe.example.yaml +4 -1
- package/package.json +3 -1
- package/prompts/README.md +1 -0
- package/prompts/tosca.md +64 -0
- package/py/forgeqe_tosca/__init__.py +85 -0
- package/py/forgeqe_tosca/__main__.py +50 -0
- package/py/forgeqe_tosca/ntir.py +484 -0
- package/py/forgeqe_tosca/render.py +128 -0
- package/py/forgeqe_tosca/tsu.py +187 -0
- package/py/forgeqe_tosca/vendor/toscatsu/LICENSE +26 -0
- package/py/forgeqe_tosca/vendor/toscatsu/UPSTREAM +7 -0
- package/py/forgeqe_tosca/vendor/toscatsu/gen_tsu.py +735 -0
- package/py/forgeqe_tosca/vendor/toscatsu/parse_tsu.py +1979 -0
- package/py/forgeqe_tosca/vendor/toscatsu/spec_to_manifest.py +878 -0
- package/py/forgeqe_tosca/vendored.py +50 -0
- package/skills/tosca-knowledge/SKILL.md +56 -0
- package/skills/tosca-knowledge/references/actions-and-values.md +63 -0
- package/skills/tosca-knowledge/references/locators.md +29 -0
- package/skills/tosca-knowledge/references/mapping-cypress.md +21 -0
- package/skills/tosca-knowledge/references/mapping-playwright.md +31 -0
- package/skills/tosca-knowledge/references/mapping-selenium-webdriverio.md +26 -0
- package/skills/tosca-knowledge/references/ntir.md +46 -0
- package/dist/web/assets/Agent-Ol1sf0Me.js +0 -4
- package/dist/web/assets/ApiTests-BfN5VysH.js +0 -10
- package/dist/web/assets/Chat-Bk2ECB9h.js +0 -3
- package/dist/web/assets/Data-DSZ9xkqr.js +0 -3
- package/dist/web/assets/Evidence-BVjGRwcr.js +0 -1
- package/dist/web/assets/Features-DQEzR0Mz.js +0 -1
- package/dist/web/assets/Jobs-chEiiqmE.js +0 -5
- package/dist/web/assets/KindPage-D-Jah0cx.js +0 -6
- package/dist/web/assets/Migration-DMIBgW27.js +0 -2
- package/dist/web/assets/Product-B3buEWja.js +0 -1
- package/dist/web/assets/Quality-DuELzB5I.js +0 -1
- package/dist/web/assets/Record-DLTuuxTP.js +0 -2
- package/dist/web/assets/Regression-Bjz4Xfbo.js +0 -5
- package/dist/web/assets/Reports-p8Qp2KwM.js +0 -2
- package/dist/web/assets/Response-DGJAmOI0.js +0 -4
- package/dist/web/assets/Runs-CnPPwEq7.js +0 -2
- package/dist/web/assets/Shell-Molb7AUz.js +0 -3
- package/dist/web/assets/TestCases-CUZ-kHja.js +0 -1
- package/dist/web/assets/TestData-B3P1fBRO.js +0 -2
- package/dist/web/assets/WhatsNew-CdiZ0Eob.js +0 -1
- package/dist/web/assets/arrow-down-D5oPK0MM.js +0 -1
- package/dist/web/assets/arrow-right-2yt0QgFJ.js +0 -1
- package/dist/web/assets/circle-DIklM9wF.js +0 -1
- package/dist/web/assets/circle-dashed-BZvX5dyl.js +0 -1
- package/dist/web/assets/circle-dot-Cd20PWQi.js +0 -1
- package/dist/web/assets/dataParts-D0dUqael.js +0 -3
- package/dist/web/assets/index-BC72t3H1.js +0 -43
- package/dist/web/assets/index-BiJ_Nvm1.css +0 -2
- package/dist/web/assets/keyboard-Dab5j5YB.js +0 -1
- package/dist/web/assets/pencil-DeEsXRZX.js +0 -1
- package/dist/web/assets/productParts-Ciuentrl.js +0 -1
- package/dist/web/assets/qualityParts-CZCG8hDs.js +0 -1
- package/dist/web/assets/segmented-BMOboT4H.js +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"""Read a Tosca .tsu export safely, and index what the Tosca agent needs that ToscaTSU's manifest does not carry.
|
|
2
|
+
|
|
3
|
+
A .tsu is gzip-compressed JSON: {"Entities": [{Surrogate, ObjectClass, Attributes, Assocs}, ...]}. It comes from
|
|
4
|
+
someone else's workspace, so it is untrusted: its size is capped before and after unpacking, nothing in it is run, and
|
|
5
|
+
its text is only ever data.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import gzip
|
|
10
|
+
import json
|
|
11
|
+
import re
|
|
12
|
+
from dataclasses import dataclass, field
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import Any, Dict, List, Optional
|
|
15
|
+
|
|
16
|
+
MAX_PACKED = 100 * 1024 * 1024
|
|
17
|
+
MAX_UNPACKED = 1024 * 1024 * 1024
|
|
18
|
+
_CHUNK = 1024 * 1024
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class TsuError(Exception):
|
|
22
|
+
"""The file is not a .tsu the Tosca agent can read; the message says why in plain words."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def load(path: Path) -> Dict[str, Any]:
|
|
26
|
+
"""The .tsu's JSON, within the size limits."""
|
|
27
|
+
p = Path(path)
|
|
28
|
+
if not p.is_file():
|
|
29
|
+
raise TsuError(f"{p.name} is not a file.")
|
|
30
|
+
if p.stat().st_size > MAX_PACKED:
|
|
31
|
+
raise TsuError(f"{p.name} is larger than {MAX_PACKED // (1024 * 1024)} MB.")
|
|
32
|
+
buf = bytearray()
|
|
33
|
+
try:
|
|
34
|
+
with gzip.open(p, "rb") as fh:
|
|
35
|
+
while True:
|
|
36
|
+
chunk = fh.read(_CHUNK)
|
|
37
|
+
if not chunk:
|
|
38
|
+
break
|
|
39
|
+
buf += chunk
|
|
40
|
+
if len(buf) > MAX_UNPACKED:
|
|
41
|
+
raise TsuError(f"{p.name} unpacks to more than {MAX_UNPACKED // (1024 * 1024)} MB.")
|
|
42
|
+
except (OSError, EOFError) as exc:
|
|
43
|
+
raise TsuError(f"{p.name} is not a gzip-compressed Tosca export (.tsu): {exc}") from None
|
|
44
|
+
try:
|
|
45
|
+
data = json.loads(bytes(buf).decode("utf-8-sig"))
|
|
46
|
+
except (UnicodeDecodeError, json.JSONDecodeError) as exc:
|
|
47
|
+
raise TsuError(f"{p.name} does not hold Tosca's JSON: {exc}") from None
|
|
48
|
+
ents = data.get("Entities") if isinstance(data, dict) else None
|
|
49
|
+
if not isinstance(ents, list) or not all(isinstance(e, dict) and isinstance(e.get("Surrogate"), str) for e in ents):
|
|
50
|
+
raise TsuError(f"{p.name} has no Tosca entity list.")
|
|
51
|
+
if not any(e.get("ObjectClass") == "TestCase" for e in ents):
|
|
52
|
+
raise TsuError(f"{p.name} has no test case.")
|
|
53
|
+
if not any(e.get("ObjectClass") == "TCProject" for e in ents):
|
|
54
|
+
raise TsuError(f"{p.name} has no Tosca project entity (TCProject).")
|
|
55
|
+
return data
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _attrs(e: Optional[Dict[str, Any]]) -> Dict[str, Any]:
|
|
59
|
+
a = (e or {}).get("Attributes")
|
|
60
|
+
return a if isinstance(a, dict) else {}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _assocs(e: Optional[Dict[str, Any]], key: str) -> List[str]:
|
|
64
|
+
a = (e or {}).get("Assocs")
|
|
65
|
+
v = a.get(key) if isinstance(a, dict) else None
|
|
66
|
+
return [x for x in v if isinstance(x, str)] if isinstance(v, list) else []
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def name_of(e: Optional[Dict[str, Any]]) -> str:
|
|
70
|
+
n = _attrs(e).get("Name")
|
|
71
|
+
return n if isinstance(n, str) else ""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# Tosca engines → the ForgeQE agent that can do their steps.
|
|
75
|
+
ROUTES = {
|
|
76
|
+
"web": re.compile(r"^(html|web|xbrowser|chrome|edge|firefox)", re.I),
|
|
77
|
+
"api": re.compile(r"(api|webservice|http|rest|soap)", re.I),
|
|
78
|
+
"mobile": re.compile(r"(mobile|android|ios)", re.I),
|
|
79
|
+
"desktop": re.compile(r"(uia|swing|java|sap|dotnet|\.net|win|delphi|powerbuilder|desktop|tbox)", re.I),
|
|
80
|
+
"data": re.compile(r"(database|db|sql|excel|tdm|testdata)", re.I),
|
|
81
|
+
}
|
|
82
|
+
# TBox modules the reader turns into plain steps, so they never decide a route.
|
|
83
|
+
NEUTRAL_MODULES = {"TBox Set Buffer", "TBox Evaluation Tool", "TBox Wait", "TBox Buffer"}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def route_of(engine: str) -> str:
|
|
87
|
+
for route, rx in ROUTES.items():
|
|
88
|
+
if engine and rx.search(engine):
|
|
89
|
+
return route
|
|
90
|
+
return "web" if not engine else "unsupported"
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@dataclass
|
|
94
|
+
class Index:
|
|
95
|
+
"""What the reader needs from the raw graph: test cases with their folders, and each module's engine."""
|
|
96
|
+
|
|
97
|
+
project: str
|
|
98
|
+
test_cases: List[Dict[str, Any]] = field(default_factory=list)
|
|
99
|
+
engines: Dict[str, str] = field(default_factory=dict) # module name → engine
|
|
100
|
+
entity_count: int = 0
|
|
101
|
+
suites: List[Dict[str, Any]] = field(default_factory=list) # execution lists: name, folders, test case surrogates
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# Tosca's own workspace folders: they say nothing about what a test is about, so they never become a folder of the suite.
|
|
105
|
+
FOLDER_NOISE = {"testcases", "test cases", "library", "components", "tbox", "modules", "configuration", "project", "execution", "executionlists", "execution lists", ""}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def area_of(folders: List[str]) -> List[str]:
|
|
109
|
+
"""The folders a converted test is placed under: the test case's Tosca folders without Tosca's workspace folders."""
|
|
110
|
+
return [f for f in folders if f.strip().lower() not in FOLDER_NOISE]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _folders(ents: Dict[str, Dict[str, Any]], e: Dict[str, Any]) -> List[str]:
|
|
114
|
+
out: List[str] = []
|
|
115
|
+
seen = set()
|
|
116
|
+
parent = _assocs(e, "ParentFolder")
|
|
117
|
+
while parent and parent[0] not in seen and parent[0] in ents:
|
|
118
|
+
seen.add(parent[0])
|
|
119
|
+
out.insert(0, name_of(ents[parent[0]]))
|
|
120
|
+
parent = _assocs(ents[parent[0]], "ParentFolder")
|
|
121
|
+
return out
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def execution_lists(ents: Dict[str, Dict[str, Any]], max_depth: int = 12) -> List[Dict[str, Any]]:
|
|
125
|
+
"""Tosca's suites: each ExecutionList with the test cases its entries run, in order.
|
|
126
|
+
|
|
127
|
+
An execution list holds execution entries, often in entry folders; an entry points at the test case it runs.
|
|
128
|
+
Exports differ in the association names, so the walk follows every association, but only through Execution*
|
|
129
|
+
entities (never into a test case's own steps), and takes each TestCase it reaches.
|
|
130
|
+
"""
|
|
131
|
+
lists: List[Dict[str, Any]] = []
|
|
132
|
+
for e in ents.values():
|
|
133
|
+
if e.get("ObjectClass") != "ExecutionList":
|
|
134
|
+
continue
|
|
135
|
+
cases: List[str] = []
|
|
136
|
+
seen = {e["Surrogate"]}
|
|
137
|
+
frontier = [e]
|
|
138
|
+
for _ in range(max_depth):
|
|
139
|
+
nxt = []
|
|
140
|
+
for cur in frontier:
|
|
141
|
+
assocs = cur.get("Assocs") if isinstance(cur.get("Assocs"), dict) else {}
|
|
142
|
+
for key, targets in assocs.items():
|
|
143
|
+
if key in ("ParentFolder", "ExecutionList") or not isinstance(targets, list):
|
|
144
|
+
continue
|
|
145
|
+
for t in targets:
|
|
146
|
+
if not isinstance(t, str) or t in seen or t not in ents:
|
|
147
|
+
continue
|
|
148
|
+
seen.add(t)
|
|
149
|
+
cls = str(ents[t].get("ObjectClass") or "")
|
|
150
|
+
if cls == "TestCase":
|
|
151
|
+
cases.append(t)
|
|
152
|
+
elif cls.startswith("Execution") and "Log" not in cls:
|
|
153
|
+
nxt.append(ents[t])
|
|
154
|
+
frontier = nxt
|
|
155
|
+
if not frontier:
|
|
156
|
+
break
|
|
157
|
+
lists.append({"name": name_of(e), "surrogate": e["Surrogate"], "folders": _folders(ents, e), "cases": cases})
|
|
158
|
+
return lists
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def index(data: Dict[str, Any]) -> Index:
|
|
162
|
+
ents = {e["Surrogate"]: e for e in data["Entities"]}
|
|
163
|
+
project = next((name_of(e) for e in data["Entities"] if e.get("ObjectClass") == "TCProject"), "")
|
|
164
|
+
idx = Index(project=project, entity_count=len(ents))
|
|
165
|
+
# Engine XParams by the module they belong to, linked from either side (exports differ).
|
|
166
|
+
engine_of: Dict[str, str] = {}
|
|
167
|
+
for p in data["Entities"]:
|
|
168
|
+
if p.get("ObjectClass") == "XParam" and name_of(p) == "Engine" and isinstance(_attrs(p).get("Value"), str):
|
|
169
|
+
for owner in _assocs(p, "ExtendableObject"):
|
|
170
|
+
engine_of[owner] = _attrs(p)["Value"]
|
|
171
|
+
for e in data["Entities"]:
|
|
172
|
+
if e.get("ObjectClass") != "XModule":
|
|
173
|
+
continue
|
|
174
|
+
engine = engine_of.get(e["Surrogate"], "")
|
|
175
|
+
for p in (ents.get(s) for s in _assocs(e, "Properties")):
|
|
176
|
+
if p and name_of(p) == "Engine" and isinstance(_attrs(p).get("Value"), str):
|
|
177
|
+
engine = _attrs(p)["Value"]
|
|
178
|
+
idx.engines[name_of(e)] = engine
|
|
179
|
+
for e in data["Entities"]:
|
|
180
|
+
if e.get("ObjectClass") != "TestCase":
|
|
181
|
+
continue
|
|
182
|
+
idx.test_cases.append({"name": name_of(e), "surrogate": e["Surrogate"], "folders": _folders(ents, e)})
|
|
183
|
+
idx.suites = execution_lists(ents)
|
|
184
|
+
for tc in idx.test_cases:
|
|
185
|
+
tc["area"] = area_of(tc["folders"])
|
|
186
|
+
tc["suites"] = [s["name"] for s in idx.suites if tc["surrogate"] in s["cases"] and s["name"]]
|
|
187
|
+
return idx
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ToscaTSU contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Tricentis Tosca is a trademark of Tricentis GmbH. This project is independent
|
|
26
|
+
and not affiliated with, endorsed by, or sponsored by Tricentis.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
repository: https://github.com/bermudas/ToscaTSU
|
|
2
|
+
commit: 338f4dd062f0bccf41e940dacc0b4ae4556a1a61
|
|
3
|
+
license: MIT (LICENSE in this folder)
|
|
4
|
+
files: parse_tsu.py gen_tsu.py spec_to_manifest.py (unchanged copies)
|
|
5
|
+
26a9072b7a538bbfded72b980938828741fa95bc75067fec97aead07afe7b207 gen_tsu.py
|
|
6
|
+
521b5667fa2af5f888bd2bdee4bfb96c3a29592e8555061f31629d7ebdee0353 parse_tsu.py
|
|
7
|
+
416c3ec876a24a76d94382217d5019d5d3469c3ab467ca959bd0c03a982ea247 spec_to_manifest.py
|