X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fe2e%2Fsrc%2Fpo%2Fvideo-upload.po.ts;h=7de715a9553e2cb9b6dd5840ded7cbab27481acb;hb=6b88559babc1e0490119a6b52411b10910d9da9d;hp=1ac69610766a755b7f6b4d69f7aa8db79c3d7428;hpb=0b33c5206023de0946b247e767087a518e0dec9a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 1ac696107..7de715a95 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts @@ -3,16 +3,27 @@ import { FileDetector } from 'selenium-webdriver/remote' import { join } from 'path' export class VideoUploadPage { - navigateTo () { - return browser.get('/videos/upload') + async navigateTo () { + await element(by.css('.header .publish-button')).click() + + return browser.wait(browser.ExpectedConditions.visibilityOf(element(by.css('.upload-video-container')))) } async uploadVideo () { browser.setFileDetector(new FileDetector()) const fileToUpload = join(__dirname, '../../fixtures/video.mp4') + const fileInputSelector = '.upload-video-container input[type=file]' + const parentFileInput = '.upload-video-container .button-file' + + // Avoid sending keys on non visible element + await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`) + await browser.executeScript(`document.querySelector('${parentFileInput}').style.overflow = 'initial'`) + + await browser.sleep(1000) - await element(by.css('.upload-video-container input[type=file]')).sendKeys(fileToUpload) + const elem = element(by.css(fileInputSelector)) + await elem.sendKeys(fileToUpload) // Wait for the upload to finish await browser.wait(browser.ExpectedConditions.elementToBeClickable(this.getSecondStepSubmitButton())) @@ -29,6 +40,6 @@ export class VideoUploadPage { } private getSecondStepSubmitButton () { - return element(by.css('.submit-button:not(.disabled) input')) + return element(by.css('.submit-button:not(.disabled)')) } }