Fix local e2e tests
This commit is contained in:
parent
880f8b924d
commit
507467b6a6
|
@ -87,7 +87,7 @@ export class LoginPage {
|
||||||
await logout.click()
|
await logout.click()
|
||||||
|
|
||||||
await browser.waitUntil(() => {
|
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())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,8 @@ export class MyAccountPage {
|
||||||
await selectCustomSelect('privacy', privacy)
|
await selectCustomSelect('privacy', privacy)
|
||||||
|
|
||||||
const submit = await $('form input[type=submit]')
|
const submit = await $('form input[type=submit]')
|
||||||
submit.waitForClickable()
|
await submit.waitForClickable()
|
||||||
|
await submit.scrollIntoView()
|
||||||
await submit.click()
|
await submit.click()
|
||||||
|
|
||||||
return browser.waitUntil(async () => {
|
return browser.waitUntil(async () => {
|
||||||
|
|
|
@ -2,7 +2,7 @@ export class VideoSearchPage {
|
||||||
|
|
||||||
async search (search: string) {
|
async search (search: string) {
|
||||||
await $('#search-video').setValue(search)
|
await $('#search-video').setValue(search)
|
||||||
await $('my-header .icon-search').click()
|
await $('.search-button').click()
|
||||||
|
|
||||||
await browser.waitUntil(() => {
|
await browser.waitUntil(() => {
|
||||||
return $('my-video-miniature').isDisplayed()
|
return $('my-video-miniature').isDisplayed()
|
||||||
|
|
|
@ -68,6 +68,7 @@ export class VideoUploadPage {
|
||||||
selectCustomSelect('privacy', 'Password protected')
|
selectCustomSelect('privacy', 'Password protected')
|
||||||
|
|
||||||
const videoPasswordInput = $('input#videoPassword')
|
const videoPasswordInput = $('input#videoPassword')
|
||||||
|
await videoPasswordInput.waitForClickable()
|
||||||
await videoPasswordInput.clearValue()
|
await videoPasswordInput.clearValue()
|
||||||
|
|
||||||
return videoPasswordInput.setValue(videoPassword)
|
return videoPasswordInput.setValue(videoPassword)
|
||||||
|
|
|
@ -151,13 +151,13 @@ export class VideoWatchPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fillVideoPassword (videoPassword: string) {
|
async fillVideoPassword (videoPassword: string) {
|
||||||
const videoPasswordInput = $('input#confirmInput')
|
const videoPasswordInput = await $('input#confirmInput')
|
||||||
const confirmButton = await $('input[value="Confirm"]')
|
await videoPasswordInput.waitForClickable()
|
||||||
|
|
||||||
await videoPasswordInput.clearValue()
|
await videoPasswordInput.clearValue()
|
||||||
await videoPasswordInput.setValue(videoPassword)
|
await videoPasswordInput.setValue(videoPassword)
|
||||||
await confirmButton.waitForClickable()
|
|
||||||
|
|
||||||
|
const confirmButton = await $('input[value="Confirm"]')
|
||||||
|
await confirmButton.waitForClickable()
|
||||||
return confirmButton.click()
|
return confirmButton.click()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,6 +188,7 @@ export class VideoWatchPage {
|
||||||
|
|
||||||
async createThread (comment: string) {
|
async createThread (comment: string) {
|
||||||
const textarea = await $('my-video-comment-add textarea')
|
const textarea = await $('my-video-comment-add textarea')
|
||||||
|
await textarea.waitForClickable()
|
||||||
|
|
||||||
await textarea.setValue(comment)
|
await textarea.setValue(comment)
|
||||||
|
|
||||||
|
@ -202,10 +203,12 @@ export class VideoWatchPage {
|
||||||
|
|
||||||
async createReply (comment: string) {
|
async createReply (comment: string) {
|
||||||
const replyButton = await $('button.comment-action-reply')
|
const replyButton = await $('button.comment-action-reply')
|
||||||
|
await replyButton.waitForClickable()
|
||||||
|
await replyButton.scrollIntoView()
|
||||||
await replyButton.click()
|
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)
|
await textarea.setValue(comment)
|
||||||
|
|
||||||
const confirmButton = await $('my-video-comment .comment-buttons .orange-button')
|
const confirmButton = await $('my-video-comment .comment-buttons .orange-button')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { LoginPage } from '../po/login.po'
|
import { LoginPage } from '../po/login.po'
|
||||||
import { VideoUploadPage } from '../po/video-upload.po'
|
import { VideoUploadPage } from '../po/video-upload.po'
|
||||||
import { VideoWatchPage } from '../po/video-watch.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', () => {
|
describe('Custom server defaults', () => {
|
||||||
let videoUploadPage: VideoUploadPage
|
let videoUploadPage: VideoUploadPage
|
||||||
|
@ -83,4 +83,8 @@ describe('Custom server defaults', () => {
|
||||||
await checkP2P(false)
|
await checkP2P(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
after(async () => {
|
||||||
|
await browser.saveScreenshot(getScreenshotPath('after-test.png'))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { SignupPage } from '../po/signup.po'
|
||||||
import { PlayerPage } from '../po/player.po'
|
import { PlayerPage } from '../po/player.po'
|
||||||
import { VideoUploadPage } from '../po/video-upload.po'
|
import { VideoUploadPage } from '../po/video-upload.po'
|
||||||
import { VideoWatchPage } from '../po/video-watch.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'
|
import { MyAccountPage } from '../po/my-account.po'
|
||||||
|
|
||||||
describe('Password protected videos', () => {
|
describe('Password protected videos', () => {
|
||||||
|
@ -153,6 +153,7 @@ describe('Password protected videos', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Regular users', function () {
|
describe('Regular users', function () {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await signupPage.fullSignup({
|
await signupPage.fullSignup({
|
||||||
accountInfo: {
|
accountInfo: {
|
||||||
|
@ -221,4 +222,8 @@ describe('Password protected videos', () => {
|
||||||
await videoWatchPage.waitUntilVideoName(publicVideoName2, 40 * 1000)
|
await videoWatchPage.waitUntilVideoName(publicVideoName2, 40 * 1000)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
after(async () => {
|
||||||
|
await browser.saveScreenshot(getScreenshotPath('after-test.png'))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -93,5 +93,14 @@ function buildConfig (suiteFile: string = undefined) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filename === 'video-password.e2e-spec.ts') {
|
||||||
|
return {
|
||||||
|
signup: {
|
||||||
|
enabled: true,
|
||||||
|
limit: -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue