From b5c0e95544cec5a33cee3df41c1607d2a0cd5403 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 23 Feb 2018 16:39:51 +0100 Subject: Avoids easy cheating on vidoe views --- server/tests/api/videos/single-server.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'server/tests/api/videos/single-server.ts') diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts index 83b6a0e9a..cf2721838 100644 --- a/server/tests/api/videos/single-server.ts +++ b/server/tests/api/videos/single-server.ts @@ -8,7 +8,7 @@ import { checkVideoFilesWereRemoved, completeVideoCheck, flushTests, getVideo, getVideoCategories, getVideoLanguages, getVideoLicences, getVideoPrivacies, getVideosList, getVideosListPagination, getVideosListSort, killallServers, rateVideo, removeVideo, runServer, searchVideo, searchVideoWithPagination, searchVideoWithSort, ServerInfo, setAccessTokensToServers, testImage, updateVideo, uploadVideo, - viewVideo + viewVideo, wait } from '../../utils' const expect = chai.expect @@ -149,8 +149,7 @@ describe('Test a single server', function () { }) it('Should get and seed the uploaded video', async function () { - // Yes, this could be long - this.timeout(60000) + this.timeout(5000) const res = await getVideosList(server.url) @@ -163,8 +162,7 @@ describe('Test a single server', function () { }) it('Should get the video by UUID', async function () { - // Yes, this could be long - this.timeout(60000) + this.timeout(5000) const res = await getVideo(server.url, videoUUID) @@ -173,10 +171,22 @@ describe('Test a single server', function () { }) it('Should have the views updated', async function () { + this.timeout(10000) + await viewVideo(server.url, videoId) await viewVideo(server.url, videoId) await viewVideo(server.url, videoId) + await wait(1500) + + await viewVideo(server.url, videoId) + await viewVideo(server.url, videoId) + + await wait(1500) + + await viewVideo(server.url, videoId) + await viewVideo(server.url, videoId) + const res = await getVideo(server.url, videoId) const video = res.body -- cgit v1.2.3