mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
feat(tests): Do not require WebhooksProxy for jaas dial-in test (#16595)
* Add a requireWebhooksProxy test property. * test: Make the jaas dial-in test use but not require WH proxy.
This commit is contained in:
@@ -6,15 +6,18 @@ export type ITestProperties = {
|
||||
* A more detailed description of what the test does, to be included in the Allure report.
|
||||
*/
|
||||
description?: string;
|
||||
/** The test requires the webhook proxy to be available. */
|
||||
requireWebhookProxy: boolean;
|
||||
/** The test requires jaas, it should be skipped when the jaas configuration is not enabled. */
|
||||
useJaas: boolean;
|
||||
/** The test requires the webhook proxy. */
|
||||
/** The test uses the webhook proxy if available. */
|
||||
useWebhookProxy: boolean;
|
||||
usesBrowsers: string[];
|
||||
};
|
||||
|
||||
const defaultProperties: ITestProperties = {
|
||||
useWebhookProxy: false,
|
||||
requireWebhookProxy: false,
|
||||
useJaas: false,
|
||||
usesBrowsers: [ 'p1' ]
|
||||
};
|
||||
@@ -105,5 +108,11 @@ export function loadTestFiles(files: string[]): void {
|
||||
* @returns Promise<ITestProperties> - The test properties with defaults applied
|
||||
*/
|
||||
export async function getTestProperties(testFilePath: string): Promise<ITestProperties> {
|
||||
return testProperties[testFilePath] || { ...defaultProperties };
|
||||
const properties = testProperties[testFilePath] || { ...defaultProperties };
|
||||
|
||||
if (properties.requireWebhookProxy && !properties.useWebhookProxy) {
|
||||
properties.useWebhookProxy = true;
|
||||
}
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
|
||||
import { fetchJson } from '../../helpers/utils';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@ describe('Dial-in', () => {
|
||||
|
||||
p1 = await joinJaasMuc({ name: 'p1', token: t({ room, moderator: true }) });
|
||||
webhooksProxy = ctx.webhooksProxy;
|
||||
if (!webhooksProxy) {
|
||||
console.error('WebhooksProxy is not available, will not verify webhooks.');
|
||||
}
|
||||
|
||||
expect(await p1.isInMuc()).toBe(true);
|
||||
if (expectations.dialIn.enabled !== null) {
|
||||
@@ -59,13 +62,20 @@ describe('Dial-in', () => {
|
||||
await dialIn(dialInPin);
|
||||
await waitForMedia(p1);
|
||||
|
||||
const startedPayload
|
||||
= await verifyStartedWebhooks(webhooksProxy, 'in', 'DIAL_IN_STARTED', customerId);
|
||||
let startedPayload: any;
|
||||
|
||||
if (webhooksProxy) {
|
||||
startedPayload
|
||||
= await verifyStartedWebhooks(webhooksProxy, 'in', 'DIAL_IN_STARTED', customerId);
|
||||
}
|
||||
|
||||
const endpointId = await p1.execute(() => APP?.conference?.listMembers()[0].getId());
|
||||
|
||||
await p1.getFilmstrip().kickParticipant(endpointId);
|
||||
|
||||
await verifyEndedWebhook(webhooksProxy, 'DIAL_IN_ENDED', customerId, startedPayload);
|
||||
if (webhooksProxy) {
|
||||
await verifyEndedWebhook(webhooksProxy, 'DIAL_IN_ENDED', customerId, startedPayload);
|
||||
}
|
||||
|
||||
await p1.hangup();
|
||||
});
|
||||
|
||||
@@ -7,8 +7,8 @@ import { joinJaasMuc, generateJaasToken as t } from '../../../helpers/jaas';
|
||||
import { verifyEndedWebhook, verifyStartedWebhooks, waitForMedia } from './util';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
useJaas: true,
|
||||
useWebhookProxy: true
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true
|
||||
});
|
||||
|
||||
describe('Dial-out', () => {
|
||||
|
||||
@@ -7,8 +7,8 @@ import { joinJaasMuc, generateJaasToken as t } from '../../../helpers/jaas';
|
||||
import { waitForMedia } from './util';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { setTestProperties } from '../../helpers/TestProperties';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2', 'p3' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
|
||||
import { IToken } from '../../helpers/token';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { setTestProperties } from '../../helpers/TestProperties';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
useJaas: true,
|
||||
useWebhookProxy: true
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true
|
||||
});
|
||||
|
||||
// This test is separate from passcode.spec.ts, because it needs to use a different room name, and webhooksProxy is only
|
||||
|
||||
@@ -7,8 +7,8 @@ import WebhookProxy from '../../helpers/WebhookProxy';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import WebhookProxy from '../../helpers/WebhookProxy';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
useJaas: true,
|
||||
useWebhookProxy: true
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ import type WebhookProxy from '../../helpers/WebhookProxy';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { setTestProperties } from '../../../helpers/TestProperties';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2', 'p3', 'p4' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import WebhookProxy from '../../../helpers/WebhookProxy';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2', 'p3' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import { setTestProperties } from '../../../helpers/TestProperties';
|
||||
import { joinJaasMuc, generateJaasToken as t } from '../../../helpers/jaas';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
requireWebhookProxy: true,
|
||||
useJaas: true,
|
||||
useWebhookProxy: true,
|
||||
usesBrowsers: [ 'p1', 'p2' ]
|
||||
});
|
||||
|
||||
|
||||
@@ -273,9 +273,8 @@ export const config: WebdriverIO.MultiremoteConfig = {
|
||||
globalAny.ctx.webhooksProxy.connect();
|
||||
}
|
||||
|
||||
if (testProperties.useWebhookProxy && !globalAny.ctx.webhooksProxy) {
|
||||
console.warn(`WebhookProxy is not available, skipping ${testName}`);
|
||||
globalAny.ctx.skipSuiteTests = 'WebhooksProxy is not required but not available';
|
||||
if (testProperties.requireWebhookProxy && !globalAny.ctx.webhooksProxy) {
|
||||
throw new Error('The test requires WebhookProxy, but it is not available.');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user