Commit 1e36e53f authored by Marco Cavalli's avatar Marco Cavalli
Browse files

feat: add viewer logic

parent 8280c632
Loading
Loading
Loading
Loading
+1 −0
Changes for .gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,3 +5,4 @@ results
.vscode/
.venv
.DS_Store
/tools/interoperability_visualizer/output/
+69 −0
Changes for tools/interoperability_visualizer/README.md: 69 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Interoperability Architecture Visualizer

Generates an offline interactive architecture view of the Robot Framework tests in
`IOP_TP/NGSI-LD/Interoperability`.

## Run

With the project environment active:

```console
python tools/interoperability_visualizer/generate.py
```

Using the local `ttf3` Conda environment:

```console
conda run -n ttf3 python tools/interoperability_visualizer/generate.py
```

The generated page is written to:

```text
tools/interoperability_visualizer/output/interoperability-architecture.html
```

Select a different Robot file or directory with `--source`:

```console
python tools/interoperability_visualizer/generate.py \
  --source IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity
```

Select another filename inside the dedicated output directory with `--output-name`:

```console
python tools/interoperability_visualizer/generate.py --output-name provision.html
```

Output paths and non-HTML output names are rejected. The complete `output/` directory is ignored by Git.

## Viewer

- Select any concrete interoperability test permutation.
- Switch between the full-size **Preview** graph and **Expected output** workspace.
- Hover over a broker to inspect every entity created in that broker during setup.
- Hover over a registration arc to inspect its effective creation payload.
- Browse assertion-derived expected responses by broker or in execution order.
- Timeline view treats each consecutive inline comment block as one numbered Robot step and nests every correlated
  Robot keyword operation and expected HTTP response below it.
- Every numbered comment step has its own assertion panel, including `Client sends` and `Agent checks` steps.
- Expand a response step to see its prominent HTTP status, request, assertions, and expected JSON inline.
- Click a broker or registration to pin it; press Escape or use the close button to unpin it.
- Drag brokers to rearrange the architecture.
- Drag empty graph space to pan, use the mouse wheel to zoom, and use **Reset view** to restore the viewport.

Registration arrows start at the broker where the registration is created and point to the broker referenced by its
endpoint. Effective payloads resolve entity IDs and contexts while keeping runtime broker URLs and generated
registration IDs symbolic.

Expected responses are derived statically from the Robot request and assertion calls. HTTP 201 and 404 steps remain
status-only, and unsupported future assertion patterns are displayed as unresolved instead of inventing a body.

## Test

```console
conda run -n ttf3 python -m unittest discover \
  -s tools/interoperability_visualizer/tests \
  -p 'test_*.py'
```
+554 −0

File added.

Preview size limit exceeded, changes collapsed.

+401 −0

File added.

Preview size limit exceeded, changes collapsed.

+85 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading