From 60c8b8a5d7bb1aeca18e2d45f5eeccdd66f2276a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 May 2020 09:41:39 +0200 Subject: [PATCH] Improve E2E tests --- client/e2e/protractor.conf.js | 4 +++- client/e2e/src/po/video-watch.po.ts | 9 ++++----- client/e2e/src/videos.e2e-spec.ts | 4 ++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client/e2e/protractor.conf.js b/client/e2e/protractor.conf.js index 3fce9b0f5..5682de829 100644 --- a/client/e2e/protractor.conf.js +++ b/client/e2e/protractor.conf.js @@ -12,7 +12,9 @@ exports.config = { 'browserstack.user': process.env.BROWSERSTACK_USER, 'browserstack.key': process.env.BROWSERSTACK_KEY, 'browserstack.local': true, - project: 'PeerTube' + 'browserstack.console': 'info', + project: 'PeerTube', + name: 'Bstack-[Protractor] Parallel Test' }, multiCapabilities: [ diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index a6efae288..4a36fce62 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts @@ -14,7 +14,7 @@ export class VideoWatchPage { await browser.get(url) // Waiting the following element does not work on Safari... - if (isSafari === true) return browser.sleep(3000) + if (isSafari) return browser.sleep(3000) const elem = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() return browser.wait(browser.ExpectedConditions.visibilityOf(elem)) @@ -84,13 +84,12 @@ export class VideoWatchPage { } async clickOnFirstVideo () { - const video = element.all(by.css('.videos .video-miniature .video-thumbnail')).first() - const videoName = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() + const video = element.all(by.css('.videos .video-miniature .video-miniature-name')).first() // Don't know why but the expectation fails on Safari await browser.wait(browser.ExpectedConditions.elementToBeClickable(video)) - const textToReturn = videoName.getText() + const textToReturn = video.getText() await video.click() await browser.wait(browser.ExpectedConditions.urlContains('/watch/')) @@ -106,7 +105,7 @@ export class VideoWatchPage { } async goOnP2PMediaLoaderEmbed () { - return browser.get('https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50?mode=p2p-media-loader') + return browser.get('https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50') } async clickOnUpdate () { diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index 075add531..b2c5ab4c6 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts @@ -53,6 +53,10 @@ describe('Videos workflow', () => { if (await isSafari()) { console.log('Safari detected.') } + + if (!await isMobileDevice()) { + await browser.driver.manage().window().maximize() + } }) it('Should log in', async () => {