Skip to content

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

test: Skip iframe tests when the API is disabled.

Boris Grozev289c1907e7cf
diff --git a/tests/specs/iframe/chat.spec.ts b/tests/specs/iframe/chat.spec.ts
index 05f9fab316..0affc2e1c6 100644
--- a/tests/specs/iframe/chat.spec.ts
+++ b/tests/specs/iframe/chat.spec.ts
@@ -3,9 +3,10 @@ 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';
+import { checkIframeApi } from './util';
+
setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2' ]
});
@@ -15,12 +16,11 @@ describe('Chat', () => {
it('setup', async () => {
p1 = await joinMuc({ name: 'p1', iFrameApi: true, token: testsConfig.jwt.preconfiguredToken });
+ if (!await checkIframeApi(p1)) {
+ return;
+ }
p2 = await joinMuc({ name: 'p2', iFrameApi: true });
- const iframeEnabled = !await p1.execute(() => config.disableIframeAPI);
-
- expect(iframeEnabled).toBe(expectations.iframe.enabled);
-
await p1.switchToMainFrame();
await p2.switchToMainFrame();
});
diff --git a/tests/specs/iframe/kick.spec.ts b/tests/specs/iframe/kick.spec.ts
index bef53b68c6..33cdaba61f 100644
--- a/tests/specs/iframe/kick.spec.ts
+++ b/tests/specs/iframe/kick.spec.ts
@@ -1,9 +1,10 @@
import { isEqual } from 'lodash-es';
import { setTestProperties } from '../../helpers/TestProperties';
-import { expectations } from '../../helpers/expectations';
import { ensureTwoParticipants } from '../../helpers/participants';
+import { checkIframeApi } from './util';
+
setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2' ]
});
@@ -13,9 +14,10 @@ describe('Kick participants', () => {
await ensureTwoParticipants({}, { name: 'p1', iFrameApi: true });
const { p1, p2 } = ctx;
- const iframeEnabled = !await p1.execute(() => config.disableIframeAPI);
- expect(iframeEnabled).toBe(expectations.iframe.enabled);
+ if (!await checkIframeApi(p1)) {
+ return;
+ }
await Promise.all([
p1.switchToMainFrame(),
diff --git a/tests/specs/iframe/participantsPresence.spec.ts b/tests/specs/iframe/participantsPresence.spec.ts
index 3eeeca415c..f67f3352af 100644
--- a/tests/specs/iframe/participantsPresence.spec.ts
+++ b/tests/specs/iframe/participantsPresence.spec.ts
@@ -1,8 +1,9 @@
import { P1, P2 } from '../../helpers/Participant';
import { setTestProperties } from '../../helpers/TestProperties';
-import { expectations } from '../../helpers/expectations';
import { ensureTwoParticipants, parseJid } from '../../helpers/participants';
+import { checkIframeApi } from './util';
+
setTestProperties(__filename, {
usesBrowsers: [ 'p1', 'p2' ]
});
@@ -12,9 +13,10 @@ describe('Participants presence', () => {
await ensureTwoParticipants({}, { name: 'p1', iFrameApi: true });
const { p1, p2 } = ctx;
- const iframeEnabled = !await p1.execute(() => config.disableIframeAPI);
- expect(iframeEnabled).toBe(expectations.iframe.enabled);
+ if (!await checkIframeApi(p1)) {
+ return;
+ }
await Promise.all([
p1.switchToMainFrame(),
diff --git a/tests/specs/iframe/util.ts b/tests/specs/iframe/util.ts
new file mode 100644
index 0000000000..5eac5ca72a
--- /dev/null
+++ b/tests/specs/iframe/util.ts
@@ -0,0 +1,15 @@
+import { expect } from '@wdio/globals';
+
+import type { Participant } from '../../helpers/Participant';
+import { expectations } from '../../helpers/expectations';
+
+export async function checkIframeApi(p: Participant) {
+ const iframeEnabled = !await p.execute(() => config.disableIframeAPI);
+
+ expect(iframeEnabled).toBe(expectations.iframe.enabled);
+ if (!iframeEnabled) {
+ ctx.skipSuiteTests = 'The iFrame API is disabled';
+ }
+
+ return iframeEnabled;
+}