From 3c065fe3b3e1385d59ad1980251d14b712648155 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 22 Dec 2021 18:02:36 +0100 Subject: Enhance plugin video fields Add video form tab selection Add ability to display an error --- client/e2e/src/po/video-upload.po.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'client/e2e/src/po/video-upload.po.ts') diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 2206b56c3..38395ea2f 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts @@ -3,7 +3,10 @@ import { getCheckbox, selectCustomSelect } from '../utils' export class VideoUploadPage { async navigateTo () { - await $('.header .publish-button').click() + const publishButton = await $('.header .publish-button') + + await publishButton.waitForClickable() + await publishButton.click() await $('.upload-video-container').waitForDisplayed() } @@ -24,15 +27,17 @@ export class VideoUploadPage { // Wait for the upload to finish await browser.waitUntil(async () => { - const actionButton = this.getSecondStepSubmitButton().$('.action-button') + const warning = await $('=Publish will be available when upload is finished').isDisplayed() + const progress = await $('.progress-bar=100%').isDisplayed() - const klass = await actionButton.getAttribute('class') - return !klass.includes('disabled') + return !warning && progress }) } - setAsNSFW () { - return getCheckbox('nsfw').click() + async setAsNSFW () { + const checkbox = await getCheckbox('nsfw') + + return checkbox.click() } async validSecondUploadStep (videoName: string) { @@ -51,6 +56,10 @@ export class VideoUploadPage { return selectCustomSelect('privacy', 'Public') } + setAsPrivate () { + return selectCustomSelect('privacy', 'Private') + } + private getSecondStepSubmitButton () { return $('.submit-container my-button') } -- cgit v1.2.3