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
test: Fix transcription test. (#16974)
bgrozevaee5cb9200c3
diff --git a/tests/helpers/WebhookProxy.ts b/tests/helpers/WebhookProxy.tsindex 9d5179ba0b..a38f9ff1fa 100644--- a/tests/helpers/WebhookProxy.ts+++ b/tests/helpers/WebhookProxy.ts@@ -38,8 +38,9 @@ export default class WebhookProxy {this.ws.on('error', console.error);- this.ws.on('open', function open() {+ this.ws.on('open', () => {console.log('WebhookProxy connected');+ this.logInfo('connected');});this.ws.on('message', (data: any) => {diff --git a/tests/specs/jaas/transcriptions.spec.ts b/tests/specs/jaas/transcriptions.spec.tsindex 7077907bca..235c1395c0 100644--- a/tests/specs/jaas/transcriptions.spec.ts+++ b/tests/specs/jaas/transcriptions.spec.ts@@ -8,7 +8,6 @@ import { joinJaasMuc, generateJaasToken as t } from '../../helpers/jaas';setTestProperties(__filename, {requireWebhookProxy: true,- retry: true,useJaas: true,usesBrowsers: [ 'p1', 'p2' ]});@@ -72,6 +71,8 @@ for (const asyncTranscriptions of asyncTranscriptionValues) {await p1.getIframeAPI().clearEventResults('transcribingStatusChanged');await p1.getIframeAPI().addEventListener('transcribingStatusChanged');+ await p2.getIframeAPI().clearEventResults('transcribingStatusChanged');+ await p2.getIframeAPI().addEventListener('transcribingStatusChanged');await p1.getIframeAPI().executeCommand('toggleSubtitles');@@ -80,18 +81,29 @@ for (const asyncTranscriptions of asyncTranscriptionValues) {timeout: 15000,timeoutMsg: 'transcribingStatusChanged event not received by p1'});+ // The p1 event can be triggered locally, resulting in the code below executing prematurely. Make sure+ // transcription is indeed stopped on the backend before proceeding.+ await p2.driver.waitUntil(() => p2.getIframeAPI()+ .getEventResult('transcribingStatusChanged'), {+ timeout: 15000,+ timeoutMsg: 'transcribingStatusChanged event not received by p1'+ });});it('set subtitles on and off', async () => {// we need to clear results or the last one will be used, from the previous time subtitles were onawait p1.getIframeAPI().clearEventResults('transcriptionChunkReceived');await p2.getIframeAPI().clearEventResults('transcriptionChunkReceived');+ webhooksProxy.clearCache();await p1.getIframeAPI().executeCommand('setSubtitles', true, true);await checkReceivingChunks(p1, p2, webhooksProxy, asyncTranscriptions);await p1.getIframeAPI().clearEventResults('transcribingStatusChanged');+ await p1.getIframeAPI().addEventListener('transcribingStatusChanged');+ await p2.getIframeAPI().clearEventResults('transcribingStatusChanged');+ await p2.getIframeAPI().addEventListener('transcribingStatusChanged');await p1.getIframeAPI().executeCommand('setSubtitles', false);@@ -100,6 +112,13 @@ for (const asyncTranscriptions of asyncTranscriptionValues) {timeout: 15000,timeoutMsg: 'transcribingStatusChanged event not received by p1'});+ // The p1 event can be triggered locally, resulting in the code below executing prematurely. Make sure+ // transcription is indeed stopped on the backend before proceeding.+ await p2.driver.waitUntil(() => p2.getIframeAPI()+ .getEventResult('transcribingStatusChanged'), {+ timeout: 15000,+ timeoutMsg: 'transcribingStatusChanged event not received by p1'+ });});it('start/stop transcriptions via recording', async () => {