Skip to content

#995 Implement unified UI automation framework (Qt HTTP Server + Playwright) - #998

Open
magnesj wants to merge 13 commits into
devfrom
feature/ui-automation-framework
Open

#995 Implement unified UI automation framework (Qt HTTP Server + Playwright)#998
magnesj wants to merge 13 commits into
devfrom
feature/ui-automation-framework

Conversation

@magnesj

@magnesj magnesj commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Implements the unified UI automation framework from #995 (investigation #993, recommendation #994).

One localhost automation surface serves both UI workflow tests and AI tooling:

  • Transport: localhost-only HTTP API exposed from ResInsight using Qt HTTP Server (qthttpserver), targeting Qt 6.6.3. New module ApplicationLibCode/Automation/ (RiaAutomationServer), gated behind the new CMake option RESINSIGHT_ENABLE_UI_AUTOMATION (OFF by default) and started with ResInsight --automationserver [port].
  • API contract: OpenAPI 3.0 spec docs/automation/openapi.yaml is the source of truth, covering /health, /project, /objects/{address} (+ field write), /views, /views/{id}/visibleCellCount, and /commands (RICF).
  • Test runner: Playwright project Testing/UiAutomation/ with read-only smoke tests and the cell-range-filter reference workflow from Framework used for AI tooling and UI unit tests #993.

The server binds to 127.0.0.1 only. Field writes reuse the same scripting capability as the Python/gRPC interface; command execution reuses the RICF command vocabulary.

Notes

  • The feature is fully gated; with the option OFF the default build is unchanged.
  • Building the server requires a Qt with the HttpServer module (present in the local Qt 6.6.3 install; not in the Qt 6.10.1 kit currently configured in build/).
  • The end-to-end create/delete lifecycle test is marked fixme pending /commands vocabulary for creating/removing cell range filters.

Closes #995

magnesj and others added 13 commits June 1, 2026 15:16
ApplicationLibCode/Automation is not part of the target include directories,
so RiaGuiApplication.cpp failed to compile when configuring with
RESINSIGHT_ENABLE_UI_AUTOMATION=ON. Use a sibling-relative include instead.
Playwright resolves request paths against baseURL using WHATWG URL semantics,
where a leading slash replaces the entire path. Every call therefore hit the
server root instead of /api/v1 and returned 404.

Normalize baseURL to end with a slash and make the client paths relative.
…tion

Many commands act on the object selected in the project tree, but the
automation API had no way to drive it and there is no command-file verb for
selection either.

GET /api/v1/selection reports the selected objects. PUT /api/v1/selection
selects an object by address using Riu3DMainWindowTools::selectAsCurrentItem,
the same call the context menu features use, so the property editor and the
active view follow along as they do for a user click.
Cell filters and many other objects are created and deleted by command features
rather than by command-file verbs, so tests could not reach them.

POST /api/v1/features invokes a feature the same way its context menu entry
does, and GET /api/v1/features lists what is available together with whether it
applies to the current selection. Only an explicit allow list can be invoked,
because a large share of the features open modal dialogs that would block the
server with no user present to dismiss them.

PUT /api/v1/selection now sets the selection manager in addition to syncing the
tree view. Riu3DMainWindowTools::selectAsCurrentItem silently does nothing when
the object is not present in a visible tree view, which left objects such as the
cell filter collection unselectable. Features read the selection manager.

This makes the reference workflow from issue #993 run end to end, so the test is
no longer marked fixme.
The commands route executed arbitrary command-file (RICF) text. The only thing
the tests needed from it was importing a grid and opening a view, and command
features now cover the rest of the workflow.

POST /api/v1/cases imports a grid file through
RiaImportEclipseCaseTools::openEclipseCaseFromFile, which is the path the file
menu uses, with the time step filter dialog disabled so nothing waits for input.
The response reports the new case id and the ids of the views created for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement unified UI automation framework (Qt Http Server + Playwright)

1 participant