-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathLoadingVideo.test.ts
More file actions
48 lines (43 loc) · 2.14 KB
/
LoadingVideo.test.ts
File metadata and controls
48 lines (43 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { expect } from '@playwright/test';
import { IDS } from '../../common/constants';
import { stableScreenshot, waitForSelector, dataUiId } from '../../common/utils';
import {
addScreenshareStream,
addVideoStream,
buildUrlWithMockAdapter,
defaultMockCallAdapterState,
defaultMockRemoteParticipant,
test
} from './fixture';
import type { MockRemoteParticipantState } from '../../../common';
test.describe('Loading Video Spinner tests', async () => {
test('Video Gallery shows loading spinners in tiles', async ({ page, serverUrl }) => {
// Create more than 4 users to ensure that some are placed in the horizontal gallery
const numParticipants = 10;
const participants: MockRemoteParticipantState[] = Array.from({ length: numParticipants }).map((_, i) => {
const participant = defaultMockRemoteParticipant(`User ${i}`);
addVideoStream(participant, false);
return participant;
});
const initialState = defaultMockCallAdapterState(participants);
await page.goto(buildUrlWithMockAdapter(serverUrl, initialState));
await waitForSelector(page, dataUiId(IDS.videoGallery));
expect(await stableScreenshot(page, { hideVideoLoadingSpinner: false })).toMatchSnapshot(
'video-gallery-with-loading-spinners.png'
);
});
test('Video Gallery shows loading spinners in screen share and horizontal gallery', async ({ page, serverUrl }) => {
const screenSharingParticipant = defaultMockRemoteParticipant('Screen Sharer');
addScreenshareStream(screenSharingParticipant, false);
const horizontalGalleryParticipant = defaultMockRemoteParticipant('Horizontal Gallery User');
addVideoStream(horizontalGalleryParticipant, false);
const initialState = defaultMockCallAdapterState([screenSharingParticipant, horizontalGalleryParticipant]);
await page.goto(buildUrlWithMockAdapter(serverUrl, initialState));
await waitForSelector(page, dataUiId(IDS.videoGallery));
expect(await stableScreenshot(page, { hideVideoLoadingSpinner: false })).toMatchSnapshot(
'horizontal-gallery-with-loading-spinners.png'
);
});
});