More test expectations (#16661)

* test: Add iframe API expectation.

* test: Add expectations for recording and live streaming.

* test: Remove iframe references from jaas/.

* test: Add a transcription expectation.
This commit is contained in:
bgrozev
2025-11-17 16:12:34 -06:00
committed by GitHub
parent ae256b23b8
commit 2885f39355
6 changed files with 34 additions and 37 deletions

View File

@@ -13,7 +13,14 @@ const defaultExpectations = {
*/
enabled: null,
},
iframe: {
// Whether the iframe integration is enabled (the inverse of `disableIframeAPI` from config.js)
enabled: true
},
jaas: {
liveStreamingEnabled: true,
recordingEnabled: true,
transcriptionEnabled: true,
/**
* Whether the jaas account is configured with the account-level setting to allow unauthenticated users to join.
*/

View File

@@ -3,6 +3,7 @@ import { expect } from '@wdio/globals';
import type { Participant } from '../../helpers/Participant';
import { setTestProperties } from '../../helpers/TestProperties';
import { config as testsConfig } from '../../helpers/TestsConfig';
import { expectations } from '../../helpers/expectations';
import { joinMuc } from '../../helpers/joinMuc';
setTestProperties(__filename, {
@@ -16,11 +17,9 @@ describe('Chat', () => {
p1 = await joinMuc({ name: 'p1', iFrameApi: true, token: testsConfig.jwt.preconfiguredToken });
p2 = await joinMuc({ name: 'p2', iFrameApi: true });
if (await p1.execute(() => config.disableIframeAPI)) {
ctx.skipSuiteTests = 'The environment has the iFrame API disabled.';
const iframeEnabled = !await p1.execute(() => config.disableIframeAPI);
return;
}
expect(iframeEnabled).toBe(expectations.iframe.enabled);
await p1.switchToMainFrame();
await p2.switchToMainFrame();

View File

@@ -1,6 +1,7 @@
import { isEqual } from 'lodash-es';
import { setTestProperties } from '../../helpers/TestProperties';
import { expectations } from '../../helpers/expectations';
import { ensureTwoParticipants } from '../../helpers/participants';
setTestProperties(__filename, {
@@ -12,12 +13,9 @@ describe('Kick participants', () => {
await ensureTwoParticipants({}, { name: 'p1', iFrameApi: true });
const { p1, p2 } = ctx;
const iframeEnabled = !await p1.execute(() => config.disableIframeAPI);
if (await p1.execute(() => config.disableIframeAPI)) {
ctx.skipSuiteTests = 'The environment has the iFrame API disabled.';
return;
}
expect(iframeEnabled).toBe(expectations.iframe.enabled);
await Promise.all([
p1.switchToMainFrame(),

View File

@@ -1,5 +1,6 @@
import { P1, P2 } from '../../helpers/Participant';
import { setTestProperties } from '../../helpers/TestProperties';
import { expectations } from '../../helpers/expectations';
import { ensureTwoParticipants, parseJid } from '../../helpers/participants';
setTestProperties(__filename, {
@@ -11,12 +12,9 @@ describe('Participants presence', () => {
await ensureTwoParticipants({}, { name: 'p1', iFrameApi: true });
const { p1, p2 } = ctx;
const iframeEnabled = !await p1.execute(() => config.disableIframeAPI);
if (await p1.execute(() => config.disableIframeAPI)) {
ctx.skipSuiteTests = 'The environment has the iFrame API disabled.';
return;
}
expect(iframeEnabled).toBe(expectations.iframe.enabled);
await Promise.all([
p1.switchToMainFrame(),

View File

@@ -2,6 +2,7 @@ import { Participant } from '../../helpers/Participant';
import { setTestProperties } from '../../helpers/TestProperties';
import { config as testsConfig } from '../../helpers/TestsConfig';
import WebhookProxy from '../../helpers/WebhookProxy';
import { expectations } from '../../helpers/expectations';
import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
setTestProperties(__filename, {
@@ -12,16 +13,13 @@ setTestProperties(__filename, {
/**
* Tests the recording and live-streaming functionality of JaaS (including relevant webhooks) exercising the iFrame API
* commands and functions.
* TODO: read flags from config.
* TODO: also assert "this meeting is being recorder" notificaitons are show/played?
* TODO: also assert "this meeting is being recorded" notifications are show/played?
*/
describe('Recording and live-streaming', () => {
const tenant = testsConfig.jaas.tenant;
const customerId = tenant?.replace('vpaas-magic-cookie-', '');
// TODO: read from config
let recordingDisabled: boolean;
// TODO: read from config
let liveStreamingDisabled: boolean;
let recordingEnabled: boolean;
let liveStreamingEnabled: boolean;
let p: Participant;
let webhooksProxy: WebhookProxy;
@@ -29,18 +27,17 @@ describe('Recording and live-streaming', () => {
webhooksProxy = ctx.webhooksProxy;
p = await joinJaasMuc({ iFrameApi: true, token: t({ moderator: true }) }, { roomName: ctx.roomName });
// TODO: what should we do in this case? Add a config for this?
if (await p.execute(() => config.disableIframeAPI)) {
ctx.skipSuiteTests = 'The environment has the iFrame API disabled.';
recordingEnabled = Boolean(await p.execute(() => config.recordingService?.enabled));
expect(recordingEnabled).toBe(expectations.jaas.recordingEnabled);
return;
liveStreamingEnabled = Boolean(await p.execute(() => config.liveStreaming?.enabled));
expect(liveStreamingEnabled).toBe(expectations.jaas.liveStreamingEnabled);
if (liveStreamingEnabled && !process.env.YTUBE_TEST_STREAM_KEY) {
liveStreamingEnabled = false;
console.log('Skipping live-streaming tests because YTUBE_TEST_STREAM_KEY is not set.');
}
// TODO: only read if config says so
recordingDisabled = Boolean(!await p.execute(() => config.recordingService?.enabled));
liveStreamingDisabled = Boolean(!await p.execute(() => config.liveStreaming?.enabled))
|| !process.env.YTUBE_TEST_STREAM_KEY;
await p.switchToMainFrame();
});
@@ -138,7 +135,7 @@ describe('Recording and live-streaming', () => {
}
it('start/stop recording using the iFrame command', async () => {
if (recordingDisabled) {
if (!recordingEnabled) {
return;
}
@@ -150,7 +147,7 @@ describe('Recording and live-streaming', () => {
});
it('start/stop recording using the iFrame function', async () => {
if (recordingDisabled) {
if (!recordingEnabled) {
return;
}
@@ -162,7 +159,7 @@ describe('Recording and live-streaming', () => {
});
it('start/stop live-streaming using the iFrame command', async () => {
if (liveStreamingDisabled) {
if (!liveStreamingEnabled) {
return;
}

View File

@@ -3,6 +3,7 @@ import { expect } from '@wdio/globals';
import type { Participant } from '../../helpers/Participant';
import { setTestProperties } from '../../helpers/TestProperties';
import type WebhookProxy from '../../helpers/WebhookProxy';
import { expectations } from '../../helpers/expectations';
import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';
setTestProperties(__filename, {
@@ -25,12 +26,9 @@ describe('Transcription', () => {
token: t({ room, moderator: true }),
iFrameApi: true });
if (await p1.execute(() => config.disableIframeAPI || !config.transcription?.enabled)) {
// skip the test if iframeAPI or transcriptions are disabled
ctx.skipSuiteTests = 'The environment has the iFrame API or transcriptions disabled.';
const transcriptionEnabled = await p1.execute(() => !config.transcription?.enabled);
return;
}
expect(transcriptionEnabled).toBe(expectations.jaas.transcriptionEnabled);
p2 = await joinJaasMuc({
name: 'p2',