"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTrainingTestContext = createTrainingTestContext;
const uuid_1 = require("uuid");
const execution_1 = require("../../execution");
async function createTrainingTestContext(options) {
    const { workspaceId, applicationId, url, apiClient, idPrefix = 'trainer', deviceEmulation, } = options;
    if (!workspaceId) {
        throw new Error('workspaceId is required');
    }
    const accountFeatures = await apiClient.getEnabledAccountFeaturesByWorkspaceId(workspaceId);
    const labsFeatures = await apiClient.getEnabledLabsFeaturesForWorkspace(workspaceId);
    const minimalTest = {
        id: `${idPrefix}-${(0, uuid_1.v4)()}`,
        workspace_id: workspaceId,
        application_id: applicationId,
    };
    const parentRunId = (0, uuid_1.v4)();
    const testContext = new execution_1.TestContext(minimalTest, url, [], [], deviceEmulation, 0, undefined, parentRunId, undefined, accountFeatures, labsFeatures);
    testContext.setHighlightElements(true);
    return {
        testContext,
        parentRunId,
        accountFeatures,
        labsFeatures,
    };
}
