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