]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/e2e/src/po/video-upload.po.ts
Enhance plugin video fields
[github/Chocobozzz/PeerTube.git] / client / e2e / src / po / video-upload.po.ts
index 2206b56c3faebdfcd8d96f3abc17838e76ab12c8..38395ea2f0b4ed81d44184a5aef24461f4ea924a 100644 (file)
@@ -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')
   }