1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Introduce videos command

This commit is contained in:
Chocobozzz 2021-07-15 10:02:54 +02:00
parent 7926c5f9b3
commit d23dd9fbfc
No known key found for this signature in database
GPG key ID: 583A612D890159BE
108 changed files with 2484 additions and 3100 deletions

View file

@ -7,12 +7,10 @@ import {
cleanupTests,
doubleFollow,
flushAndRunMultipleServers,
getVideoIdFromUUID,
ServerInfo,
setAccessTokensToServers,
setDefaultVideoChannel,
stopFfmpeg,
viewVideo,
wait,
waitJobs,
waitUntilLivePublishedOnAllServers
@ -71,7 +69,7 @@ describe('Test live', function () {
await waitJobs(servers)
{
const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID)
const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID })
const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket()
localSocket.on('state-change', data => localStateChanges.push(data.state))
@ -79,7 +77,7 @@ describe('Test live', function () {
}
{
const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID)
const videoId = await servers[1].videosCommand.getId({ uuid: liveVideoUUID })
const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket()
remoteSocket.on('state-change', data => remoteStateChanges.push(data.state))
@ -119,7 +117,7 @@ describe('Test live', function () {
await waitJobs(servers)
{
const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID)
const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID })
const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket()
localSocket.on('views-change', data => { localLastVideoViews = data.views })
@ -127,7 +125,7 @@ describe('Test live', function () {
}
{
const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID)
const videoId = await servers[1].videosCommand.getId({ uuid: liveVideoUUID })
const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket()
remoteSocket.on('views-change', data => { remoteLastVideoViews = data.views })
@ -142,8 +140,8 @@ describe('Test live', function () {
expect(localLastVideoViews).to.equal(0)
expect(remoteLastVideoViews).to.equal(0)
await viewVideo(servers[0].url, liveVideoUUID)
await viewVideo(servers[1].url, liveVideoUUID)
await servers[0].videosCommand.view({ id: liveVideoUUID })
await servers[1].videosCommand.view({ id: liveVideoUUID })
await waitJobs(servers)
await wait(5000)
@ -163,7 +161,7 @@ describe('Test live', function () {
const liveVideoUUID = await createLiveWrapper()
await waitJobs(servers)
const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID)
const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID })
const socket = servers[0].socketIOCommand.getLiveNotificationSocket()
socket.on('state-change', data => stateChanges.push(data.state))