+ describe('P2P', function () {
+ let videoUrl: string
+
+ async function goOnVideoWatchPage () {
+ await go(videoUrl)
+ await videoWatchPage.waitWatchVideoName('video')
+ }
+
+ async function checkP2P (enabled: boolean) {
+ await goOnVideoWatchPage()
+ expect(await videoWatchPage.isPrivacyWarningDisplayed()).toEqual(enabled)
+
+ await videoWatchPage.goOnAssociatedEmbed()
+ expect(await videoWatchPage.isEmbedWarningDisplayed()).toEqual(enabled)
+ }
+
+ before(async () => {
+ await loginPage.loginAsRootUser()
+ await videoUploadPage.navigateTo()
+ await videoUploadPage.uploadVideo()
+ await videoUploadPage.setAsPublic()
+ await videoUploadPage.validSecondUploadStep('video')
+
+ await videoWatchPage.waitWatchVideoName('video')
+
+ videoUrl = await browser.getUrl()
+ })
+
+ beforeEach(async function () {
+ await goOnVideoWatchPage()
+ })
+
+ it('Should have P2P disabled for a logged in user', async function () {
+ await checkP2P(false)
+ })
+
+ it('Should have P2P disabled for anonymous users', async function () {
+ await loginPage.logout()
+
+ await checkP2P(false)
+ })
+ })