From 4f2199144e428c16460750305f737b890c1ac322 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Jul 2021 10:18:40 +0200 Subject: Introduce live command --- server/tests/api/search/search-videos.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'server/tests/api/search/search-videos.ts') diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index 7dc89c447..af74b26a7 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts @@ -2,23 +2,20 @@ import 'mocha' import * as chai from 'chai' -import { VideoPrivacy } from '@shared/models' import { cleanupTests, - createLive, + createVideoCaption, flushAndRunServer, immutableAssign, SearchCommand, - sendRTMPStreamInVideo, ServerInfo, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, uploadVideo, - wait, - waitUntilLivePublished -} from '../../../../shared/extra-utils' -import { createVideoCaption } from '../../../../shared/extra-utils/videos/video-captions' + wait +} from '@shared/extra-utils' +import { VideoPrivacy } from '@shared/models' const expect = chai.expect @@ -502,12 +499,13 @@ describe('Test videos search', function () { } { - const liveOptions = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id } - const resLive = await createLive(server.url, server.accessToken, liveOptions) - const liveVideoId = resLive.body.video.uuid + const liveCommand = server.liveCommand + + const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id } + const live = await liveCommand.createLive({ fields: liveAttributes }) - const ffmpegCommand = await sendRTMPStreamInVideo(server.url, server.accessToken, liveVideoId) - await waitUntilLivePublished(server.url, server.accessToken, liveVideoId) + const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id }) + await liveCommand.waitUntilLivePublished({ videoId: live.id }) const body = await command.advancedVideoSearch({ search: { isLive: true } }) -- cgit v1.2.3