diff options
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())) |