diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-21 11:24:07 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-21 14:04:44 +0100 |
commit | 84c7cde6e81426a42e7aa29187b473bc89f1c8f6 (patch) | |
tree | 5c85056f29bc563a6ea29ced4736d4d5cd9851fd /client/e2e/src/po | |
parent | 1e17071bacc8a78c9145ba602113b1b52dd8fe7b (diff) | |
download | PeerTube-84c7cde6e81426a42e7aa29187b473bc89f1c8f6.tar.gz PeerTube-84c7cde6e81426a42e7aa29187b473bc89f1c8f6.tar.zst PeerTube-84c7cde6e81426a42e7aa29187b473bc89f1c8f6.zip |
Update E2E tests
Diffstat (limited to 'client/e2e/src/po')
-rw-r--r-- | client/e2e/src/po/login.po.ts | 6 | ||||
-rw-r--r-- | client/e2e/src/po/video-upload.po.ts | 5 | ||||
-rw-r--r-- | client/e2e/src/po/video-watch.po.ts | 6 |
3 files changed, 13 insertions, 4 deletions
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 { | |||
11 | 11 | ||
12 | await element(by.css('form input[type=submit]')).click() | 12 | await element(by.css('form input[type=submit]')).click() |
13 | 13 | ||
14 | return browser.wait(browser.ExpectedConditions.urlContains('/videos/')) | 14 | expect(this.getLoggedInInfo().getText()).toContain('root') |
15 | } | ||
16 | |||
17 | private getLoggedInInfo () { | ||
18 | return element(by.css('.logged-in-display-name')) | ||
15 | } | 19 | } |
16 | } | 20 | } |
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 { | |||
14 | 14 | ||
15 | const fileToUpload = join(__dirname, '../../fixtures/video.mp4') | 15 | const fileToUpload = join(__dirname, '../../fixtures/video.mp4') |
16 | const fileInputSelector = '.upload-video-container input[type=file]' | 16 | const fileInputSelector = '.upload-video-container input[type=file]' |
17 | const parentFileInput = '.upload-video .button-file' | 17 | const parentFileInput = '.upload-video-container .button-file' |
18 | 18 | ||
19 | // Avoid sending keys on non visible element | 19 | // Avoid sending keys on non visible element |
20 | await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`) | 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'`) | 21 | await browser.executeScript(`document.querySelector('${parentFileInput}').style.overflow = 'initial'`) |
23 | 22 | ||
23 | await browser.sleep(1000) | ||
24 | |||
24 | const elem = element(by.css(fileInputSelector)) | 25 | const elem = element(by.css(fileInputSelector)) |
25 | await elem.sendKeys(fileToUpload) | 26 | await elem.sendKeys(fileToUpload) |
26 | 27 | ||
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 { | |||
44 | .then(seconds => parseInt(seconds, 10)) | 44 | .then(seconds => parseInt(seconds, 10)) |
45 | } | 45 | } |
46 | 46 | ||
47 | async pauseVideo (isAutoplay: boolean, isMobileDevice: boolean) { | 47 | async playAndPauseVideo (isAutoplay: boolean, isMobileDevice: boolean) { |
48 | if (isAutoplay === false) { | 48 | if (isAutoplay === false) { |
49 | const playButton = element(by.css('.vjs-big-play-button')) | 49 | const playButton = element(by.css('.vjs-big-play-button')) |
50 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton)) | 50 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton)) |
@@ -97,4 +97,8 @@ export class VideoWatchPage { | |||
97 | 97 | ||
98 | return browser.get(url) | 98 | return browser.get(url) |
99 | } | 99 | } |
100 | |||
101 | async goOnP2PMediaLoaderEmbed () { | ||
102 | return browser.get('https://peertube2.cpy.re/videos/embed/4b997fc0-e106-42d9-bff9-ae9d64902bbb?mode=p2p-media-loader') | ||
103 | } | ||
100 | } | 104 | } |