From 84c7cde6e81426a42e7aa29187b473bc89f1c8f6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Feb 2019 11:24:07 +0100 Subject: Update E2E tests --- client/e2e/src/po/login.po.ts | 6 +++++- client/e2e/src/po/video-upload.po.ts | 5 +++-- client/e2e/src/po/video-watch.po.ts | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'client/e2e/src/po') diff --git a/client/e2e/src/po/login.po.ts b/client/e2e/src/po/login.po.ts index 40f958d2b..90b65c7ea 100644 --- a/client/e2e/src/po/login.po.ts +++ b/client/e2e/src/po/login.po.ts @@ -11,6 +11,10 @@ export class LoginPage { await element(by.css('form input[type=submit]')).click() - return browser.wait(browser.ExpectedConditions.urlContains('/videos/')) + expect(this.getLoggedInInfo().getText()).toContain('root') + } + + private getLoggedInInfo () { + return element(by.css('.logged-in-display-name')) } } diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 1978707e3..f79927abc 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts @@ -14,13 +14,14 @@ export class VideoUploadPage { const fileToUpload = join(__dirname, '../../fixtures/video.mp4') const fileInputSelector = '.upload-video-container input[type=file]' - const parentFileInput = '.upload-video .button-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('${fileInputSelector}').style.opacity = 1`) await browser.executeScript(`document.querySelector('${parentFileInput}').style.overflow = 'initial'`) + await browser.sleep(1000) + const elem = element(by.css(fileInputSelector)) await elem.sendKeys(fileToUpload) diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index d1e2a73b8..8369e1486 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts @@ -44,7 +44,7 @@ export class VideoWatchPage { .then(seconds => parseInt(seconds, 10)) } - async pauseVideo (isAutoplay: boolean, isMobileDevice: boolean) { + async playAndPauseVideo (isAutoplay: boolean, isMobileDevice: boolean) { if (isAutoplay === false) { const playButton = element(by.css('.vjs-big-play-button')) await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton)) @@ -97,4 +97,8 @@ export class VideoWatchPage { return browser.get(url) } + + async goOnP2PMediaLoaderEmbed () { + return browser.get('https://peertube2.cpy.re/videos/embed/4b997fc0-e106-42d9-bff9-ae9d64902bbb?mode=p2p-media-loader') + } } -- cgit v1.2.3