Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix local e2e tests

Chocobozzz507467b6a6a8
diff --git a/client/e2e/src/po/login.po.ts b/client/e2e/src/po/login.po.ts
index 67cd8e5e5f..d989dd8611 100644
--- a/client/e2e/src/po/login.po.ts
+++ b/client/e2e/src/po/login.po.ts
@@ -87,7 +87,7 @@ export class LoginPage {
await logout.click()
await browser.waitUntil(() => {
- return $('.login-buttons-block, my-error-page a[href="/login"]').isDisplayed()
+ return $$('.login-buttons-block, my-error-page a[href="/login"]').some(e => e.isDisplayed())
})
}
diff --git a/client/e2e/src/po/my-account.po.ts b/client/e2e/src/po/my-account.po.ts
index 73eb6162c9..743e3094f5 100644
--- a/client/e2e/src/po/my-account.po.ts
+++ b/client/e2e/src/po/my-account.po.ts
@@ -128,7 +128,8 @@ export class MyAccountPage {
await selectCustomSelect('privacy', privacy)
const submit = await $('form input[type=submit]')
- submit.waitForClickable()
+ await submit.waitForClickable()
+ await submit.scrollIntoView()
await submit.click()
return browser.waitUntil(async () => {
diff --git a/client/e2e/src/po/video-search.po.ts b/client/e2e/src/po/video-search.po.ts
index 5446718d1c..5bad2fa6c0 100644
--- a/client/e2e/src/po/video-search.po.ts
+++ b/client/e2e/src/po/video-search.po.ts
@@ -2,7 +2,7 @@ export class VideoSearchPage {
async search (search: string) {
await $('#search-video').setValue(search)
- await $('my-header .icon-search').click()
+ await $('.search-button').click()
await browser.waitUntil(() => {
return $('my-video-miniature').isDisplayed()
diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts
index ff3841a028..2ea692ec99 100644
--- a/client/e2e/src/po/video-upload.po.ts
+++ b/client/e2e/src/po/video-upload.po.ts
@@ -68,6 +68,7 @@ export class VideoUploadPage {
selectCustomSelect('privacy', 'Password protected')
const videoPasswordInput = $('input#videoPassword')
+ await videoPasswordInput.waitForClickable()
await videoPasswordInput.clearValue()
return videoPasswordInput.setValue(videoPassword)
diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts
index 76ac58e482..67081fe4a1 100644
--- a/client/e2e/src/po/video-watch.po.ts
+++ b/client/e2e/src/po/video-watch.po.ts
@@ -151,13 +151,13 @@ export class VideoWatchPage {
}
async fillVideoPassword (videoPassword: string) {
- const videoPasswordInput = $('input#confirmInput')
- const confirmButton = await $('input[value="Confirm"]')
-
+ const videoPasswordInput = await $('input#confirmInput')
+ await videoPasswordInput.waitForClickable()
await videoPasswordInput.clearValue()
await videoPasswordInput.setValue(videoPassword)
- await confirmButton.waitForClickable()
+ const confirmButton = await $('input[value="Confirm"]')
+ await confirmButton.waitForClickable()
return confirmButton.click()
}
@@ -188,6 +188,7 @@ export class VideoWatchPage {
async createThread (comment: string) {
const textarea = await $('my-video-comment-add textarea')
+ await textarea.waitForClickable()
await textarea.setValue(comment)
@@ -202,10 +203,12 @@ export class VideoWatchPage {
async createReply (comment: string) {
const replyButton = await $('button.comment-action-reply')
-
+ await replyButton.waitForClickable()
+ await replyButton.scrollIntoView()
await replyButton.click()
- const textarea = await $('my-video-comment my-video-comment-add textarea')
+ const textarea = await $('my-video-comment my-video-comment-add textarea')
+ await textarea.waitForClickable()
await textarea.setValue(comment)
const confirmButton = await $('my-video-comment .comment-buttons .orange-button')
diff --git a/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts b/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts
index 71840d7073..4d5f440016 100644
--- a/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts
+++ b/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts
@@ -1,7 +1,7 @@
import { LoginPage } from '../po/login.po'
import { VideoUploadPage } from '../po/video-upload.po'
import { VideoWatchPage } from '../po/video-watch.po'
-import { go, isMobileDevice, isSafari, waitServerUp } from '../utils'
+import { getScreenshotPath, go, isMobileDevice, isSafari, waitServerUp } from '../utils'
describe('Custom server defaults', () => {
let videoUploadPage: VideoUploadPage
@@ -83,4 +83,8 @@ describe('Custom server defaults', () => {
await checkP2P(false)
})
})
+
+ after(async () => {
+ await browser.saveScreenshot(getScreenshotPath('after-test.png'))
+ })
})
diff --git a/client/e2e/src/suites-local/video-password.e2e-spec.ts b/client/e2e/src/suites-local/video-password.e2e-spec.ts
index cd1b1d48ef..3683b387a0 100644
--- a/client/e2e/src/suites-local/video-password.e2e-spec.ts
+++ b/client/e2e/src/suites-local/video-password.e2e-spec.ts
@@ -3,7 +3,7 @@ import { SignupPage } from '../po/signup.po'
import { PlayerPage } from '../po/player.po'
import { VideoUploadPage } from '../po/video-upload.po'
import { VideoWatchPage } from '../po/video-watch.po'
-import { go, isMobileDevice, isSafari, waitServerUp } from '../utils'
+import { getScreenshotPath, go, isMobileDevice, isSafari, waitServerUp } from '../utils'
import { MyAccountPage } from '../po/my-account.po'
describe('Password protected videos', () => {
@@ -153,6 +153,7 @@ describe('Password protected videos', () => {
})
describe('Regular users', function () {
+
before(async () => {
await signupPage.fullSignup({
accountInfo: {
@@ -221,4 +222,8 @@ describe('Password protected videos', () => {
await videoWatchPage.waitUntilVideoName(publicVideoName2, 40 * 1000)
})
})
+
+ after(async () => {
+ await browser.saveScreenshot(getScreenshotPath('after-test.png'))
+ })
})
diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.ts
index 1daff5fcce..05a32916ca 100644
--- a/client/e2e/src/utils/hooks.ts
+++ b/client/e2e/src/utils/hooks.ts
@@ -93,5 +93,14 @@ function buildConfig (suiteFile: string = undefined) {
}
}
+ if (filename === 'video-password.e2e-spec.ts') {
+ return {
+ signup: {
+ enabled: true,
+ limit: -1
+ }
+ }
+ }
+
return {}
}