Testing VTK Web workflow

Hello,

I’m having trouble setting up a test server with VTK web, ie not testing the Python function in the protocols but the exported rpc.

So far, I have read these pages:

https://docs.vtk.org/en/latest/api/python/vtkmodules/vtkmodules.test.Testing.html

Those only seem to talk about the functions testing, not the server testing.
Do you have any code or do you know of any code that tests this part?

Thanks!

I know we have some cmake tests that start a server and a client that connect to it. But it has been a while and I don’t remember when those are.

The latest set of tests are on the trame side (same tech), which just script the browser from Python and run via pytest. trame-client/tests at master · Kitware/trame-client · GitHub

You can find also some in trame-vtk where we do image comparison too.

HTH,

Seb

Thanks for the resource!

We managed to launch the server using the FixtureHelper. Then, we connect to it via websocket but we can’t figure out a way to call a Rpc, do you have any example for that? Is there another way to call a protocol from the server?

ws = websocket.WebSocket()
ws.connect("ws://localhost:1234/ws")
ws.send("create_visualization")
response = ws.recv()

A while back we were creating a “test” client app which you can drive from python (click - run test button, check results)…
In other words, we never (re-)implemented the wslink protocol in Python from the client point of view.