-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathbasic_stream.spec.ts
More file actions
33 lines (24 loc) · 1.09 KB
/
basic_stream.spec.ts
File metadata and controls
33 lines (24 loc) · 1.09 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
import { test } from './fixtures';
import { expect } from './matchers';
import * as helpers from './helpers';
import { StatsReceivedEvent } from '@epicgames-ps/lib-pixelstreamingfrontend-ue5.5';
// NOTE: add a new test to check qp values
// just quickly test that the default stream is working
test('Test default stream.', {
tag: ['@basic'],
}, async ({ page, streamerId }) => {
await page.goto(`/?StreamerId=${streamerId}`);
// let the stream run for a short duration
await helpers.startAndWaitForVideo(page);
let frameCount: number = await page.evaluate(()=> {
return new Promise<number>((resolve) => {
window.pixelStreaming.addEventListener("statsReceived", (e: StatsReceivedEvent) => {
if(e.data.aggregatedStats && e.data.aggregatedStats.inboundVideoStats && e.data.aggregatedStats.inboundVideoStats.framesReceived) {
resolve(e.data.aggregatedStats.inboundVideoStats.framesReceived);
}
});
});
});
// pass the test if we recorded any frames
expect(frameCount).toBeGreaterThan(0);
});