import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
import {
addVideoChannel,
+ checkTmpIsEmpty,
checkVideoFilesWereRemoved,
completeVideoCheck,
createUser,
viewVideo,
wait,
webtorrentAdd
-} from '../../utils'
+} from '../../../../shared/utils'
import {
addVideoCommentReply,
addVideoCommentThread,
deleteVideoComment,
getVideoCommentThreads,
getVideoThreadComments
-} from '../../utils/videos/video-comments'
-import { waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils/videos/video-comments'
+import { waitJobs } from '../../../../shared/utils/server/jobs'
const expect = chai.expect
nsfw: true,
description: 'my super description for server 1',
support: 'my super support text for server 1',
+ originallyPublishedAt: '2019-02-10T13:38:14.449Z',
tags: [ 'tag1p1', 'tag2p1' ],
channelId: videoChannelId,
fixture: 'video_short1.webm'
nsfw: true,
description: 'my super description for server 1',
support: 'my super support text for server 1',
+ originallyPublishedAt: '2019-02-10T13:38:14.449Z',
account: {
name: 'root',
host: 'localhost:9001'
tags: [ 'tag1p1', 'tag2p1' ],
privacy: VideoPrivacy.PUBLIC,
commentsEnabled: true,
+ downloadEnabled: true,
channel: {
- name: 'my channel',
+ displayName: 'my channel',
+ name: 'super_channel_name',
description: 'super channel',
isLocal
},
},
isLocal,
commentsEnabled: true,
+ downloadEnabled: true,
duration: 5,
tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ],
privacy: VideoPrivacy.PUBLIC,
channel: {
- name: 'Main user1 channel',
+ displayName: 'Main user1 channel',
+ name: 'user1_channel',
description: 'super channel',
isLocal
},
isLocal,
duration: 5,
commentsEnabled: true,
+ downloadEnabled: true,
tags: [ 'tag1p3' ],
privacy: VideoPrivacy.PUBLIC,
channel: {
- name: 'Main root channel',
+ displayName: 'Main root channel',
+ name: 'root_channel',
description: '',
isLocal
},
host: 'localhost:9003'
},
commentsEnabled: true,
+ downloadEnabled: true,
isLocal,
duration: 5,
tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ],
privacy: VideoPrivacy.PUBLIC,
channel: {
- name: 'Main root channel',
+ displayName: 'Main root channel',
+ name: 'root_channel',
description: '',
isLocal
},
})
it('Should view multiple videos on owned servers', async function () {
- this.timeout(15000)
+ this.timeout(30000)
const tasks: Promise<any>[] = []
await viewVideo(servers[2].url, localVideosServer3[0])
await waitJobs(servers)
+ // Wait the repeatable job
+ await wait(6000)
+
for (const server of servers) {
const res = await getVideosList(server.url)
})
it('Should view multiple videos on each servers', async function () {
- this.timeout(15000)
+ this.timeout(30000)
const tasks: Promise<any>[] = []
tasks.push(viewVideo(servers[0].url, remoteVideosServer1[0]))
await waitJobs(servers)
+ // Wait the repeatable job
+ await wait(8000)
+
let baseVideos = null
for (const server of servers) {
this.timeout(20000)
await rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'like')
- await wait(200)
+ await wait(500)
await rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'dislike')
- await wait(200)
+ await wait(500)
await rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'like')
await rateVideo(servers[2].url, servers[2].accessToken, localVideosServer3[1], 'like')
- await wait(200)
+ await wait(500)
await rateVideo(servers[2].url, servers[2].accessToken, localVideosServer3[1], 'dislike')
await rateVideo(servers[2].url, servers[2].accessToken, remoteVideosServer3[1], 'dislike')
- await wait(200)
+ await wait(500)
await rateVideo(servers[2].url, servers[2].accessToken, remoteVideosServer3[0], 'like')
await waitJobs(servers)
support: 'my super support text updated',
tags: [ 'tag_up_1', 'tag_up_2' ],
thumbnailfile: 'thumbnail.jpg',
+ originallyPublishedAt: '2019-02-11T13:38:14.449Z',
previewfile: 'preview.jpg'
}
nsfw: true,
description: 'my super description updated',
support: 'my super support text updated',
+ originallyPublishedAt: '2019-02-11T13:38:14.449Z',
account: {
name: 'root',
host: 'localhost:9003'
isLocal,
duration: 5,
commentsEnabled: true,
+ downloadEnabled: true,
tags: [ 'tag_up_1', 'tag_up_2' ],
privacy: VideoPrivacy.PUBLIC,
channel: {
- name: 'Main root channel',
+ displayName: 'Main root channel',
+ name: 'root_channel',
description: '',
isLocal
},
}
})
- it('Should disable comments', async function () {
+ it('Should disable comments and download', async function () {
this.timeout(20000)
const attributes = {
- commentsEnabled: false
+ commentsEnabled: false,
+ downloadEnabled: false
}
await updateVideo(servers[0].url, servers[0].accessToken, videoUUID, attributes)
for (const server of servers) {
const res = await getVideo(server.url, videoUUID)
expect(res.body.commentsEnabled).to.be.false
+ expect(res.body.downloadEnabled).to.be.false
const text = 'my super forbidden comment'
await addVideoCommentThread(server.url, server.accessToken, videoUUID, text, 409)
isLocal,
duration: 5,
commentsEnabled: false,
+ downloadEnabled: true,
tags: [ ],
privacy: VideoPrivacy.PUBLIC,
channel: {
- name: 'Main root channel',
+ displayName: 'Main root channel',
+ name: 'root_channel',
description: '',
isLocal
},
files: [
{
resolution: 720,
- size: 36000
+ size: 72000
},
{
resolution: 480,
- size: 21000
+ size: 45000
},
{
resolution: 360,
- size: 17000
+ size: 34600
},
{
resolution: 240,
- size: 13000
+ size: 24770
}
]
}
})
})
+ describe('TMP directory', function () {
+ it('Should have an empty tmp directory', async function () {
+ for (const server of servers) {
+ await checkTmpIsEmpty(server)
+ }
+ })
+ })
+
after(async function () {
killallServers(servers)