3.2. Editor playwright — node-editor-aware test layer over imgui_playwright (EditorSession + ne_* helpers)

Node-editor-aware test layer built on dasImgui’s imgui_playwright. ne_open takes a live ImguiApp (from with_node_editor_app), waits for the editor to render, resolves the editor handle from the first snapshot, and returns an EditorSession that carries the app, the canvas path, and that handle.

The ne_* helpers then read like a node-editor script rather than raw live commands: actions (ne_select_node, ne_add_link, ne_delete_node, ne_move_node, ne_new_node_drag, ne_shortcut) post the matching imgui_node_editor_live command against the session’s handle; queries (ne_snapshot, ne_node, ne_node_exists, ne_node_selected, ne_node_count, ne_payload) pull fields straight out of the editor payload; and the polling helpers (ne_wait_widget, ne_wait_payload_str, ne_wait_shortcut) wrap the timeout / retry loop so tests don’t reinvent it.

3.2.1. Structures

EditorSession

struct EditorSession

3.2.2. Session

ne_open(app: ImguiApp; canvas: string; timeout_sec: float = 15f ): EditorSession

def ne_open (app: ImguiApp; canvas: string; timeout_sec: float = 15f) : EditorSession

Arguments:
  • app : ImguiApp

  • canvas : string

  • timeout_sec : float

3.2.3. Actions

def ne_add_link (s: EditorSession; from: int; to: int) : JsonValue?

Arguments:
ne_clear_selection(s: EditorSession ): JsonValue?

def ne_clear_selection (s: EditorSession) : JsonValue?

Arguments:

def ne_delete_link (s: EditorSession; id: int) : JsonValue?

Arguments:
ne_delete_node(s: EditorSession; id: int ): JsonValue?

def ne_delete_node (s: EditorSession; id: int) : JsonValue?

Arguments:
ne_flow(s: EditorSession; link_id: int; backward: bool = false ): JsonValue?

def ne_flow (s: EditorSession; link_id: int; backward: bool = false) : JsonValue?

Arguments:
ne_move_node(s: EditorSession; id: int; x: float; y: float ): JsonValue?

def ne_move_node (s: EditorSession; id: int; x: float; y: float) : JsonValue?

Arguments:
ne_new_node_drag(s: EditorSession; from: int; x: float; y: float ): JsonValue?

def ne_new_node_drag (s: EditorSession; from: int; x: float; y: float) : JsonValue?

Arguments:

def ne_select_link (s: EditorSession; id: int; on: bool = true) : JsonValue?

Arguments:
ne_select_node(s: EditorSession; id: int; on: bool = true ): JsonValue?

def ne_select_node (s: EditorSession; id: int; on: bool = true) : JsonValue?

Arguments:
ne_shortcut(s: EditorSession; kind: string ): JsonValue?

def ne_shortcut (s: EditorSession; kind: string) : JsonValue?

Arguments:

3.2.4. Snapshots & queries

ne_node(snap: JsonValue?; s: EditorSession; id: int ): JsonValue?

def ne_node (var snap: JsonValue?; s: EditorSession; id: int) : JsonValue?

Arguments:
ne_node_count(s: EditorSession ): int

def ne_node_count (s: EditorSession) : int

Arguments:
ne_node_exists(snap: JsonValue?; s: EditorSession; id: int ): bool

def ne_node_exists (var snap: JsonValue?; s: EditorSession; id: int) : bool

Arguments:
ne_node_selected(snap: JsonValue?; s: EditorSession; id: int ): bool

def ne_node_selected (var snap: JsonValue?; s: EditorSession; id: int) : bool

Arguments:
ne_payload(snap: JsonValue?; s: EditorSession ): JsonValue?

def ne_payload (var snap: JsonValue?; s: EditorSession) : JsonValue?

Arguments:
ne_snapshot(s: EditorSession ): JsonValue?

def ne_snapshot (s: EditorSession) : JsonValue?

Arguments:

3.2.5. Polling / await

ne_wait_payload_str(s: EditorSession; field: string; expected: string; timeout_sec: float = 5f ): JsonValue?

def ne_wait_payload_str (s: EditorSession; field: string; expected: string; timeout_sec: float = 5f) : JsonValue?

Arguments:
  • s : EditorSession

  • field : string

  • expected : string

  • timeout_sec : float

ne_wait_selected(s: EditorSession; id: int; timeout_sec: float = 5f ): JsonValue?

def ne_wait_selected (s: EditorSession; id: int; timeout_sec: float = 5f) : JsonValue?

Arguments:
ne_wait_shortcut(s: EditorSession; action: string; timeout_sec: float = 5f ): JsonValue?

def ne_wait_shortcut (s: EditorSession; action: string; timeout_sec: float = 5f) : JsonValue?

Arguments:
ne_wait_visible(s: EditorSession; subpath: string; timeout_sec: float = 6f ): JsonValue?

def ne_wait_visible (s: EditorSession; subpath: string; timeout_sec: float = 6f) : JsonValue?

Arguments:
ne_wait_widget(s: EditorSession; subpath: string; timeout_sec: float = 6f ): JsonValue?

def ne_wait_widget (s: EditorSession; subpath: string; timeout_sec: float = 6f) : JsonValue?

Arguments: