Cleanup E2E tests
This commit is contained in:
parent
943fddfbbe
commit
0845e480d2
|
@ -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',
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue