getVideosListName () {
return element.all(by.css('.videos .video-miniature .video-miniature-name'))
.getText()
- .then((texts: any) => texts.map(t => t.trim()))
+ .then((texts: any) => texts.map((t: any) => t.trim()))
}
- waitWatchVideoName (videoName: string, isSafari: boolean) {
- const elem = element(by.css('.video-info .video-info-name'))
+ waitWatchVideoName (videoName: string, isMobileDevice: boolean, isSafari: boolean) {
+ // On mobile we display the first node, on desktop the second
+ const index = isMobileDevice ? 0 : 1
+
+ const elem = element.all(by.css('.video-info .video-info-name')).get(index)
if (isSafari) return browser.sleep(5000)
.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')
+ }
}