getFriendsList: getFriendsList,
getVideo: getVideo,
getVideosList: getVideosList,
+ getVideosListPagination: getVideosListPagination,
login: login,
loginAndGetAccessToken: loginAndGetAccessToken,
makeFriends: makeFriends,
flushAndRunMultipleServers: flushAndRunMultipleServers,
runServer: runServer,
searchVideo: searchVideo,
+ searchVideoWithPagination: searchVideoWithPagination,
testImage: testImage,
uploadVideo: uploadVideo
}
.end(end)
}
+function getVideosListPagination (url, start, count, end) {
+ const path = '/api/v1/videos'
+
+ request(url)
+ .get(path)
+ .query({ start: start })
+ .query({ count: count })
+ .set('Accept', 'application/json')
+ .expect(200)
+ .expect('Content-Type', /json/)
+ .end(end)
+}
+
function login (url, client, user, expectedStatus, end) {
if (!end) {
end = expectedStatus
.end(end)
}
+function searchVideoWithPagination (url, search, start, count, end) {
+ const path = '/api/v1/videos'
+
+ request(url)
+ .get(path + '/search/' + search)
+ .query({ start: start })
+ .query({ count: count })
+ .set('Accept', 'application/json')
+ .expect(200)
+ .expect('Content-Type', /json/)
+ .end(end)
+}
+
function testImage (url, videoName, imagePath, callback) {
request(url)
.get(imagePath)