allScriptsTimeout: 25000,
specs: ['./src/**/*.e2e-spec.ts'],
- seleniumAddress: 'http://localhost:4444/wd/hub',
+ directConnect: true,
capabilities: {
'browserName': 'firefox',
'moz:firefoxOptions': {
- 'args': ["-headless"],
- "log": {
+ binary: '/usr/bin/firefox-esr',
+ // args: ["-headless"],
+ log: {
"level": "info" // default is "info"
}
}
},
// maxSessions: 1,
- baseUrl: 'http://localhost:3333/',
+ baseUrl: 'http://localhost:3000/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
multiCapabilities: [
{
browserName: 'Chrome',
- version: '66',
name: 'Latest Chrome Desktop'
},
{
},
{
browserName: 'Firefox',
- version: '52', // ESR,
- name: 'Old Firefox ESR Desktop'
+ version: '60', // ESR,
+ name: 'Firefox ESR Desktop'
},
{
browserName: 'Firefox',
- version: '60',
name: 'Latest Firefox Desktop'
},
{
browserName: 'Edge',
- version: '16',
name: 'Latest Edge Desktop'
},
{
await element(by.css('form input[type=submit]')).click()
- return browser.wait(browser.ExpectedConditions.urlContains('/videos/'))
+ expect(this.getLoggedInInfo().getText()).toContain('root')
+ }
+
+ private getLoggedInInfo () {
+ return element(by.css('.logged-in-display-name'))
}
}
const fileToUpload = join(__dirname, '../../fixtures/video.mp4')
const fileInputSelector = '.upload-video-container input[type=file]'
- const parentFileInput = '.upload-video .button-file'
+ const parentFileInput = '.upload-video-container .button-file'
// Avoid sending keys on non visible element
await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`)
- // await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`)
await browser.executeScript(`document.querySelector('${parentFileInput}').style.overflow = 'initial'`)
+ await browser.sleep(1000)
+
const elem = element(by.css(fileInputSelector))
await elem.sendKeys(fileToUpload)
.then(seconds => parseInt(seconds, 10))
}
- async pauseVideo (isAutoplay: boolean, isMobileDevice: boolean) {
+ async playAndPauseVideo (isAutoplay: boolean, isMobileDevice: boolean) {
if (isAutoplay === false) {
const playButton = element(by.css('.vjs-big-play-button'))
await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton))
return browser.get(url)
}
+
+ async goOnP2PMediaLoaderEmbed () {
+ return browser.get('https://peertube2.cpy.re/videos/embed/4b997fc0-e106-42d9-bff9-ae9d64902bbb?mode=p2p-media-loader')
+ }
}
let isSafari = false
beforeEach(async () => {
- await browser.waitForAngularEnabled(false)
-
videoWatchPage = new VideoWatchPage()
pageUploadPage = new VideoUploadPage()
loginPage = new LoginPage()
const caps = await browser.getCapabilities()
isMobileDevice = caps.get('realMobile') === 'true' || caps.get('realMobile') === true
isSafari = caps.get('browserName') && caps.get('browserName').toLowerCase() === 'safari'
+
+ if (isMobileDevice) {
+ console.log('Mobile device detected.')
+ }
+
+ if (isSafari) {
+ console.log('Safari detected.')
+ }
})
it('Should log in', () => {
})
it('Should play the video', async () => {
- await videoWatchPage.pauseVideo(!isMobileDevice, isMobileDevice)
+ await videoWatchPage.playAndPauseVideo(true, isMobileDevice)
expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2)
})
it('Should watch the associated embed video', async () => {
+ await browser.waitForAngularEnabled(false)
+
await videoWatchPage.goOnAssociatedEmbed()
- await videoWatchPage.pauseVideo(false, isMobileDevice)
+ await videoWatchPage.playAndPauseVideo(false, isMobileDevice)
expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2)
+
+ await browser.waitForAngularEnabled(true)
+ })
+
+ it('Should watch the p2p media loader embed video', async () => {
+ await browser.waitForAngularEnabled(false)
+
+ await videoWatchPage.goOnP2PMediaLoaderEmbed()
+
+ await videoWatchPage.playAndPauseVideo(false, isMobileDevice)
+ expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2)
+
+ await browser.waitForAngularEnabled(true)
})
})
-import { Injectable } from '@angular/core'
+import { Injectable, NgZone } from '@angular/core'
import { environment } from '../../../environments/environment'
import { UserNotification as UserNotificationServer } from '../../../../../shared'
import { Subject } from 'rxjs'
private socket: SocketIOClient.Socket
constructor (
- private auth: AuthService
+ private auth: AuthService,
+ private ngZone: NgZone
) {}
dispatch (type: NotificationEvent, notification?: UserNotificationServer) {
// FIXME: import('..') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function
const io: typeof import ('socket.io-client') = (await import('socket.io-client') as any).default
- this.socket = io(environment.apiUrl + '/user-notifications', {
- query: { accessToken: this.auth.getAccessToken() }
- })
+ this.ngZone.runOutsideAngular(() => {
+ this.socket = io(environment.apiUrl + '/user-notifications', {
+ query: { accessToken: this.auth.getAccessToken() }
+ })
- this.socket.on('new-notification', (n: UserNotificationServer) => this.dispatch('new', n))
+ this.socket.on('new-notification', (n: UserNotificationServer) => this.dispatch('new', n))
+ })
}
}
transition: all $play-overlay-transition;
- border-top: calc(#{$play-overlay-height} / 2) solid transparent;
- border-bottom: calc(#{$play-overlay-height} / 2) solid transparent;
+ border-top: ($play-overlay-height / 2) solid transparent;
+ border-bottom: ($play-overlay-height / 2) solid transparent;
border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95);
-import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
+import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'
import { ActivatedRoute, Router } from '@angular/router'
import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared'
private router: Router,
private notifier: Notifier,
private serverService: ServerService,
- private i18nPrimengCalendarService: I18nPrimengCalendarService
+ private i18nPrimengCalendarService: I18nPrimengCalendarService,
+ private ngZone: NgZone
) {
this.tagValidators = this.videoValidatorsService.VIDEO_TAGS.VALIDATORS
this.tagValidatorsMessages = this.videoValidatorsService.VIDEO_TAGS.MESSAGES
this.videoLicences = this.serverService.getVideoLicences()
this.videoLanguages = this.serverService.getVideoLanguages()
- this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute
-
this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id)
+
+ this.ngZone.runOutsideAngular(() => {
+ this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute
+ })
}
ngOnDestroy () {
(
cd client
- npm run webdriver-manager update
npm run webpack -- --config webpack/webpack.video-embed.js --mode development
)
(
cd client
- npm run webdriver-manager update
npm run webpack -- --config webpack/webpack.video-embed.js --mode development
)
npm run concurrently -- -k -s first \
- "cd client && npm run webdriver-manager start" \
"cd client && npm run ng -- e2e --port 3333 -c local" \
"NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start"