diff options
Diffstat (limited to 'client/e2e/src/videos.e2e-spec.ts')
-rw-r--r-- | client/e2e/src/videos.e2e-spec.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index c21bc163e..f216f8dd1 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts | |||
@@ -10,6 +10,7 @@ describe('Videos workflow', () => { | |||
10 | const videoName = new Date().getTime() + ' video' | 10 | const videoName = new Date().getTime() + ' video' |
11 | let isMobileDevice = false | 11 | let isMobileDevice = false |
12 | let isIphoneDevice = false | 12 | let isIphoneDevice = false |
13 | let isSafari = false | ||
13 | 14 | ||
14 | beforeEach(async () => { | 15 | beforeEach(async () => { |
15 | browser.waitForAngularEnabled(false) | 16 | browser.waitForAngularEnabled(false) |
@@ -21,6 +22,7 @@ describe('Videos workflow', () => { | |||
21 | const caps = await browser.getCapabilities() | 22 | const caps = await browser.getCapabilities() |
22 | isMobileDevice = caps.get('realMobile') === 'true' || caps.get('realMobile') === true | 23 | isMobileDevice = caps.get('realMobile') === 'true' || caps.get('realMobile') === true |
23 | isIphoneDevice = caps.get('device') === 'iphone' | 24 | isIphoneDevice = caps.get('device') === 'iphone' |
25 | isSafari = caps.get('browserName') && caps.get('browserName').toLowerCase() === 'safari' | ||
24 | }) | 26 | }) |
25 | 27 | ||
26 | it('Should log in', () => { | 28 | it('Should log in', () => { |
@@ -38,14 +40,14 @@ describe('Videos workflow', () => { | |||
38 | return | 40 | return |
39 | } | 41 | } |
40 | 42 | ||
41 | pageUploadPage.navigateTo() | 43 | await pageUploadPage.navigateTo() |
42 | 44 | ||
43 | await pageUploadPage.uploadVideo() | 45 | await pageUploadPage.uploadVideo() |
44 | return pageUploadPage.validSecondUploadStep(videoName) | 46 | return pageUploadPage.validSecondUploadStep(videoName) |
45 | }) | 47 | }) |
46 | 48 | ||
47 | it('Should list the video', async () => { | 49 | it('Should list the video', async () => { |
48 | await videoWatchPage.goOnVideosList(isIphoneDevice) | 50 | await videoWatchPage.goOnVideosList(isIphoneDevice, isSafari) |
49 | 51 | ||
50 | if (isMobileDevice) { | 52 | if (isMobileDevice) { |
51 | console.log('Skipping because we are on a real device and BrowserStack does not support file upload.') | 53 | console.log('Skipping because we are on a real device and BrowserStack does not support file upload.') |
@@ -59,16 +61,21 @@ describe('Videos workflow', () => { | |||
59 | it('Should go on video watch page', async () => { | 61 | it('Should go on video watch page', async () => { |
60 | let videoNameToExcept = videoName | 62 | let videoNameToExcept = videoName |
61 | 63 | ||
62 | if (isMobileDevice && isIphoneDevice) videoNameToExcept = 'PeerTube_Mobile.v.1' | 64 | if (isMobileDevice) videoNameToExcept = await videoWatchPage.clickOnFirstVideo() |
63 | |||
64 | if (isMobileDevice && isIphoneDevice === false) videoNameToExcept = await videoWatchPage.clickOnFirstVideo() | ||
65 | else await videoWatchPage.clickOnVideo(videoName) | 65 | else await videoWatchPage.clickOnVideo(videoName) |
66 | 66 | ||
67 | return videoWatchPage.waitWatchVideoName(videoNameToExcept) | 67 | return videoWatchPage.waitWatchVideoName(videoNameToExcept) |
68 | }) | 68 | }) |
69 | 69 | ||
70 | it('Should play the video', async () => { | 70 | it('Should play the video', async () => { |
71 | await videoWatchPage.pauseVideo(7000, isMobileDevice, isIphoneDevice) | 71 | await videoWatchPage.pauseVideo(7000, !isMobileDevice, isSafari) |
72 | expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) | ||
73 | }) | ||
74 | |||
75 | it('Should watch the associated embed video', async () => { | ||
76 | await videoWatchPage.goOnAssociatedEmbed() | ||
77 | |||
78 | await videoWatchPage.pauseVideo(7000, false, isSafari) | ||
72 | expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) | 79 | expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) |
73 | }) | 80 | }) |
74 | }) | 81 | }) |