From 0845e480d25a644661cb4e0eed366719289ebc37 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 May 2020 10:15:31 +0200 Subject: Cleanup E2E tests --- client/e2e/protractor.conf.js | 68 ++++++++++++++++++------------------- client/e2e/src/po/video-watch.po.ts | 13 +++---- client/e2e/src/videos.e2e-spec.ts | 6 ++-- 3 files changed, 44 insertions(+), 43 deletions(-) diff --git a/client/e2e/protractor.conf.js b/client/e2e/protractor.conf.js index b087f70dc..3797961ff 100644 --- a/client/e2e/protractor.conf.js +++ b/client/e2e/protractor.conf.js @@ -21,40 +21,40 @@ exports.config = { }, multiCapabilities: [ - // { - // browserName: 'Safari', - // version: '11.1', - // name: 'Safari Desktop', - // resolution: '1280x1024' - // }, - // { - // browserName: 'Chrome', - // name: 'Latest Chrome Desktop', - // resolution: '1280x1024' - // }, - // { - // browserName: 'Firefox', - // version: '60', // ESR, - // name: 'Firefox ESR Desktop', - // resolution: '1280x1024' - // }, - // { - // browserName: 'Firefox', - // name: 'Latest Firefox Desktop', - // resolution: '1280x1024' - // }, - // { - // browserName: 'Edge', - // name: 'Latest Edge Desktop', - // resolution: '1280x1024' - // }, - // { - // browserName: 'Chrome', - // device: 'Google Nexus 6', - // realMobile: 'true', - // os_version: '5.0', - // name: 'Latest Chrome Android' - // }, + { + browserName: 'Safari', + version: '11.1', + name: 'Safari Desktop', + resolution: '1280x1024' + }, + { + browserName: 'Chrome', + name: 'Latest Chrome Desktop', + resolution: '1280x1024' + }, + { + browserName: 'Firefox', + version: '60', // ESR, + name: 'Firefox ESR Desktop', + resolution: '1280x1024' + }, + { + browserName: 'Firefox', + name: 'Latest Firefox Desktop', + resolution: '1280x1024' + }, + { + browserName: 'Edge', + name: 'Latest Edge Desktop', + resolution: '1280x1024' + }, + { + browserName: 'Chrome', + device: 'Google Nexus 6', + realMobile: 'true', + os_version: '5.0', + name: 'Latest Chrome Android' + }, { browserName: 'Safari', device: 'iPhone 8', diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index bcfceefbc..35ec773af 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts @@ -1,5 +1,5 @@ import { browser, by, element, ElementFinder, ExpectedConditions } from 'protractor' -import { browserSleep } from '../utils' +import { browserSleep, isIOS, isMobileDevice } from '../utils' export class VideoWatchPage { async goOnVideosList (isMobileDevice: boolean, isSafari: boolean) { @@ -48,22 +48,23 @@ export class VideoWatchPage { return this.getVideoNameElement().getText() } - async playAndPauseVideo (isAutoplay: boolean, isMobileDevice: boolean) { - if (isAutoplay === false) { + async playAndPauseVideo (isAutoplay: boolean) { + // Autoplay is disabled on iOS + if (isAutoplay === false || await isIOS()) { const playButton = element(by.css('.vjs-big-play-button')) await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton)) await playButton.click() } - await browserSleep(1000) + await browserSleep(2000) await browser.wait(browser.ExpectedConditions.invisibilityOf(element(by.css('.vjs-loading-spinner')))) const videojsEl = element(by.css('div.video-js')) await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl)) // On Android, we need to click twice on "play" (BrowserStack particularity) - if (isMobileDevice) { - await browserSleep(3000) + if (await isMobileDevice()) { + await browserSleep(5000) await videojsEl.click() } diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index 0cba8331f..bbc5f7da3 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts @@ -99,7 +99,7 @@ describe('Videos workflow', () => { it('Should play the video', async () => { videoWatchUrl = await browser.getCurrentUrl() - await videoWatchPage.playAndPauseVideo(true, await isMobileDevice()) + await videoWatchPage.playAndPauseVideo(true) expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) }) @@ -108,7 +108,7 @@ describe('Videos workflow', () => { await videoWatchPage.goOnAssociatedEmbed() - await videoWatchPage.playAndPauseVideo(false, await isMobileDevice()) + await videoWatchPage.playAndPauseVideo(false) expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) await browser.waitForAngularEnabled(true) @@ -119,7 +119,7 @@ describe('Videos workflow', () => { await videoWatchPage.goOnP2PMediaLoaderEmbed() - await videoWatchPage.playAndPauseVideo(false, await isMobileDevice()) + await videoWatchPage.playAndPauseVideo(false) expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) await browser.waitForAngularEnabled(true) -- cgit v1.2.3