mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
test: Skip iframe tests when the API is disabled.
This commit is contained in:
committed by
Дамян Минков
parent
35adea48ae
commit
289c1907e7
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
15
tests/specs/iframe/util.ts
Normal file
15
tests/specs/iframe/util.ts
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user