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
feat(tests): Adds stop video test.
damencho5a9464697fc5
diff --git a/tests/helpers/participants.ts b/tests/helpers/participants.tsindex 97880c33cf..cd5641de8b 100644--- a/tests/helpers/participants.ts+++ b/tests/helpers/participants.ts@@ -259,7 +259,7 @@ export async function unmuteAudioAndCheck(testee: Participant, observer: Partici}/**- * Starts the video on testee and check on observer.+ * Stop the video on testee and check on observer.* @param testee* @param observer*/@@ -270,6 +270,18 @@ export async function unmuteVideoAndCheck(testee: Participant, observer: Particiawait observer.getParticipantsPane().assertVideoMuteIconIsDisplayed(testee, true);}+/**+ * Starts the video on testee and check on observer.+ * @param testee+ * @param observer+ */+export async function muteVideoAndCheck(testee: Participant, observer: Participant): Promise<void> {+ await testee.getToolbar().clickVideoMuteButton();++ await testee.getParticipantsPane().assertVideoMuteIconIsDisplayed(testee);+ await observer.getParticipantsPane().assertVideoMuteIconIsDisplayed(testee);+}+/*** Get a JWT token for a moderator.*/diff --git a/tests/specs/2way/stopVideo.spec.ts b/tests/specs/2way/stopVideo.spec.tsnew file mode 100644index 0000000000..8122a95284--- /dev/null+++ b/tests/specs/2way/stopVideo.spec.ts@@ -0,0 +1,41 @@+import { ensureTwoParticipants, muteVideoAndCheck, unmuteVideoAndCheck } from '../../helpers/participants';++describe('Stop video', () => {+ it('joining the meeting', () => ensureTwoParticipants(ctx));++ it('stop video and check', () => muteVideoAndCheck(ctx.p1, ctx.p2));++ it('start video and check', () => unmuteVideoAndCheck(ctx.p1, ctx.p2));++ it('start video and check stream', async () => {+ await muteVideoAndCheck(ctx.p1, ctx.p2);++ // now participant2 should be on large video+ const largeVideoId = await ctx.p1.getLargeVideo().getId();++ await unmuteVideoAndCheck(ctx.p1, ctx.p2);++ // check if video stream from second participant is still on large video+ expect(largeVideoId).toBe(await ctx.p1.getLargeVideo().getId());+ });++ it('stop video on participant and check', () => muteVideoAndCheck(ctx.p2, ctx.p1));++ it('start video on participant and check', () => unmuteVideoAndCheck(ctx.p2, ctx.p1));++ it('stop video on before second joins', async () => {+ await ctx.p2.hangup();++ const { p1 } = ctx;++ await p1.getToolbar().clickVideoMuteButton();++ await ensureTwoParticipants(ctx);++ const { p2 } = ctx;++ await p2.getParticipantsPane().assertVideoMuteIconIsDisplayed(p1);++ await unmuteVideoAndCheck(p1, p2);+ });+});