aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/po/video-upload.po.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-17 10:55:01 +0200
committerChocobozzz <me@florianbigard.com>2018-05-17 15:20:21 +0200
commit5f92c4dc5f08094548be9d23080dd3ca75741c65 (patch)
treea5fd5e2e7f46b28817733afc3cd1a3afcdab0c3a /client/e2e/src/po/video-upload.po.ts
parent74af5a8361f4ccb460001706ce249d50c747f361 (diff)
downloadPeerTube-5f92c4dc5f08094548be9d23080dd3ca75741c65.tar.gz
PeerTube-5f92c4dc5f08094548be9d23080dd3ca75741c65.tar.zst
PeerTube-5f92c4dc5f08094548be9d23080dd3ca75741c65.zip
Add videos e2e tests
Diffstat (limited to 'client/e2e/src/po/video-upload.po.ts')
-rw-r--r--client/e2e/src/po/video-upload.po.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts
new file mode 100644
index 000000000..4f09bb2fa
--- /dev/null
+++ b/client/e2e/src/po/video-upload.po.ts
@@ -0,0 +1,31 @@
1import { browser, element, by } from 'protractor'
2import { join } from 'path'
3
4export class VideoUploadPage {
5 navigateTo () {
6 return browser.get('/videos/upload')
7 }
8
9 async uploadVideo () {
10 const fileToUpload = join(__dirname, '../../fixtures/video.mp4')
11
12 await element(by.css('.upload-video-container input[type=file]')).sendKeys(fileToUpload)
13
14 // Wait for the upload to finish
15 await browser.wait(browser.ExpectedConditions.elementToBeClickable(this.getSecondStepSubmitButton()))
16 }
17
18 async validSecondUploadStep (videoName: string) {
19 const nameInput = element(by.css('input#name'))
20 await nameInput.clear()
21 await nameInput.sendKeys(videoName)
22
23 await this.getSecondStepSubmitButton().click()
24
25 return browser.wait(browser.ExpectedConditions.urlContains('/watch/'))
26 }
27
28 private getSecondStepSubmitButton () {
29 return element(by.css('.submit-button:not(.disabled) input'))
30 }
31}