diff options
Diffstat (limited to 'client/e2e/src/po/video-upload.po.ts')
-rw-r--r-- | client/e2e/src/po/video-upload.po.ts | 31 |
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 @@ | |||
1 | import { browser, element, by } from 'protractor' | ||
2 | import { join } from 'path' | ||
3 | |||
4 | export 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 | } | ||