Returns

Returns a Session object.

Example

# Tries to get a session with id "existing-session-id", creates it if not found.
session = galtea.sessions.get_or_create(
    id="existing-session-id",
    version_id="YOUR_VERSION_ID",
    test_case_id="YOUR_TEST_CASE_ID"
)

Parameters

id
string
required

The ID of the session to fetch or create.

version_id
string
required

The ID of the version to associate with this session if it needs to be created.

test_case_id
string

The test case ID. Required for non-production sessions.

context
dict

A flexible key-value context.

is_production
boolean

A flag to indicate if the session is from a production environment. Defaults to False.