]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/e2e/src/po/video-upload.po.ts
Merge branch 'release/4.0.0' into develop
[github/Chocobozzz/PeerTube.git] / client / e2e / src / po / video-upload.po.ts
index dd437c3902f681f6bd0b1235093fea632c52e388..38395ea2f0b4ed81d44184a5aef24461f4ea924a 100644 (file)
@@ -1,9 +1,12 @@
 import { join } from 'path'
-import { clickOnCheckbox } from '../utils'
+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 clickOnCheckbox('nsfw')
+  async setAsNSFW () {
+    const checkbox = await getCheckbox('nsfw')
+
+    return checkbox.click()
   }
 
   async validSecondUploadStep (videoName: string) {
@@ -47,6 +52,14 @@ export class VideoUploadPage {
     })
   }
 
+  setAsPublic () {
+    return selectCustomSelect('privacy', 'Public')
+  }
+
+  setAsPrivate () {
+    return selectCustomSelect('privacy', 'Private')
+  }
+
   private getSecondStepSubmitButton () {
     return $('.submit-container my-button')
   }