Fix local E2E tests
This commit is contained in:
parent
15b8f96b75
commit
2fc3b90cb7
|
@ -56,7 +56,7 @@ export class MyAccountPage {
|
|||
async removeVideo (name: string) {
|
||||
const container = await this.getVideoElement(name)
|
||||
|
||||
await container.$('.dropdown-toggle').click()
|
||||
await container.$('my-action-dropdown .dropdown-toggle').click()
|
||||
|
||||
const deleteItem = () => {
|
||||
return $$('.dropdown-menu .dropdown-item').find<WebdriverIO.Element>(async v => {
|
||||
|
@ -120,9 +120,7 @@ export class MyAccountPage {
|
|||
async updatePlaylistPrivacy (playlistUUID: string, privacy: 'Public' | 'Private' | 'Unlisted') {
|
||||
go('/my-library/video-playlists/update/' + playlistUUID)
|
||||
|
||||
await browser.waitUntil(async () => {
|
||||
return (await $('form .video-playlist-title').getText() === 'PLAYLIST')
|
||||
})
|
||||
await $('a[href*="/my-library/video-playlists/update/"]').waitForDisplayed()
|
||||
|
||||
await selectCustomSelect('videoChannelId', 'Main root channel')
|
||||
await selectCustomSelect('privacy', privacy)
|
||||
|
|
|
@ -67,7 +67,7 @@ export class VideoListPage {
|
|||
|
||||
async getVideosListName () {
|
||||
const elems = await $$('.videos .video-miniature .video-miniature-name')
|
||||
const texts = await Promise.all(elems.map(e => e.getText()))
|
||||
const texts = await elems.map(e => e.getText())
|
||||
|
||||
return texts.map(t => t.trim())
|
||||
}
|
||||
|
|
|
@ -13,8 +13,11 @@ export class VideoWatchPage {
|
|||
const index = this.isMobileDevice ? 0 : 1
|
||||
|
||||
return browser.waitUntil(async () => {
|
||||
return await $('.video-info .video-info-name').isExisting() &&
|
||||
(await $$('.video-info .video-info-name')[index].getText()).includes(videoName)
|
||||
if (!await $('.video-info .video-info-name').isExisting()) return false
|
||||
|
||||
const elem = await $$('.video-info .video-info-name')[index]
|
||||
|
||||
return (await elem.getText()).includes(videoName) && elem.isDisplayed()
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -31,9 +34,13 @@ export class VideoWatchPage {
|
|||
}
|
||||
|
||||
async isDownloadEnabled () {
|
||||
await this.clickOnMoreDropdownIcon()
|
||||
try {
|
||||
await this.clickOnMoreDropdownIcon()
|
||||
|
||||
return $('.dropdown-item .icon-download').isExisting()
|
||||
return await $('.dropdown-item .icon-download').isExisting()
|
||||
} catch {
|
||||
return $('.action-button-download').isDisplayed()
|
||||
}
|
||||
}
|
||||
|
||||
areCommentsEnabled () {
|
||||
|
|
|
@ -176,7 +176,7 @@ describe('Videos all workflow', () => {
|
|||
await videoWatchPage.waitUntilVideoName(video2Name, 40 * 1000)
|
||||
})
|
||||
|
||||
it('Should watch the WEB VIDEO playlist in the embed', async () => {
|
||||
it('Should watch the Web Video playlist in the embed', async () => {
|
||||
if (isUploadUnsupported()) return
|
||||
|
||||
const accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`)
|
||||
|
|
|
@ -30,14 +30,21 @@ describe('Custom server defaults', () => {
|
|||
|
||||
await videoWatchPage.waitWatchVideoName('video')
|
||||
|
||||
expect(await videoWatchPage.getPrivacy()).toBe('Internal')
|
||||
expect(await videoWatchPage.getLicence()).toBe('Attribution - Non Commercial')
|
||||
expect(await videoWatchPage.isDownloadEnabled()).toBeFalsy()
|
||||
expect(await videoWatchPage.areCommentsEnabled()).toBeFalsy()
|
||||
})
|
||||
const videoUrl = await browser.getUrl()
|
||||
|
||||
after(async function () {
|
||||
expect(await videoWatchPage.getPrivacy()).toBe('Unlisted')
|
||||
expect(await videoWatchPage.getLicence()).toBe('Attribution - Non Commercial')
|
||||
expect(await videoWatchPage.areCommentsEnabled()).toBeFalsy()
|
||||
|
||||
// Owners can download their videos
|
||||
expect(await videoWatchPage.isDownloadEnabled()).toBeTruthy()
|
||||
|
||||
// Logout to see if the download enabled is correct for anonymous users
|
||||
await loginPage.logout()
|
||||
await browser.url(videoUrl)
|
||||
await videoWatchPage.waitWatchVideoName('video')
|
||||
|
||||
expect(await videoWatchPage.isDownloadEnabled()).toBeFalsy()
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -130,10 +130,12 @@ describe('Password protected videos', () => {
|
|||
|
||||
it('Should update the playlist to public', async () => {
|
||||
const url = await browser.getUrl()
|
||||
const regex = /\/([a-f0-9-]+)$/i
|
||||
const regex = /\/my-library\/video-playlists\/([^/]+)/i
|
||||
const match = url.match(regex)
|
||||
const uuid = match ? match[1] : null
|
||||
|
||||
expect(uuid).not.toBeNull()
|
||||
|
||||
await myAccountPage.updatePlaylistPrivacy(uuid, 'Public')
|
||||
})
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ function buildConfig (suiteFile: string = undefined) {
|
|||
publish: {
|
||||
download_enabled: false,
|
||||
comments_enabled: false,
|
||||
privacy: 4,
|
||||
privacy: 2,
|
||||
licence: 4
|
||||
},
|
||||
p2p: {
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import { Routes } from '@angular/router'
|
||||
import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
|
||||
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
|
||||
import { BulkService } from '@app/shared/shared-moderation/bulk.service'
|
||||
import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service'
|
||||
import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service'
|
||||
import { UserAdminService } from '@app/shared/shared-users/user-admin.service'
|
||||
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
|
||||
import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component'
|
||||
import { AccountVideosComponent } from './account-videos/account-videos.component'
|
||||
import { AccountsComponent } from './accounts.component'
|
||||
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
|
||||
import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service'
|
||||
import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service'
|
||||
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
|
||||
import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
|
||||
|
||||
export default [
|
||||
{
|
||||
|
@ -21,7 +23,9 @@ export default [
|
|||
BlocklistService,
|
||||
VideoPlaylistService,
|
||||
VideoBlockService,
|
||||
AbuseService
|
||||
AbuseService,
|
||||
UserAdminService,
|
||||
BulkService
|
||||
],
|
||||
children: [
|
||||
{
|
||||
|
|
|
@ -1,85 +1,84 @@
|
|||
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
|
||||
|
||||
<div class="pt-two-cols"> <!-- playlist grid -->
|
||||
<div class="title-col">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="pt-breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a routerLink="/my-library/video-playlists" i18n>My Playlists</a>
|
||||
<div class="pt-two-cols"> <!-- playlist grid -->
|
||||
<div class="title-col">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="pt-breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a routerLink="/my-library/video-playlists" i18n>My Playlists</a>
|
||||
</li>
|
||||
|
||||
@if (isCreation()) {
|
||||
<li class="breadcrumb-item active" i18n>Create</li>
|
||||
} @else {
|
||||
<li class="breadcrumb-item active" i18n>Edit</li>
|
||||
|
||||
<li class="breadcrumb-item active" aria-current="page">
|
||||
<a *ngIf="videoPlaylistToUpdate" [routerLink]="[ '/my-library/video-playlists/update', videoPlaylistToUpdate?.shortUUID]">
|
||||
{{ videoPlaylistToUpdate?.displayName }}
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if (isCreation()) {
|
||||
<li class="breadcrumb-item active" i18n>Create</li>
|
||||
} @else {
|
||||
<li class="breadcrumb-item active" i18n>Edit</li>
|
||||
|
||||
<li class="breadcrumb-item active" aria-current="page">
|
||||
<a *ngIf="videoPlaylistToUpdate" [routerLink]="[ '/my-library/video-playlists/update', videoPlaylistToUpdate?.shortUUID]">
|
||||
{{ videoPlaylistToUpdate?.displayName }}
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if (isCreation()) {
|
||||
<h2 class="visually-hidden" i18n>NEW PLAYLIST</h2>
|
||||
} @else {
|
||||
<h2 class="visually-hidden" i18n>UPDATE PLAYLIST</h2>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="content-col">
|
||||
<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="thumbnailfile" i18n>Playlist thumbnail</label>
|
||||
|
||||
<my-preview-upload
|
||||
i18n-inputLabel inputLabel="Edit" inputName="thumbnailfile" formControlName="thumbnailfile"
|
||||
previewWidth="223px" previewHeight="122px"
|
||||
></my-preview-upload>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label i18n for="displayName">Display name</label>
|
||||
<input
|
||||
type="text" id="displayName" class="form-control"
|
||||
formControlName="displayName" [ngClass]="{ 'input-error': formErrors['displayName'] }"
|
||||
>
|
||||
<div *ngIf="formErrors['displayName']" class="form-error" role="alert">
|
||||
{{ formErrors['displayName'] }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label i18n for="description">Description</label><my-help helpType="markdownText"></my-help>
|
||||
<my-markdown-textarea id="description" formControlName="description" [formError]="formErrors['description']"></my-markdown-textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label i18n for="privacy">Privacy</label>
|
||||
<div class="peertube-select-container">
|
||||
<my-select-options
|
||||
labelForId="privacy" [items]="videoPlaylistPrivacies" formControlName="privacy" [clearable]="false"
|
||||
></my-select-options>
|
||||
</div>
|
||||
|
||||
<div *ngIf="formErrors.privacy" class="form-error" role="alert">{{ formErrors.privacy }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="videoChannelIdl" i18n>Channel</label>
|
||||
|
||||
<my-select-channel
|
||||
labelForId="videoChannelId" [items]="userVideoChannels" formControlName="videoChannelId"
|
||||
></my-select-channel>
|
||||
|
||||
<div *ngIf="formErrors['videoChannelId']" class="form-error" role="alert">{{ formErrors['videoChannelId'] }}</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="peertube-button orange-button" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
|
||||
</form>
|
||||
</div>
|
||||
@if (isCreation()) {
|
||||
<h2 class="visually-hidden" i18n>NEW PLAYLIST</h2>
|
||||
} @else {
|
||||
<h2 class="visually-hidden" i18n>UPDATE PLAYLIST</h2>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="content-col">
|
||||
<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="thumbnailfile" i18n>Playlist thumbnail</label>
|
||||
|
||||
<my-preview-upload
|
||||
i18n-inputLabel inputLabel="Edit" inputName="thumbnailfile" formControlName="thumbnailfile"
|
||||
previewWidth="223px" previewHeight="122px"
|
||||
></my-preview-upload>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label i18n for="displayName">Display name</label>
|
||||
<input
|
||||
type="text" id="displayName" class="form-control"
|
||||
formControlName="displayName" [ngClass]="{ 'input-error': formErrors['displayName'] }"
|
||||
>
|
||||
<div *ngIf="formErrors['displayName']" class="form-error" role="alert">
|
||||
{{ formErrors['displayName'] }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label i18n for="description">Description</label><my-help helpType="markdownText"></my-help>
|
||||
<my-markdown-textarea id="description" formControlName="description" [formError]="formErrors['description']"></my-markdown-textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label i18n for="privacy">Privacy</label>
|
||||
<div class="peertube-select-container">
|
||||
<my-select-options
|
||||
labelForId="privacy" [items]="videoPlaylistPrivacies" formControlName="privacy" [clearable]="false"
|
||||
></my-select-options>
|
||||
</div>
|
||||
|
||||
<div *ngIf="formErrors.privacy" class="form-error" role="alert">{{ formErrors.privacy }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="videoChannelIdl" i18n>Channel</label>
|
||||
|
||||
<my-select-channel
|
||||
labelForId="videoChannelId" [items]="userVideoChannels" formControlName="videoChannelId"
|
||||
></my-select-channel>
|
||||
|
||||
<div *ngIf="formErrors['videoChannelId']" class="form-error" role="alert">{{ formErrors['videoChannelId'] }}</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="peertube-button orange-button" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
import { Routes } from '@angular/router'
|
||||
import { VideoWatchComponent } from './video-watch.component'
|
||||
import { OverviewService } from '../video-list'
|
||||
import { RecentVideosRecommendationService, RecommendedVideosStore } from './shared'
|
||||
import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
|
||||
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
|
||||
import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service'
|
||||
import { SearchService } from '@app/shared/shared-search/search.service'
|
||||
import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service'
|
||||
import { UserAdminService } from '@app/shared/shared-users/user-admin.service'
|
||||
import { VideoCommentService } from '@app/shared/shared-video-comment/video-comment.service'
|
||||
import { LiveVideoService } from '@app/shared/shared-video-live/live-video.service'
|
||||
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
|
||||
import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
|
||||
import { OverviewService } from '../video-list'
|
||||
import { RecentVideosRecommendationService, RecommendedVideosStore } from './shared'
|
||||
import { VideoWatchComponent } from './video-watch.component'
|
||||
import { BulkService } from '@app/shared/shared-moderation/bulk.service'
|
||||
|
||||
export default [
|
||||
{
|
||||
|
@ -25,7 +27,9 @@ export default [
|
|||
RecentVideosRecommendationService,
|
||||
RecommendedVideosStore,
|
||||
SearchService,
|
||||
AbuseService
|
||||
AbuseService,
|
||||
UserAdminService,
|
||||
BulkService
|
||||
],
|
||||
children: [
|
||||
{
|
||||
|
|
|
@ -398,6 +398,8 @@ class PeerTubePlugin extends Plugin {
|
|||
|
||||
private updatePlayerSizeClasses () {
|
||||
requestAnimationFrame(() => {
|
||||
if (!this.player) return
|
||||
|
||||
debugLogger('Updating player size classes')
|
||||
|
||||
const width = this.player.currentWidth()
|
||||
|
|
Loading…
Reference in New Issue