Verified Commit 6247b205 authored by Chocobozzz's avatar Chocobozzz
Browse files

Fix client e2e tests

parent 93ea9c47
...@@ -24,8 +24,8 @@ directly in the web browser with <a href="https://github.com/feross/webtorrent"> ...@@ -24,8 +24,8 @@ directly in the web browser with <a href="https://github.com/feross/webtorrent">
<img src="https://david-dm.org/Chocobozzz/PeerTube/dev-status.svg?path=client" alt="devDependency Status" /> <img src="https://david-dm.org/Chocobozzz/PeerTube/dev-status.svg?path=client" alt="devDependency Status" />
</a> </a>
<a href="https://www.browserstack.com/automate/public-build/VXBPc0szNjUvRUNsREJQRFF6RkEvSjJBclZ4VUJBUm1hcS9RZGpUbitRST0tLWFWbjNEdVN6eEZpYTk4dGVpMkVlQWc9PQ==--644e755052bf7fe2346eb6e868be8e706718a17c%"> <a href="https://www.browserstack.com/automate/public-build/cWJhRDFJbS9qeUhzYW04MnlIVjlQQ0x3aE5POXBaV1lycGo5VlQxK3JqZz0tLTNUWW5ySEVvS1N4UnBhYlhsdXVCeVE9PQ==--db09e291d36a582af8b2929d62a625ed660cdf1d">
<img src='https://www.browserstack.com/automate/badge.svg?badge_key=VXBPc0szNjUvRUNsREJQRFF6RkEvSjJBclZ4VUJBUm1hcS9RZGpUbitRST0tLWFWbjNEdVN6eEZpYTk4dGVpMkVlQWc9PQ==--644e755052bf7fe2346eb6e868be8e706718a17c%'/> <img src='https://www.browserstack.com/automate/badge.svg?badge_key=cWJhRDFJbS9qeUhzYW04MnlIVjlQQ0x3aE5POXBaV1lycGo5VlQxK3JqZz0tLTNUWW5ySEVvS1N4UnBhYlhsdXVCeVE9PQ==--db09e291d36a582af8b2929d62a625ed660cdf1d'/>
</a> </a>
</p> </p>
......
...@@ -26,8 +26,11 @@ export class VideoWatchPage { ...@@ -26,8 +26,11 @@ export class VideoWatchPage {
.then((texts: any) => texts.map(t => t.trim())) .then((texts: any) => texts.map(t => t.trim()))
} }
waitWatchVideoName (videoName: string, isSafari: boolean) { waitWatchVideoName (videoName: string, isMobileDevice: boolean, isSafari: boolean) {
const elem = element(by.css('.video-info .video-info-name')) // 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) if (isSafari) return browser.sleep(5000)
......
...@@ -12,7 +12,7 @@ describe('Videos workflow', () => { ...@@ -12,7 +12,7 @@ describe('Videos workflow', () => {
let isSafari = false let isSafari = false
beforeEach(async () => { beforeEach(async () => {
browser.waitForAngularEnabled(false) await browser.waitForAngularEnabled(false)
videoWatchPage = new VideoWatchPage() videoWatchPage = new VideoWatchPage()
pageUploadPage = new VideoUploadPage() pageUploadPage = new VideoUploadPage()
...@@ -62,7 +62,7 @@ describe('Videos workflow', () => { ...@@ -62,7 +62,7 @@ describe('Videos workflow', () => {
if (isMobileDevice || isSafari) videoNameToExcept = await videoWatchPage.clickOnFirstVideo() if (isMobileDevice || isSafari) videoNameToExcept = await videoWatchPage.clickOnFirstVideo()
else await videoWatchPage.clickOnVideo(videoName) else await videoWatchPage.clickOnVideo(videoName)
return videoWatchPage.waitWatchVideoName(videoNameToExcept, isSafari) return videoWatchPage.waitWatchVideoName(videoNameToExcept, isMobileDevice, isSafari)
}) })
it('Should play the video', async () => { it('Should play the video', async () => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment