X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Flive%2Flive-views.ts;h=1951b11a5504e990b036ae82d7046a25b5959502;hb=d23dd9fbfc4d26026352c10f81d2795ceaf2908a;hp=ae6af7cfdebf0c07a5674440edcf16b0760644cc;hpb=4f2199144e428c16460750305f737b890c1ac322;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/live/live-views.ts b/server/tests/api/live/live-views.ts index ae6af7cfd..1951b11a5 100644 --- a/server/tests/api/live/live-views.ts +++ b/server/tests/api/live/live-views.ts @@ -3,17 +3,15 @@ import 'mocha' import * as chai from 'chai' import { FfmpegCommand } from 'fluent-ffmpeg' -import { VideoDetails, VideoPrivacy } from '@shared/models' +import { VideoPrivacy } from '@shared/models' import { cleanupTests, doubleFollow, flushAndRunMultipleServers, - getVideo, ServerInfo, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, - viewVideo, wait, waitJobs, waitUntilLivePublishedOnAllServers @@ -55,9 +53,7 @@ describe('Test live', function () { async function countViews (expected: number) { for (const server of servers) { - const res = await getVideo(server.url, liveVideoId) - const video: VideoDetails = res.body - + const video = await server.videosCommand.get({ id: liveVideoId }) expect(video.views).to.equal(expected) } } @@ -71,7 +67,7 @@ describe('Test live', function () { privacy: VideoPrivacy.PUBLIC } - const live = await servers[0].liveCommand.createLive({ fields: liveAttributes }) + const live = await servers[0].liveCommand.create({ fields: liveAttributes }) liveVideoId = live.uuid command = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId }) @@ -86,8 +82,8 @@ describe('Test live', function () { it('Should view a live twice and display 1 view', async function () { this.timeout(30000) - await viewVideo(servers[0].url, liveVideoId) - await viewVideo(servers[0].url, liveVideoId) + await servers[0].videosCommand.view({ id: liveVideoId }) + await servers[0].videosCommand.view({ id: liveVideoId }) await wait(7000) @@ -108,9 +104,9 @@ describe('Test live', function () { it('Should view a live on a remote and on local and display 2 views', async function () { this.timeout(30000) - await viewVideo(servers[0].url, liveVideoId) - await viewVideo(servers[1].url, liveVideoId) - await viewVideo(servers[1].url, liveVideoId) + await servers[0].videosCommand.view({ id: liveVideoId }) + await servers[1].videosCommand.view({ id: liveVideoId }) + await servers[1].videosCommand.view({ id: liveVideoId }) await wait(7000) await waitJobs(servers)