]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix client e2e tests
authorChocobozzz <me@florianbigard.com>
Thu, 20 Sep 2018 13:45:11 +0000 (15:45 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 20 Sep 2018 13:45:11 +0000 (15:45 +0200)
README.md
client/e2e/src/po/video-watch.po.ts
client/e2e/src/videos.e2e-spec.ts

index 9fb89039b46625ecc9508e5005f4b4d7197c7e0e..3985f38bdf6e7e0a44cb28fb7dca98a79a76b3b3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -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" />
   </a>
   
-  <a href="https://www.browserstack.com/automate/public-build/VXBPc0szNjUvRUNsREJQRFF6RkEvSjJBclZ4VUJBUm1hcS9RZGpUbitRST0tLWFWbjNEdVN6eEZpYTk4dGVpMkVlQWc9PQ==--644e755052bf7fe2346eb6e868be8e706718a17c%">
-    <img src='https://www.browserstack.com/automate/badge.svg?badge_key=VXBPc0szNjUvRUNsREJQRFF6RkEvSjJBclZ4VUJBUm1hcS9RZGpUbitRST0tLWFWbjNEdVN6eEZpYTk4dGVpMkVlQWc9PQ==--644e755052bf7fe2346eb6e868be8e706718a17c%'/>
+  <a href="https://www.browserstack.com/automate/public-build/cWJhRDFJbS9qeUhzYW04MnlIVjlQQ0x3aE5POXBaV1lycGo5VlQxK3JqZz0tLTNUWW5ySEVvS1N4UnBhYlhsdXVCeVE9PQ==--db09e291d36a582af8b2929d62a625ed660cdf1d">
+    <img src='https://www.browserstack.com/automate/badge.svg?badge_key=cWJhRDFJbS9qeUhzYW04MnlIVjlQQ0x3aE5POXBaV1lycGo5VlQxK3JqZz0tLTNUWW5ySEVvS1N4UnBhYlhsdXVCeVE9PQ==--db09e291d36a582af8b2929d62a625ed660cdf1d'/>
   </a>
 </p>
 
index 13f4ae94592618e04c7d1bd10703ec61e406d144..e17aebc298186c2efdb0de5dea45a5a049e22513 100644 (file)
@@ -26,8 +26,11 @@ export class VideoWatchPage {
                   .then((texts: any) => texts.map(t => 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)
 
index 3d4d46292cf7dede9500e94a833620af970b566b..606b6ac5d152f25bc959621daee080840c84dd8f 100644 (file)
@@ -12,7 +12,7 @@ describe('Videos workflow', () => {
   let isSafari = false
 
   beforeEach(async () => {
-    browser.waitForAngularEnabled(false)
+    await browser.waitForAngularEnabled(false)
 
     videoWatchPage = new VideoWatchPage()
     pageUploadPage = new VideoUploadPage()
@@ -62,7 +62,7 @@ describe('Videos workflow', () => {
     if (isMobileDevice || isSafari) videoNameToExcept = await videoWatchPage.clickOnFirstVideo()
     else await videoWatchPage.clickOnVideo(videoName)
 
-    return videoWatchPage.waitWatchVideoName(videoNameToExcept, isSafari)
+    return videoWatchPage.waitWatchVideoName(videoNameToExcept, isMobileDevice, isSafari)
   })
 
   it('Should play the video', async () => {