aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/po
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-05-12 16:38:55 +0200
committerChocobozzz <me@florianbigard.com>2020-05-12 16:49:35 +0200
commitee68bbc481c154111c60fe80d57565d35bfac46e (patch)
tree64de79b49228feb35af486e2cf755bc7839fe148 /client/e2e/src/po
parent853c3d533d287d762053e0fa6ecf6bfc3feb0051 (diff)
downloadPeerTube-ee68bbc481c154111c60fe80d57565d35bfac46e.tar.gz
PeerTube-ee68bbc481c154111c60fe80d57565d35bfac46e.tar.zst
PeerTube-ee68bbc481c154111c60fe80d57565d35bfac46e.zip
Unblock ios e2e tests
Diffstat (limited to 'client/e2e/src/po')
-rw-r--r--client/e2e/src/po/app.po.ts7
-rw-r--r--client/e2e/src/po/video-watch.po.ts21
2 files changed, 12 insertions, 16 deletions
diff --git a/client/e2e/src/po/app.po.ts b/client/e2e/src/po/app.po.ts
index a636e825f..4954880ef 100644
--- a/client/e2e/src/po/app.po.ts
+++ b/client/e2e/src/po/app.po.ts
@@ -10,12 +10,5 @@ export class AppPage {
10 await element(by.css('.configure-instance-button')).click() 10 await element(by.css('.configure-instance-button')).click()
11 11
12 await browser.switchTo().window(firstHandle) 12 await browser.switchTo().window(firstHandle)
13
14 await browser.refresh()
15
16 await element(by.css('.form-group-checkbox')).click()
17 await element(by.css('.action-button-cancel')).click()
18
19 await browser.switchTo().window(firstHandle)
20 } 13 }
21} 14}
diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts
index c5e37e6de..bcfceefbc 100644
--- a/client/e2e/src/po/video-watch.po.ts
+++ b/client/e2e/src/po/video-watch.po.ts
@@ -1,4 +1,5 @@
1import { browser, by, element, ElementFinder, ExpectedConditions } from 'protractor' 1import { browser, by, element, ElementFinder, ExpectedConditions } from 'protractor'
2import { browserSleep } from '../utils'
2 3
3export class VideoWatchPage { 4export class VideoWatchPage {
4 async goOnVideosList (isMobileDevice: boolean, isSafari: boolean) { 5 async goOnVideosList (isMobileDevice: boolean, isSafari: boolean) {
@@ -11,10 +12,10 @@ export class VideoWatchPage {
11 url = '/videos/recently-added' 12 url = '/videos/recently-added'
12 } 13 }
13 14
14 await browser.get(url) 15 await browser.get(url, 20000)
15 16
16 // Waiting the following element does not work on Safari... 17 // Waiting the following element does not work on Safari...
17 if (isSafari) return browser.sleep(3000) 18 if (isSafari) return browserSleep(3000)
18 19
19 const elem = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() 20 const elem = element.all(by.css('.videos .video-miniature .video-miniature-name')).first()
20 return browser.wait(browser.ExpectedConditions.visibilityOf(elem)) 21 return browser.wait(browser.ExpectedConditions.visibilityOf(elem))
@@ -27,13 +28,12 @@ export class VideoWatchPage {
27 } 28 }
28 29
29 waitWatchVideoName (videoName: string, isMobileDevice: boolean, isSafari: boolean) { 30 waitWatchVideoName (videoName: string, isMobileDevice: boolean, isSafari: boolean) {
31 if (isSafari) return browserSleep(5000)
32
30 // On mobile we display the first node, on desktop the second 33 // On mobile we display the first node, on desktop the second
31 const index = isMobileDevice ? 0 : 1 34 const index = isMobileDevice ? 0 : 1
32 35
33 const elem = element.all(by.css('.video-info .video-info-name')).get(index) 36 const elem = element.all(by.css('.video-info .video-info-name')).get(index)
34
35 if (isSafari) return browser.sleep(5000)
36
37 return browser.wait(browser.ExpectedConditions.textToBePresentInElement(elem, videoName)) 37 return browser.wait(browser.ExpectedConditions.textToBePresentInElement(elem, videoName))
38 } 38 }
39 39
@@ -55,7 +55,7 @@ export class VideoWatchPage {
55 await playButton.click() 55 await playButton.click()
56 } 56 }
57 57
58 await browser.sleep(1000) 58 await browserSleep(1000)
59 await browser.wait(browser.ExpectedConditions.invisibilityOf(element(by.css('.vjs-loading-spinner')))) 59 await browser.wait(browser.ExpectedConditions.invisibilityOf(element(by.css('.vjs-loading-spinner'))))
60 60
61 const videojsEl = element(by.css('div.video-js')) 61 const videojsEl = element(by.css('div.video-js'))
@@ -63,13 +63,16 @@ export class VideoWatchPage {
63 63
64 // On Android, we need to click twice on "play" (BrowserStack particularity) 64 // On Android, we need to click twice on "play" (BrowserStack particularity)
65 if (isMobileDevice) { 65 if (isMobileDevice) {
66 await browser.sleep(3000) 66 await browserSleep(3000)
67
67 await videojsEl.click() 68 await videojsEl.click()
68 } 69 }
69 70
70 await browser.sleep(7000) 71 browser.ignoreSynchronization = false
72 await browserSleep(7000)
73 browser.ignoreSynchronization = true
71 74
72 return videojsEl.click() 75 await videojsEl.click()
73 } 76 }
74 77
75 async clickOnVideo (videoName: string) { 78 async clickOnVideo (videoName: string) {