aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/videos.e2e-spec.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-24 09:05:58 +0200
committerChocobozzz <me@florianbigard.com>2018-05-24 09:16:15 +0200
commit1fad099d72584ae54701603729339a3cd1cf0d52 (patch)
treec44624c292015f4ad0aa7b3a73931110ae17919e /client/e2e/src/videos.e2e-spec.ts
parent073279d5ea024e607f1d0d48f0f153ff04069d74 (diff)
downloadPeerTube-1fad099d72584ae54701603729339a3cd1cf0d52.tar.gz
PeerTube-1fad099d72584ae54701603729339a3cd1cf0d52.tar.zst
PeerTube-1fad099d72584ae54701603729339a3cd1cf0d52.zip
Fix protractor with Safari
Diffstat (limited to 'client/e2e/src/videos.e2e-spec.ts')
-rw-r--r--client/e2e/src/videos.e2e-spec.ts24
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})