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/admin-plugin.po.ts | 31 ++++++++++++++++++++++++++++++ client/e2e/src/po/anonymous-settings.po.ts | 2 +- client/e2e/src/po/my-account.po.ts | 2 +- client/e2e/src/po/video-upload.po.ts | 21 ++++++++++++++------ 4 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 client/e2e/src/po/admin-plugin.po.ts (limited to 'client/e2e/src/po') diff --git a/client/e2e/src/po/admin-plugin.po.ts b/client/e2e/src/po/admin-plugin.po.ts new file mode 100644 index 000000000..6a3f3cf28 --- /dev/null +++ b/client/e2e/src/po/admin-plugin.po.ts @@ -0,0 +1,31 @@ +import { browserSleep, go } from '../utils' + +export class AdminPluginPage { + + async navigateToSearch () { + await go('/admin/plugins/search') + + await $('my-plugin-search').waitForDisplayed() + } + + async search (name: string) { + const input = $('.search-bar input') + await input.waitForDisplayed() + await input.clearValue() + await input.setValue(name) + + await browserSleep(1000) + } + + async installHelloWorld () { + $('.plugin-name=hello-world').waitForDisplayed() + + await $('.card-body my-button[icon=cloud-download]').click() + + const submitModalButton = $('.modal-content input[type=submit]') + await submitModalButton.waitForClickable() + await submitModalButton.click() + + await $('.card-body my-edit-button').waitForDisplayed() + } +} diff --git a/client/e2e/src/po/anonymous-settings.po.ts b/client/e2e/src/po/anonymous-settings.po.ts index 180d371fa..21216a8f2 100644 --- a/client/e2e/src/po/anonymous-settings.po.ts +++ b/client/e2e/src/po/anonymous-settings.po.ts @@ -13,7 +13,7 @@ export class AnonymousSettingsPage { } async clickOnP2PCheckbox () { - const p2p = getCheckbox('p2pEnabled') + const p2p = await getCheckbox('p2pEnabled') await p2p.waitForClickable() await p2p.click() diff --git a/client/e2e/src/po/my-account.po.ts b/client/e2e/src/po/my-account.po.ts index 13a764e87..20dafbf06 100644 --- a/client/e2e/src/po/my-account.po.ts +++ b/client/e2e/src/po/my-account.po.ts @@ -31,7 +31,7 @@ export class MyAccountPage { } async clickOnP2PCheckbox () { - const p2p = getCheckbox('p2pEnabled') + const p2p = await getCheckbox('p2pEnabled') await p2p.waitForClickable() await p2p.scrollIntoView(false) // Avoid issues with fixed header on firefox 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