diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-22 16:02:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-22 16:02:29 +0200 |
commit | d1bd87e066633b8a66266b280327ec828980916b (patch) | |
tree | bfb30a565088cbb2675a8ab224b1ae1fc5dbfd16 /client/e2e/src/po/video-upload.po.ts | |
parent | 293c885b5c6d4d694792cf430c51d73ecd1f3bee (diff) | |
download | PeerTube-d1bd87e066633b8a66266b280327ec828980916b.tar.gz PeerTube-d1bd87e066633b8a66266b280327ec828980916b.tar.zst PeerTube-d1bd87e066633b8a66266b280327ec828980916b.zip |
Make it works with new autoplay policy
Diffstat (limited to 'client/e2e/src/po/video-upload.po.ts')
-rw-r--r-- | client/e2e/src/po/video-upload.po.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 1ac696107..1978707e3 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts | |||
@@ -3,16 +3,26 @@ import { FileDetector } from 'selenium-webdriver/remote' | |||
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | 4 | ||
5 | export class VideoUploadPage { | 5 | export class VideoUploadPage { |
6 | navigateTo () { | 6 | async navigateTo () { |
7 | return browser.get('/videos/upload') | 7 | await element(by.css('.header .upload-button')).click() |
8 | |||
9 | return browser.wait(browser.ExpectedConditions.visibilityOf(element(by.css('.upload-video-container')))) | ||
8 | } | 10 | } |
9 | 11 | ||
10 | async uploadVideo () { | 12 | async uploadVideo () { |
11 | browser.setFileDetector(new FileDetector()) | 13 | browser.setFileDetector(new FileDetector()) |
12 | 14 | ||
13 | const fileToUpload = join(__dirname, '../../fixtures/video.mp4') | 15 | const fileToUpload = join(__dirname, '../../fixtures/video.mp4') |
16 | const fileInputSelector = '.upload-video-container input[type=file]' | ||
17 | const parentFileInput = '.upload-video .button-file' | ||
18 | |||
19 | // Avoid sending keys on non visible element | ||
20 | await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`) | ||
21 | // await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`) | ||
22 | await browser.executeScript(`document.querySelector('${parentFileInput}').style.overflow = 'initial'`) | ||
14 | 23 | ||
15 | await element(by.css('.upload-video-container input[type=file]')).sendKeys(fileToUpload) | 24 | const elem = element(by.css(fileInputSelector)) |
25 | await elem.sendKeys(fileToUpload) | ||
16 | 26 | ||
17 | // Wait for the upload to finish | 27 | // Wait for the upload to finish |
18 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(this.getSecondStepSubmitButton())) | 28 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(this.getSecondStepSubmitButton())) |