Skip to main content
FixturFab

Test Executor Communication

Understanding the pytest-f3ts messaging system for communication between test code and the Test Runner backend and frontend.

The FixturFab Test Executor uses a combination of websockets and HTTP requests to communicate with the Test Runner backend and frontend.

Communication Flow#

When a test technician presses Run in the User Interface, an API command is sent to the Test Executor (TE), which initiates the pytest thread. During test plan execution, messages are transmitted to the TE, logged to the results database, and communicated to the GUI. Custom messages can be sent via pytest-f3ts fixtures.

Websocket Message Structure#

All websocket messages follow this JSON format:

{
    "type": "message_type",
    "toClient": "{{received ID}}",
    "fromClient": "{{sender ID}}",
    "data": {
        "key": "value"
    }
}

The connect message type is sent by the backend to the frontend to initiate a connection handshake.

Message Types#

Test Results#

Test result messages are sent after test execution via the pytest_runtest_logreport hook or manually using the f3ts_assert fixture.

TestResult Object:

FieldDescription
test_idTest identifier
test_nameTest case name
min_limitMinimum limit setting
max_limitMaximum limit setting
measMeasurement value
startTest start time
stopTest completion time
durationTest execution duration
passedPass/Fail status

User Input#

Dialog messages are sent via the user_dialog fixture, which transmits Dialog objects over websockets. Blocking messages return DialogResponse objects.

Dialog Object:

FieldDescription
titlePopup title
messagePopup content
okButtonTextOptional OK button text
cancelButtonTextOptional Cancel button text
inputTypeOptional input type (supports "text")
defaultTextDefault input text

DialogResponse Object:

FieldDescription
inputTextUser-entered text for "text" type
okClickedOK button click status
cancelClickedCancel button click status

Status Banner#

Custom status banners are sent via the status_banner fixture using StatusBanner objects.

StatusBanner Object:

FieldDescription
statusBanner text (e.g., "Close Fixture", "Running")
colorHex color code (e.g., "#7E57C2")

Next Steps#

Last updated:January 25, 2025