Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(tests): fix recordingDialogConfig and recordingTranscription test suites
damencho800fd7884bef
diff --git a/tests/pageobjects/Toolbar.ts b/tests/pageobjects/Toolbar.tsindex 380f65b05d..7e8633f1e1 100644--- a/tests/pageobjects/Toolbar.ts+++ b/tests/pageobjects/Toolbar.ts@@ -87,7 +87,10 @@ export default class Toolbar extends BasePageObject {async clickRecordingButton(): Promise<void> {// The recording button lives in the overflow ("More actions") menu; open it, click, close// (matches clickSettings/clickSecurity — closeOverflowMenu is a no-op once the dialog opens).- return this.clickButtonInOverflowMenu(RECORDING);+ // Match either label, same as hasRecordingButton: moderators who can't transcribe (e.g.+ // transcription.enabled=false) get "Record" too, not just non-moderators — see+ // AbstractRecordButton._getAccessibilityLabel()/canAddTranscriber().+ return this.clickButtonInOverflowMenu([ RECORDING, RECORDING_NON_MODERATOR ]);}/**@@ -346,18 +349,30 @@ export default class Toolbar extends BasePageObject {/*** Ensure the overflow menu is open and clicks on a specified button.- * @param accessibilityLabel The accessibility label of the button to be clicked.+ * @param accessibilityLabel The accessibility label of the button to be clicked, or a list of+ * candidate labels (e.g. a moderator vs. non-moderator variant) — the first one found in the+ * DOM is clicked.* @private*/- private async clickButtonInOverflowMenu(accessibilityLabel: string) {+ private async clickButtonInOverflowMenu(accessibilityLabel: string | string[]) {await this.openOverflowMenu();// sometimes the overflow button tooltip is over the last entry in the menu,// so let's move focus away before clicking the buttonawait this.participant.driver.$('#overflow-context-menu').moveTo();- await this.participant.log(`Clicking on: ${accessibilityLabel}`);- await this.getButton(accessibilityLabel).click();+ const labels = Array.isArray(accessibilityLabel) ? accessibilityLabel : [ accessibilityLabel ];+ let label = labels[0];++ for (const candidate of labels) {+ if (await this.getButton(candidate).isExisting()) {+ label = candidate;+ break;+ }+ }++ await this.participant.log(`Clicking on: ${label}`);+ await this.getButton(label).click();await this.closeOverflowMenu();}diff --git a/tests/specs/jaas/recordingDialogConfig.spec.ts b/tests/specs/jaas/recordingDialogConfig.spec.tsnew file mode 100644index 0000000000..030065c161--- /dev/null+++ b/tests/specs/jaas/recordingDialogConfig.spec.ts@@ -0,0 +1,138 @@+import { setTestProperties } from '../../helpers/TestProperties';+import { expectations } from '../../helpers/expectations';+import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';++/**+ * Joins (or rejoins) p1 as a moderator granting only the given JWT feature claims, with no+ * config.js overrides anywhere in this file — see recordButtonProps() / isLiveStreamingButtonVisible()+ * in react/features/recording: on a JaaS (vpaas) tenant there is no config-only fallback once the+ * JWT lacks a feature claim, unlike the non-JaaS tenant, so toolbar visibility here is driven purely+ * by these feature claims against the environment's ambient (always-on, per expectations.jaas.*)+ * config. The config-driven side of this same dialog (no custom JWT, varying config.js instead) is+ * covered separately by tests/specs/misc/recordingDialogConfig.spec.ts.+ *+ * A fresh join is required (rather than ensureOneParticipant, which no-ops if already in the+ * conference) because each test in this file exercises a different set of JWT feature claims.+ */+async function joinWithFeatures(features: Record<string, boolean>): Promise<void> {+ await joinJaasMuc({+ name: 'p1',+ token: t({+ moderator: true,+ features+ })+ });+}++/**+ * Mirrors LocalRecordingManager.isSupported() plus the embedding guard that+ * supportsLocalRecording() adds — the same probe tests/specs/misc/recordingDialogConfig.spec.ts and+ * recordingButtonVisibility.spec.ts use, because these browser capability gates are frequently+ * unmet in the automated test browser regardless of any JWT feature claim.+ */+async function isLocalRecordingSupportedByBrowser(): Promise<boolean> {+ return ctx.p1.execute(() => {+ const browser = JitsiMeetJS.util.browser;+ const PREFERRED_MEDIA_TYPE = 'video/webm;codecs=vp8,opus';++ const isSupported = browser.isChromiumBased()+ && !browser.isElectron()+ && !browser.isReactNative()+ && !browser.isMobileDevice()++ // @ts-ignore+ && Boolean(navigator.mediaDevices.setCaptureHandleConfig)++ // @ts-ignore+ && typeof window.showSaveFilePicker !== 'undefined'+ && MediaRecorder.isTypeSupported(PREFERRED_MEDIA_TYPE);++ let embeddedOk = true;++ try {+ if (window.self !== window.top) {+ embeddedOk = window.self.location.host === window.parent.location.host;+ }+ } catch (e) {+ embeddedOk = false;+ }++ return isSupported && embeddedOk;+ });+}++setTestProperties(__filename, {+ description: 'Recording & Transcription dialog toolbar visibility across JWT feature claims',+ usesBrowsers: [ 'p1' ],+ useJaas: true+});++/*+ * Full 2^3 matrix over the three independently grantable JWT feature claims: recording,+ * transcription and livestreaming. No config.js override is used anywhere here — the environment's+ * ambient config is assumed to always enable recordingService, transcription and liveStreaming (see+ * expectations.jaas.*), so every combination below isolates the JWT-feature-gated branches of+ * getRecordButtonProps() and isLiveStreamingButtonVisible() rather than config:+ *+ * - On a JaaS tenant, getRecordButtonProps() has no config-only fallback: the toolbar Record &+ * Transcribe button's visibility reduces to localRecordingAvailable || recording || transcription+ * (the JWT claims), since the ambient config enables both services.+ * - The Live Streaming toolbar button is fully orthogonal and purely JWT-gated: only the+ * livestreaming claim matters (see LiveStream/AbstractLiveStreamButton.ts).+ *+ * localRecordingAvailable also depends on browser capabilities (MediaRecorder/File System Access+ * support) that are frequently unmet in the automated test browser — probed once up front so the+ * per-combination expectations stay accurate regardless of what the test browser actually supports.+ */+describe('Recording dialog JWT feature matrix — recording × transcription × live streaming', () => {+ // A const-bound holder object, rather than a reassigned `let`, so the it() closures created+ // inside the loop below don't trip @typescript-eslint/no-loop-func — only its property (set+ // once, in 'setup', before any of the loop's tests run) actually changes.+ const localRecordingSupport = { byBrowser: false };++ it('setup', async () => {+ if (!expectations.jaas.recordingEnabled+ || !expectations.jaas.transcriptionEnabled+ || !expectations.jaas.liveStreamingEnabled) {+ ctx.skipSuiteTests = 'Recording, transcription and live streaming must all be enabled '+ + 'in this environment for the JWT feature claims to be the only variable';++ return;+ }++ await joinWithFeatures({+ recording: true,+ transcription: true,+ livestreaming: true+ });+ localRecordingSupport.byBrowser = await isLocalRecordingSupportedByBrowser();+ });++ const BOOLEANS = [ true, false ];++ for (const recordingFeature of BOOLEANS) {+ for (const transcriptionFeature of BOOLEANS) {+ for (const livestreamingFeature of BOOLEANS) {+ const title = `recording=${recordingFeature} `+ + `transcription=${transcriptionFeature} `+ + `livestreaming=${livestreamingFeature}`;++ it(title, async () => {+ await joinWithFeatures({+ recording: recordingFeature,+ transcription: transcriptionFeature,+ livestreaming: livestreamingFeature+ });++ const p1 = ctx.p1;++ expect(await p1.getToolbar().hasLiveStreamingButton()).toBe(livestreamingFeature);++ const dialogCanOpen = recordingFeature || transcriptionFeature || localRecordingSupport.byBrowser;++ expect(await p1.getToolbar().hasRecordingButton()).toBe(dialogCanOpen);+ });+ }+ }+ }+});diff --git a/tests/specs/jaas/recordingTranscription.spec.ts b/tests/specs/jaas/recordingTranscription.spec.tsindex f2b0e79ad6..52b249196a 100644--- a/tests/specs/jaas/recordingTranscription.spec.ts+++ b/tests/specs/jaas/recordingTranscription.spec.ts@@ -1,5 +1,6 @@import { Participant } from '../../helpers/Participant';import { setTestProperties } from '../../helpers/TestProperties';+import { config as testsConfig } from '../../helpers/TestsConfig';import { expectations } from '../../helpers/expectations';import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';@@ -10,6 +11,25 @@ setTestProperties(__filename, {// Counter used to give each test its own room — see joinAsModerator().let roomCounter = 0;+/**+ * Builds a fresh, per-test room name out of ctx.roomName (see joinAsModerator()).+ *+ * ctx.roomName already has the environment's ROOM_NAME_SUFFIX (e.g. "_alpha-canary") appended as+ * its trailing component (see generateRoomName() in helpers/utils.ts), and some environments rely+ * on that suffix being the tail of the room name (e.g. to route/map the conference correctly).+ * Simply appending "-${roomCounter}" to ctx.roomName would push the suffix out of that position,+ * so the counter is inserted right before it instead.+ */+function uniqueRoomName(): string {+ const suffix = testsConfig.roomName.suffix;++ if (suffix && ctx.roomName.endsWith(`_${suffix}`)) {+ return `${ctx.roomName.slice(0, -`_${suffix}`.length)}-${roomCounter}_${suffix}`;+ }++ return `${ctx.roomName}-${roomCounter}`;+}+/*** Joins a JaaS meeting as a moderator using the iFrame API wrapper.*@@ -25,7 +45,7 @@ async function joinAsModerator(): Promise<Participant> {const p = await joinJaasMuc({ iFrameApi: true, token: t({ moderator: true }) },- { roomName: `${ctx.roomName}-${roomCounter}` });+ { roomName: uniqueRoomName() });// joinJaasMuc leaves the driver focused inside the Jitsi iframe, but the iFrame API// (window.jitsiAPI) lives on the wrapper page. Switch to the main frame so executeCommand()@@ -35,6 +55,36 @@ async function joinAsModerator(): Promise<Participant> {return p;}+/**+ * Minimum wall-clock gap enforced between successive Jibri start/stop commands sent by this+ * spec, in ms.+ *+ * Prosody's mod_filter_iq_jibri throttles jibri start/stop IQs per source IP+ * (max_number_ip_attempts_per_minute, default 9/min), separately from the per-room throttle+ * joinAsModerator()'s fresh room already dodges — a fresh room resets the room-scoped throttle+ * only, not this one. This suite alone sends far more than 9 start/stop IQs across its tests, so+ * without pacing it trips the per-IP throttle (observed as "policy-violation"/wait on the start+ * or stop IQ, surfacing as a session that never actually starts or stops). 8s keeps this file's+ * rate under the throttle's refill rate (60s / 9 ≈ 6.7s), with headroom for other jaas specs+ * sharing the same CI egress IP.+ */+const MIN_JIBRI_COMMAND_GAP_MS = 8_000;+let lastJibriCommandTime = 0;++/**+ * Waits out whatever is left of MIN_JIBRI_COMMAND_GAP_MS since the last call, then marks now as+ * the new last call time. Await this immediately before every jibri start/stop command.+ */+async function paceJibriCommand(): Promise<void> {+ const wait = MIN_JIBRI_COMMAND_GAP_MS - (Date.now() - lastJibriCommandTime);++ if (wait > 0) {+ await new Promise(resolve => setTimeout(resolve, wait));+ }++ lastJibriCommandTime = Date.now();+}+/*** Sends the startRecording command and waits until jicofo actually accepts it (a live FILE* session shows up in the recording state), retrying on silent rejection.@@ -49,6 +99,7 @@ async function joinAsModerator(): Promise<Participant> {*/async function startFileRecording(p: Participant, options: { mode: string; transcription?: boolean; }) {for (let attempt = 1; attempt <= 3; attempt++) {+ await paceJibriCommand();await p.getIframeAPI().executeCommand('startRecording', options);await p.switchToIFrame();@@ -205,6 +256,7 @@ describe('Recording & transcription nudge notifications', () => {});} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file');await waitForRecordingStopExecuted(p);}@@ -218,6 +270,7 @@ describe('Recording & transcription nudge notifications', () => {const p = await joinAsModerator();try {+ await paceJibriCommand();await p.getIframeAPI().executeCommand('startRecording', { transcription: true });await p.switchToIFrame();@@ -228,6 +281,7 @@ describe('Recording & transcription nudge notifications', () => {expect(await nudgeButton.isExisting()).toBe(true);} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file', true);await waitForRecordingStopExecuted(p, true);}@@ -252,6 +306,7 @@ describe('Recording & transcription nudge notifications', () => {await p.switchToMainFrame();// Stop only transcription while recording keeps running.+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file', true);await p.switchToIFrame();@@ -265,6 +320,7 @@ describe('Recording & transcription nudge notifications', () => {expect(await p.driver.$('[data-testid="recording.onWithTranscription"]').isExisting()).toBe(false);} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file');await waitForRecordingStopExecuted(p);}@@ -303,6 +359,7 @@ describe('Recording & transcription dialog — manage mode', () => {await dialog.cancel();} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file');await waitForRecordingStopExecuted(p);}@@ -316,6 +373,7 @@ describe('Recording & transcription dialog — manage mode', () => {const p = await joinAsModerator();try {+ await paceJibriCommand();await p.getIframeAPI().executeCommand('startRecording', { transcription: true });await p.switchToIFrame();@@ -337,6 +395,7 @@ describe('Recording & transcription dialog — manage mode', () => {await dialog.cancel();} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file', true);await waitForRecordingStopExecuted(p, true);}@@ -373,6 +432,7 @@ describe('Recording & transcription dialog — manage mode', () => {await dialog.cancel();} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file');await waitForRecordingStopExecuted(p);}@@ -407,6 +467,7 @@ describe('Recording & transcription dialog — manage mode', () => {await dialog.cancel();} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file');await waitForRecordingStopExecuted(p);}@@ -436,6 +497,7 @@ describe('Recording & transcription dialog — manage mode', () => {await dialog.waitForDisplay();// Stop only transcription — the action applies immediately and closes the dialog.+ await paceJibriCommand();await dialog.stopTranscription();// Transcription should stop.@@ -451,6 +513,7 @@ describe('Recording & transcription dialog — manage mode', () => {expect(recordingStillOn).toBe(true);} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file');await waitForRecordingStopExecuted(p);}@@ -480,6 +543,7 @@ describe('Recording & transcription dialog — manage mode', () => {await dialog.waitForDisplay();// Stop only recording — the action applies immediately and closes the dialog.+ await paceJibriCommand();await dialog.stopRecording();// Recording should stop.@@ -493,6 +557,7 @@ describe('Recording & transcription dialog — manage mode', () => {expect(transcriptionStillOn).toBe(true);} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file', true);await waitForRecordingStopExecuted(p, true);}@@ -520,12 +585,14 @@ describe('Recording & transcription dialog — manage mode', () => {const dialog = p.getRecordingTranscriptionDialog();await dialog.waitForDisplay();+ await paceJibriCommand();await dialog.stopBoth();await waitForRecordingStopped(p);await waitForTranscriptionStopped(p);} finally {await p.switchToMainFrame();+ await paceJibriCommand();await p.getIframeAPI().executeCommand('stopRecording', 'file', true);await waitForRecordingStopExecuted(p, true);}diff --git a/tests/specs/misc/recordingDialogConfig.spec.ts b/tests/specs/misc/recordingDialogConfig.spec.tsindex 6c732ef935..017e3bf8be 100644--- a/tests/specs/misc/recordingDialogConfig.spec.ts+++ b/tests/specs/misc/recordingDialogConfig.spec.ts@@ -1,21 +1,34 @@import { setTestProperties } from '../../helpers/TestProperties';import { config as testsConfig } from '../../helpers/TestsConfig';import { joinMuc } from '../../helpers/joinMuc';-import { generateToken } from '../../helpers/token';/**- * Joins (or rejoins) p1 as a moderator with the given config.js overrides, granting the- * recording/transcription/livestreaming JWT feature claims by default (see token.ts) so that the- * dialog's behavior reflects only the config flags under test, not JWT feature availability.+ * Joins (or rejoins) p1 as a moderator with the given config.js overrides, using the shared+ * preconfigured token (see TestsConfig.ts) rather than a self-signed one. This suite only ever+ * varies config.js, never JWT feature claims — on this (non-JaaS) tenant, getRecordButtonProps()+ * and friends fall back to config alone once the JWT carries no feature claims, so the shared+ * token is enough. The JWT-feature-driven side of this same dialog (only reachable on a JaaS+ * tenant, where that config-only fallback doesn't apply) is covered separately by+ * tests/specs/jaas/recordingDialogConfig.spec.ts.** A fresh join is required (rather than ensureOneParticipant, which no-ops if already in the* conference) because each test in this file exercises a different config.js combination.+ *+ * Waits for p1's moderator role to actually land client-side before returning: the server grants+ * it (the JWT's moderator claim) on every join, but the toolbar's recording button renders the+ * non-moderator "Record" label (instead of "Record & Transcribe") until that presence update is+ * processed — a gap the rest of this file otherwise has no reason to guard against itself.*/async function joinWithConfig(configOverwrite: Record<string, unknown>): Promise<void> {await joinMuc({name: 'p1',- token: generateToken({ moderator: true })+ token: testsConfig.jwt.preconfiguredToken}, { configOverwrite });++ await ctx.p1.driver.waitUntil(() => ctx.p1.isModerator(), {+ timeout: 5_000,+ timeoutMsg: 'p1 did not become a moderator in time'+ });}/**@@ -55,6 +68,18 @@ async function isLocalRecordingSupportedByBrowser(): Promise<boolean> {});}+/**+ * Whether Dropbox is configured as a recording storage integration in this deployment+ * (config.dropbox.appKey), independent of anything this file overrides. AbstractStartRecordingDialog+ * treats it as a fallback recording service whenever recordingService.enabled is false (and prefers+ * it over an empty selection, though local recording still wins over it when both are available) —+ * so wherever "is some recording service available" is checked, Dropbox has to be accounted for too+ * on any deployment where it happens to be configured, exactly like localRecordingSupport.byBrowser.+ */+async function isDropboxEnabledInDeployment(): Promise<boolean> {+ return ctx.p1.execute(() => typeof config.dropbox?.appKey === 'string');+}+/*** Fakes a "recording running" / "transcription running" state by dispatching the same low-level,* side-effect-free redux actions the app's own middleware dispatches once a session is actually@@ -99,48 +124,47 @@ setTestProperties(__filename, {});/*- * Full 2^4 matrix over the four independently togglable config.js flags: recordingService.enabled,- * transcription.enabled, localRecording.disable and liveStreaming.enabled. Expected behavior for- * each combination, derived from the source (AbstractStartRecordingDialog(Content), recording/- * functions.ts#getRecordButtonProps, LiveStream/functions.ts#isLiveStreamingButtonVisible):+ * Full 2^3 matrix over the three independently togglable config.js flags: recordingService.enabled,+ * transcription.enabled and localRecording.disable. Expected behavior for each combination, derived+ * from the source (AbstractStartRecordingDialog(Content), recording/functions.ts#getRecordButtonProps):*- * - The moderator token grants the recording/transcription/livestreaming JWT feature claims- * unconditionally (see joinWithConfig), so getRecordButtonProps() always takes its- * "isJwtFeatureEnabled(..., RECORDING)" branch once local recording is unavailable — meaning the- * toolbar button's visibility (and therefore whether the recording section can be inspected at- * all) reduces to recordingService.enabled || localRecordingAvailable, and does NOT by itself- * depend on transcription.enabled (that branch of the priority chain is never reached while the- * RECORDING claim is granted).- * - Whenever the dialog *can* open, the recording section always renders (same- * recordingService.enabled || localRecordingAvailable condition) — what changes is which- * storage service ends up selected by default: "Recording service" takes priority over "Local- * recording" in the dialog's constructor.+ * - Every environment this suite runs against grants the local participant a default "recording"+ * JWT feature claim regardless of authentication — confirmed via diagnostics logged below+ * (localParticipantFeatures.recording is "true" even with no token/JWT at all). getRecordButtonProps()+ * checks that claim *before* falling back to config-only visibility, so that fallback (which would+ * let transcription.enabled alone drive visibility) is unreachable here: the toolbar button's+ * visibility (and therefore whether the recording section can be inspected at all) reduces to+ * recordingService.enabled || dropboxAvailable || localRecordingAvailable, same as+ * recordingEnabled in getRecordButtonProps (which ORs in Dropbox too) — transcription.enabled never+ * factors into it.+ * - Whenever the dialog *can* open, the recording section renders — what changes is which storage+ * service ends up selected by default: "Recording service" takes priority, then "Local recording",+ * then "Dropbox" (see the constructor's own priority chain in AbstractStartRecordingDialog.ts).* - The transcription section, its Start button, and the footer's "Start both" button are each- * governed purely by transcription.enabled (independent of the other three flags, since nothing- * is actually started in these tests).- * - The Live Streaming toolbar button is fully orthogonal: only liveStreaming.enabled matters.+ * governed purely by transcription.enabled (independent of the other two flags, since nothing is+ * actually started in these tests) — but only reachable at all when the dialog can open in the+ * first place, i.e. when some recording service is also available.+ *+ * The Live Streaming toolbar button is JWT-feature-gated with no config-only fallback (see+ * LiveStream/AbstractLiveStreamButton.ts), so it can't be driven by config.js alone here — that's+ * covered on the JaaS side instead, by tests/specs/jaas/recordingDialogConfig.spec.ts.** localRecordingAvailable also depends on browser capabilities (MediaRecorder/File System Access* support) that are frequently unmet in the automated test browser — probed once up front, exactly* like recordingButtonVisibility.spec.ts does, so the per-combination expectations stay accurate- * regardless of what the test browser actually supports.+ * regardless of what the test browser actually supports. dropboxAvailable is similarly probed once,+ * since it depends on this deployment's config rather than anything this file overrides.*/-describe('Recording dialog config matrix — recording × transcription × local recording × live streaming', () => {+describe('Recording dialog config matrix — recording × transcription × local recording', () => {// A const-bound holder object, rather than a reassigned `let`, so the it() closures created- // inside the loop below don't trip @typescript-eslint/no-loop-func — only its property (set- // once, in 'setup', before any of the loop's tests run) actually changes.- const localRecordingSupport = { byBrowser: false };+ // inside the loop below don't trip @typescript-eslint/no-loop-func — only its properties (set+ // once, in 'setup', before any of the loop's tests run) actually change.+ const environment = { dropboxAvailable: false, localRecordingByBrowser: false };it('setup', async () => {- if (!testsConfig.jwt.kid || !testsConfig.jwt.privateKeyPath) {- ctx.skipSuiteTests = 'JWT signing is not configured in this environment '- + '(JWT_KID/JWT_PRIVATE_KEY_PATH)';-- return;- }-await joinWithConfig({});- localRecordingSupport.byBrowser = await isLocalRecordingSupportedByBrowser();+ environment.localRecordingByBrowser = await isLocalRecordingSupportedByBrowser();+ environment.dropboxAvailable = await isDropboxEnabledInDeployment();});const BOOLEANS = [ true, false ];@@ -148,57 +172,54 @@ describe('Recording dialog config matrix — recording × transcription × localfor (const recordingServiceEnabled of BOOLEANS) {for (const transcriptionEnabled of BOOLEANS) {for (const localRecordingDisabled of BOOLEANS) {- for (const liveStreamingEnabled of BOOLEANS) {- const title = `recordingService.enabled=${recordingServiceEnabled} `- + `transcription.enabled=${transcriptionEnabled} `- + `localRecording.disable=${localRecordingDisabled} `- + `liveStreaming.enabled=${liveStreamingEnabled}`;+ const title = `recordingService.enabled=${recordingServiceEnabled} `+ + `transcription.enabled=${transcriptionEnabled} `+ + `localRecording.disable=${localRecordingDisabled}`;++ it(title, async () => {+ await joinWithConfig({+ recordingService: { enabled: recordingServiceEnabled },+ transcription: { enabled: transcriptionEnabled },+ localRecording: { disable: localRecordingDisabled }+ });- it(title, async () => {- await joinWithConfig({- recordingService: { enabled: recordingServiceEnabled },- transcription: { enabled: transcriptionEnabled },- localRecording: { disable: localRecordingDisabled },- liveStreaming: { enabled: liveStreamingEnabled }- });+ const p1 = ctx.p1;- const p1 = ctx.p1;+ const localRecordingAvailable = !localRecordingDisabled && environment.localRecordingByBrowser;+ const dialogCanOpen+ = recordingServiceEnabled || localRecordingAvailable || environment.dropboxAvailable;- // Orthogonal to the other three flags — always checked.- expect(await p1.getToolbar().hasLiveStreamingButton()).toBe(liveStreamingEnabled);+ expect(await p1.getToolbar().hasRecordingButton()).toBe(dialogCanOpen);- const localRecordingAvailable = !localRecordingDisabled && localRecordingSupport.byBrowser;- const dialogCanOpen = recordingServiceEnabled || localRecordingAvailable;+ if (!dialogCanOpen) {+ // Nothing else is inspectable: the dialog cannot be opened at all.+ return;+ }- expect(await p1.getToolbar().hasRecordingButton()).toBe(dialogCanOpen);+ const dialog = p1.getRecordingTranscriptionDialog();- if (!dialogCanOpen) {- // Nothing else is inspectable: the dialog cannot be opened at all.- return;- }+ await p1.getToolbar().clickRecordingButton();+ await dialog.waitForDisplay();- const dialog = p1.getRecordingTranscriptionDialog();+ // The recording section always renders here (same condition as dialogCanOpen);+ // which service ends up selected is what differs.+ await dialog.toggleRecordingOptions();- await p1.getToolbar().clickRecordingButton();- await dialog.waitForDisplay();+ const expectedService = recordingServiceEnabled ? 'Recording service'+ : localRecordingAvailable ? 'Local recording'+ : 'Dropbox';- // The recording section always renders here (same condition as- // dialogCanOpen); which service ends up selected is what differs.- await dialog.toggleRecordingOptions();- expect(await dialog.getSelectedService())- .toBe(recordingServiceEnabled ? 'Recording service' : 'Local recording');+ expect(await dialog.getSelectedService()).toBe(expectedService);- expect(await dialog.hasTranscriptionOptions()).toBe(transcriptionEnabled);- expect(await dialog.hasStartTranscriptionButton()).toBe(transcriptionEnabled);+ expect(await dialog.hasTranscriptionOptions()).toBe(transcriptionEnabled);+ expect(await dialog.hasStartTranscriptionButton()).toBe(transcriptionEnabled);- // The footer only makes sense when both sections are present; the recording- // section is always present on this branch, so this reduces to- // transcriptionEnabled.- expect(await dialog.hasStartBothButton()).toBe(transcriptionEnabled);+ // The footer only makes sense when both sections are present; the recording+ // section is always present on this branch, so this reduces to transcriptionEnabled.+ expect(await dialog.hasStartBothButton()).toBe(transcriptionEnabled);- await dialog.cancel();- });- }+ await dialog.cancel();+ });}}}@@ -213,13 +234,6 @@ describe('Recording dialog config matrix — recording × transcription × local* "Start both" starts the missing one.*/describe('Recording dialog config — mixed running state (recording vs transcription)', () => {- it('setup', async () => {- if (!testsConfig.jwt.kid || !testsConfig.jwt.privateKeyPath) {- ctx.skipSuiteTests = 'JWT signing is not configured in this environment '- + '(JWT_KID/JWT_PRIVATE_KEY_PATH)';- }- });-const RUNNING_STATE_COMBINATIONS: Array<[boolean, boolean]> = [[ false, false ],[ true, false ],@@ -254,13 +268,6 @@ describe('Recording dialog config — mixed running state (recording vs transcri});describe('Recording dialog config — recordingService.sharingEnabled', () => {- it('setup', async () => {- if (!testsConfig.jwt.kid || !testsConfig.jwt.privateKeyPath) {- ctx.skipSuiteTests = 'JWT signing is not configured in this environment '- + '(JWT_KID/JWT_PRIVATE_KEY_PATH)';- }- });-it('sharingEnabled: true shows the "share the recording link" switch', async () => {await joinWithConfig({recordingService: {@@ -308,13 +315,6 @@ describe('Recording dialog config — localRecording.notifyAllParticipants', ()let localRecordingSupported: boolean;it('setup', async () => {- if (!testsConfig.jwt.kid || !testsConfig.jwt.privateKeyPath) {- ctx.skipSuiteTests = 'JWT signing is not configured in this environment '- + '(JWT_KID/JWT_PRIVATE_KEY_PATH)';-- return;- }-await joinWithConfig({localRecording: {disable: false,diff --git a/tests/specs/misc/recordingTranscriptionDialog.spec.ts b/tests/specs/misc/recordingTranscriptionDialog.spec.tsindex 65253243de..a2797b69a4 100644--- a/tests/specs/misc/recordingTranscriptionDialog.spec.ts+++ b/tests/specs/misc/recordingTranscriptionDialog.spec.ts@@ -73,6 +73,28 @@ describe('Recording & Transcription dialog', () => {await p1.getToolbar().clickRecordingButton();await dialog.waitForDisplay();+ // Diagnostics for intermittent failures here. The Start button's enabled state is driven+ // by AbstractStartRecordingDialog's own local `this.state.selectedRecordingService` —+ // that's plain React state, not redux, so APP.store.getState() can't see it.+ // state['features/recording'].selectedRecordingService (read here previously) is a+ // write-only mirror: it's only ever set by dispatch, when a user manually changes the+ // dropdown via _onSelectedRecordingServiceChanged, and nothing reads it back into this+ // component — so it reads '' in this test regardless of the real bug, which is exactly+ // why it looked identical across every prior failure and told us nothing. Read the+ // dropdown's own rendered text instead: it's rendered straight from the real local state.+ await dialog.toggleRecordingOptions();++ const diagnostics = await p1.execute(() => ({+ recordingServiceConfig: config.recordingService,+ localRecordingConfig: config.localRecording,+ reduxRecordingServiceConfig: APP.store.getState()['features/base/config'].recordingService,+ reduxLocalRecordingConfig: APP.store.getState()['features/base/config'].localRecording,+ hasDropboxToken: Boolean(APP.store.getState()['features/dropbox'].token)+ }));+ const renderedSelectedService = await dialog.getSelectedService();++ await p1.log(`Recording dialog diagnostics: ${JSON.stringify({ ...diagnostics, renderedSelectedService })}`);+expect(await dialog.isStartRecordingEnabled()).toBe(true);expect(await dialog.isStartBothEnabled()).toBe(true);