Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
peertube
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
flint media
peertube
Commits
84c7cde6
Unverified
Commit
84c7cde6
authored
Feb 21, 2019
by
Chocobozzz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update E2E tests
parent
1e17071b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
63 additions
and
32 deletions
+63
-32
local-protractor.conf.js
client/e2e/local-protractor.conf.js
+5
-4
protractor.conf.js
client/e2e/protractor.conf.js
+2
-5
login.po.ts
client/e2e/src/po/login.po.ts
+5
-1
video-upload.po.ts
client/e2e/src/po/video-upload.po.ts
+3
-2
video-watch.po.ts
client/e2e/src/po/video-watch.po.ts
+5
-1
videos.e2e-spec.ts
client/e2e/src/videos.e2e-spec.ts
+25
-4
user-notification-socket.service.ts
...app/core/notification/user-notification-socket.service.ts
+9
-6
video-thumbnail.component.scss
client/src/app/shared/video/video-thumbnail.component.scss
+2
-2
video-edit.component.ts
...src/app/videos/+video-edit/shared/video-edit.component.ts
+7
-4
index.sh
scripts/e2e/index.sh
+0
-1
local.sh
scripts/e2e/local.sh
+0
-2
No files found.
client/e2e/local-protractor.conf.js
View file @
84c7cde6
...
...
@@ -7,20 +7,21 @@ exports.config = {
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:3
333
/'
,
baseUrl
:
'http://localhost:3
000
/'
,
framework
:
'jasmine'
,
jasmineNodeOpts
:
{
showColors
:
true
,
...
...
client/e2e/protractor.conf.js
View file @
84c7cde6
...
...
@@ -18,7 +18,6 @@ exports.config = {
multiCapabilities
:
[
{
browserName
:
'Chrome'
,
version
:
'66'
,
name
:
'Latest Chrome Desktop'
},
{
...
...
@@ -28,17 +27,15 @@ exports.config = {
},
{
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'
},
{
...
...
client/e2e/src/po/login.po.ts
View file @
84c7cde6
...
...
@@ -11,6 +11,10 @@ export class LoginPage {
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'
))
}
}
client/e2e/src/po/video-upload.po.ts
View file @
84c7cde6
...
...
@@ -14,13 +14,14 @@ export class VideoUploadPage {
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
)
...
...
client/e2e/src/po/video-watch.po.ts
View file @
84c7cde6
...
...
@@ -44,7 +44,7 @@ export class VideoWatchPage {
.
then
(
seconds
=>
parseInt
(
seconds
,
10
))
}
async
pauseVideo
(
isAutoplay
:
boolean
,
isMobileDevice
:
boolean
)
{
async
p
layAndP
auseVideo
(
isAutoplay
:
boolean
,
isMobileDevice
:
boolean
)
{
if
(
isAutoplay
===
false
)
{
const
playButton
=
element
(
by
.
css
(
'.vjs-big-play-button'
))
await
browser
.
wait
(
browser
.
ExpectedConditions
.
elementToBeClickable
(
playButton
))
...
...
@@ -97,4 +97,8 @@ export class VideoWatchPage {
return
browser
.
get
(
url
)
}
async
goOnP2PMediaLoaderEmbed
()
{
return
browser
.
get
(
'https://peertube2.cpy.re/videos/embed/4b997fc0-e106-42d9-bff9-ae9d64902bbb?mode=p2p-media-loader'
)
}
}
client/e2e/src/videos.e2e-spec.ts
View file @
84c7cde6
...
...
@@ -12,8 +12,6 @@ describe('Videos workflow', () => {
let
isSafari
=
false
beforeEach
(
async
()
=>
{
await
browser
.
waitForAngularEnabled
(
false
)
videoWatchPage
=
new
VideoWatchPage
()
pageUploadPage
=
new
VideoUploadPage
()
loginPage
=
new
LoginPage
()
...
...
@@ -21,6 +19,14 @@ describe('Videos workflow', () => {
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'
,
()
=>
{
...
...
@@ -66,14 +72,29 @@ describe('Videos workflow', () => {
})
it
(
'Should play the video'
,
async
()
=>
{
await
videoWatchPage
.
p
auseVideo
(
!
isMobileDevic
e
,
isMobileDevice
)
await
videoWatchPage
.
p
layAndPauseVideo
(
tru
e
,
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
.
p
layAndP
auseVideo
(
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
)
})
})
client/src/app/core/notification/user-notification-socket.service.ts
View file @
84c7cde6
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'
...
...
@@ -13,7 +13,8 @@ export class UserNotificationSocket {
private
socket
:
SocketIOClient
.
Socket
constructor
(
private
auth
:
AuthService
private
auth
:
AuthService
,
private
ngZone
:
NgZone
)
{}
dispatch
(
type
:
NotificationEvent
,
notification
?:
UserNotificationServer
)
{
...
...
@@ -32,10 +33,12 @@ export class UserNotificationSocket {
// 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
))
})
}
}
client/src/app/shared/video/video-thumbnail.component.scss
View file @
84c7cde6
...
...
@@ -54,8 +54,8 @@ $play-overlay-width: 18px;
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
);
...
...
client/src/app/videos/+video-edit/shared/video-edit.component.ts
View file @
84c7cde6
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'
...
...
@@ -62,7 +62,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
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
...
...
@@ -132,9 +133,11 @@ export class VideoEditComponent implements OnInit, OnDestroy {
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
()
{
...
...
scripts/e2e/index.sh
View file @
84c7cde6
...
...
@@ -6,7 +6,6 @@ npm run clean:server:test
(
cd
client
npm run webdriver-manager update
npm run webpack
--
--config
webpack/webpack.video-embed.js
--mode
development
)
...
...
scripts/e2e/local.sh
View file @
84c7cde6
...
...
@@ -6,11 +6,9 @@ npm run clean:server:test
(
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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment