diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-11 09:41:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-11 09:41:39 +0200 |
commit | 60c8b8a5d7bb1aeca18e2d45f5eeccdd66f2276a (patch) | |
tree | faed52ccfb737634c549392b00e146653b63c4ef /client/e2e/src | |
parent | 81c647ff191677e3b77814545d12e590c7ebfb1d (diff) | |
download | PeerTube-60c8b8a5d7bb1aeca18e2d45f5eeccdd66f2276a.tar.gz PeerTube-60c8b8a5d7bb1aeca18e2d45f5eeccdd66f2276a.tar.zst PeerTube-60c8b8a5d7bb1aeca18e2d45f5eeccdd66f2276a.zip |
Improve E2E tests
Diffstat (limited to 'client/e2e/src')
-rw-r--r-- | client/e2e/src/po/video-watch.po.ts | 9 | ||||
-rw-r--r-- | client/e2e/src/videos.e2e-spec.ts | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index a6efae288..4a36fce62 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts | |||
@@ -14,7 +14,7 @@ export class VideoWatchPage { | |||
14 | await browser.get(url) | 14 | await browser.get(url) |
15 | 15 | ||
16 | // Waiting the following element does not work on Safari... | 16 | // Waiting the following element does not work on Safari... |
17 | if (isSafari === true) return browser.sleep(3000) | 17 | if (isSafari) return browser.sleep(3000) |
18 | 18 | ||
19 | const elem = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() | 19 | const elem = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() |
20 | return browser.wait(browser.ExpectedConditions.visibilityOf(elem)) | 20 | return browser.wait(browser.ExpectedConditions.visibilityOf(elem)) |
@@ -84,13 +84,12 @@ export class VideoWatchPage { | |||
84 | } | 84 | } |
85 | 85 | ||
86 | async clickOnFirstVideo () { | 86 | async clickOnFirstVideo () { |
87 | const video = element.all(by.css('.videos .video-miniature .video-thumbnail')).first() | 87 | const video = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() |
88 | const videoName = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() | ||
89 | 88 | ||
90 | // Don't know why but the expectation fails on Safari | 89 | // Don't know why but the expectation fails on Safari |
91 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(video)) | 90 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(video)) |
92 | 91 | ||
93 | const textToReturn = videoName.getText() | 92 | const textToReturn = video.getText() |
94 | await video.click() | 93 | await video.click() |
95 | 94 | ||
96 | await browser.wait(browser.ExpectedConditions.urlContains('/watch/')) | 95 | await browser.wait(browser.ExpectedConditions.urlContains('/watch/')) |
@@ -106,7 +105,7 @@ export class VideoWatchPage { | |||
106 | } | 105 | } |
107 | 106 | ||
108 | async goOnP2PMediaLoaderEmbed () { | 107 | async goOnP2PMediaLoaderEmbed () { |
109 | return browser.get('https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50?mode=p2p-media-loader') | 108 | return browser.get('https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50') |
110 | } | 109 | } |
111 | 110 | ||
112 | async clickOnUpdate () { | 111 | async clickOnUpdate () { |
diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index 075add531..b2c5ab4c6 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts | |||
@@ -53,6 +53,10 @@ describe('Videos workflow', () => { | |||
53 | if (await isSafari()) { | 53 | if (await isSafari()) { |
54 | console.log('Safari detected.') | 54 | console.log('Safari detected.') |
55 | } | 55 | } |
56 | |||
57 | if (!await isMobileDevice()) { | ||
58 | await browser.driver.manage().window().maximize() | ||
59 | } | ||
56 | }) | 60 | }) |
57 | 61 | ||
58 | it('Should log in', async () => { | 62 | it('Should log in', async () => { |