Fix local e2e tests

pull/3447/head
Chocobozzz 2020-11-30 09:11:12 +01:00
parent 4a7f90248b
commit 6b88559bab
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
6 changed files with 20 additions and 4 deletions

View File

@ -16,8 +16,15 @@ export class MyAccountPage {
// My account Videos // My account Videos
removeVideo (name: string) { async removeVideo (name: string) {
return this.getVideoElement(name).element(by.css('my-delete-button')).click() const container = this.getVideoElement(name)
await container.element(by.css('.dropdown-toggle')).click()
const dropdownMenu = container.element(by.css('.dropdown-menu .dropdown-item:nth-child(2)'))
await browser.wait(browser.ExpectedConditions.presenceOf(dropdownMenu))
return dropdownMenu.click()
} }
validRemove () { validRemove () {

View File

@ -16,6 +16,12 @@ export class PlayerPage {
return browser.wait(browser.ExpectedConditions.textToBePresentInElement(elem, text)) return browser.wait(browser.ExpectedConditions.textToBePresentInElement(elem, text))
} }
waitUntilPlayerWrapper () {
const elem = element(by.css('#video-wrapper'))
return browser.wait(browser.ExpectedConditions.presenceOf(elem))
}
async playAndPauseVideo (isAutoplay: boolean) { async playAndPauseVideo (isAutoplay: boolean) {
const videojsEl = element(by.css('div.video-js')) const videojsEl = element(by.css('div.video-js'))
await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl)) await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl))

View File

@ -4,7 +4,7 @@ import { join } from 'path'
export class VideoUploadPage { export class VideoUploadPage {
async navigateTo () { async navigateTo () {
await element(by.css('.header .upload-button')).click() await element(by.css('.header .publish-button')).click()
return browser.wait(browser.ExpectedConditions.visibilityOf(element(by.css('.upload-video-container')))) return browser.wait(browser.ExpectedConditions.visibilityOf(element(by.css('.upload-video-container'))))
} }

View File

@ -206,6 +206,8 @@ describe('Videos workflow', () => {
await myAccountPage.goOnAssociatedPlaylistEmbed() await myAccountPage.goOnAssociatedPlaylistEmbed()
await playerPage.waitUntilPlayerWrapper()
await browser.executeScript(`window.localStorage.setItem('access_token', '${accessToken}');`) await browser.executeScript(`window.localStorage.setItem('access_token', '${accessToken}');`)
await browser.executeScript(`window.localStorage.setItem('refresh_token', '${refreshToken}');`) await browser.executeScript(`window.localStorage.setItem('refresh_token', '${refreshToken}');`)
await browser.executeScript(`window.localStorage.setItem('token_type', 'Bearer');`) await browser.executeScript(`window.localStorage.setItem('token_type', 'Bearer');`)

View File

@ -1,6 +1,6 @@
import { Hotkey, HotkeysService } from 'angular2-hotkeys' import { Hotkey, HotkeysService } from 'angular2-hotkeys'
import { concat } from 'rxjs' import { concat } from 'rxjs'
import { filter, first, map, pairwise, tap } from 'rxjs/operators' import { filter, first, map, pairwise } from 'rxjs/operators'
import { DOCUMENT, PlatformLocation, ViewportScroller } from '@angular/common' import { DOCUMENT, PlatformLocation, ViewportScroller } from '@angular/common'
import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core' import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core'
import { DomSanitizer, SafeHtml } from '@angular/platform-browser' import { DomSanitizer, SafeHtml } from '@angular/platform-browser'

View File

@ -6,6 +6,7 @@ npm run clean:server:test
( (
cd client cd client
npm run webdriver-manager -- update
npm run webpack -- --config webpack/webpack.video-embed.js --mode development npm run webpack -- --config webpack/webpack.video-embed.js --mode development
) )