Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

4.6 KB
Raw Blame
import { IConfig } from '../../react/features/base/config/configType';

import type { Participant } from './Participant';
import { ITestProperties } from './TestProperties';
import type WebhookProxy from './WebhookProxy';
import { IToken, ITokenOptions } from './token';

export type IContext = {
    /**
     * The name (describe block title) of the suite in which a test failed. Used to skip the remaining tests in that
     * suite while still running tests in other describe blocks in the same file.
     */
    failedSuite?: string;

    /**
     *  The up-to-six browser instances provided by the framework. These can be initialized using
     *  ensureOneParticipant, ensureTwoParticipants, etc. from participants.ts.
     **/
    p1: Participant;
    p2: Participant;
    p3: Participant;
    p4: Participant;
    p5: Participant;
    p6: Participant;

    /** A room name automatically generated by the framework for convenience. */
    roomName: string;
    /**
     * A flag that tests can set, which signals to the framework that the (rest of the) test suite should be skipped.
     * A string value indicates the reason for the skipped (to be included in the Allure report).
     */
    skipSuiteTests: boolean | string;
    /**
     * Test properties provided by the test file via TestProperties.setTestProperties. Used by the framework to
     * set up the context appropriately.
     **/
    testProperties: ITestProperties;
    times: any;
    /**
     * A WebhooksProxy instance generated by the framework and available for tests to use, if configured.
     * Note that this is only configured for roomName, if a test wishes to use a different room name it can set up
     * a WebhooksProxy instance itself.
     */
    webhooksProxy: WebhookProxy;
};

export type IParticipantOptions = {
    /**
     * The browser session to bind the participant to. When omitted, the multiremote instance named `name`
     * (one of p1..p6) is used. Set it for participants created outside the multiremote setup, such as
     * load-test participants that have their own sessions or share one via tabs.
     */
    driver?: WebdriverIO.Browser;
    /** Whether it should use the iFrame API. */
    iFrameApi?: boolean;
    /**
     * Whether the participant runs the lightweight load-test client (lib-jitsi-meet only, no UI) instead of
     * the full Jitsi Meet application. UI-only steps (prejoin, styling, dialogs) are skipped for such participants.
     */
    loadTest?: boolean;
    /** Determines the browser instance to use. Regular tests use p1..p6, load tests use generated names. */
    name: string;
    /** An optional token to use. */
    token?: IToken;
};

/**
 * Options for joinConference.
 */
export type IParticipantJoinOptions = {

    /**
     * Config overwrites to use.
     */
    configOverwrite?: IConfig;

    /** The name of the room to join */
    roomName: string;

    /**
     * Whether to skip setting display name.
     */
    skipDisplayName?: boolean;

    /**
     * Whether to skip the prejoin button 'Join' click when joining.
     */
    skipPrejoinButtonClick?: boolean;

    /**
     * Whether to skip waiting for the participant to join the room. Cases like lobby where we do not succeed to join
     * based on the logic of the test.
     */
    skipWaitToJoin?: boolean;

    /**
     * An optional tenant to use. If provided it overrides the default.
     */
    tenant?: string;

    /**
     * An optional string to append to the URL when joining the room.
     */
    urlAppendString?: string;
};

export type IJoinOptions = {

    /**
     * Config overwrites to pass to IParticipantJoinOptions.
     */
    configOverwrite?: IConfig;

    /**
     * To be able to override the ctx generated room name. If missing the one from the context will be used.
     */
    roomName?: string;

    /**
     *The skip display name setting to pass to IParticipantJoinOptions.
     */
    skipDisplayName?: boolean;

    /**
     * Whether to skip in meeting checks like ice connected and send receive data. For single in meeting participant.
     */
    skipInMeetingChecks?: boolean;

    /**
     * Whether to skip the prejoin button 'Join' click when joining.
     */
    skipPrejoinButtonClick?: boolean;

    /**
     * The skip waiting for the participant to join the room setting to pass to IParticipantJoinOptions.
     */
    skipWaitToJoin?: boolean;

    /**
     * An optional tenant to use. If provided the default tenant is changed to it.
     */
    tenant?: string;

    /**
     * Options used when generating a token.
     */
    tokenOptions?: ITokenOptions;

    /**
     * An optional string to append to the URL when joining the room.
     */
    urlAppendString?: string;
};