mirror of https://github.com/Chocobozzz/PeerTube
Fix E2E tests
parent
9929fbd6f4
commit
51b66ea7cb
|
@ -1,16 +0,0 @@
|
||||||
import { browser, by, element } from 'protractor'
|
|
||||||
|
|
||||||
export class AppPage {
|
|
||||||
|
|
||||||
async closeWelcomeModal () {
|
|
||||||
const firstHandle = await browser.getWindowHandle()
|
|
||||||
|
|
||||||
if (await element(by.css('.configure-instance-button')).isPresent() === false) return
|
|
||||||
|
|
||||||
await element(by.css('.configure-instance-button')).click()
|
|
||||||
|
|
||||||
await browser.sleep(5000)
|
|
||||||
|
|
||||||
await browser.switchTo().window(firstHandle)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,6 +4,9 @@ export class LoginPage {
|
||||||
async loginAsRootUser () {
|
async loginAsRootUser () {
|
||||||
await browser.get('/login')
|
await browser.get('/login')
|
||||||
|
|
||||||
|
await browser.executeScript(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`)
|
||||||
|
await browser.executeScript(`window.localStorage.setItem('no_welcome_modal', 'true')`)
|
||||||
|
|
||||||
element(by.css('input#username')).sendKeys('root')
|
element(by.css('input#username')).sendKeys('root')
|
||||||
element(by.css('input#password')).sendKeys('test1')
|
element(by.css('input#password')).sendKeys('test1')
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ export class MyAccountPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
validRemove () {
|
validRemove () {
|
||||||
return element(by.css('.action-button-submit')).click()
|
return element(by.css('input[type=submit]')).click()
|
||||||
}
|
}
|
||||||
|
|
||||||
countVideos (names: string[]) {
|
countVideos (names: string[]) {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { browser } from 'protractor'
|
import { browser } from 'protractor'
|
||||||
import { AppPage } from './po/app.po'
|
|
||||||
import { LoginPage } from './po/login.po'
|
import { LoginPage } from './po/login.po'
|
||||||
import { MyAccountPage } from './po/my-account'
|
import { MyAccountPage } from './po/my-account'
|
||||||
import { PlayerPage } from './po/player.po'
|
import { PlayerPage } from './po/player.po'
|
||||||
|
@ -23,7 +22,6 @@ describe('Videos workflow', () => {
|
||||||
let videoUpdatePage: VideoUpdatePage
|
let videoUpdatePage: VideoUpdatePage
|
||||||
let myAccountPage: MyAccountPage
|
let myAccountPage: MyAccountPage
|
||||||
let loginPage: LoginPage
|
let loginPage: LoginPage
|
||||||
let appPage: AppPage
|
|
||||||
let playerPage: PlayerPage
|
let playerPage: PlayerPage
|
||||||
|
|
||||||
let videoName = new Date().getTime() + ' video'
|
let videoName = new Date().getTime() + ' video'
|
||||||
|
@ -37,7 +35,6 @@ describe('Videos workflow', () => {
|
||||||
videoUpdatePage = new VideoUpdatePage()
|
videoUpdatePage = new VideoUpdatePage()
|
||||||
myAccountPage = new MyAccountPage()
|
myAccountPage = new MyAccountPage()
|
||||||
loginPage = new LoginPage()
|
loginPage = new LoginPage()
|
||||||
appPage = new AppPage()
|
|
||||||
playerPage = new PlayerPage()
|
playerPage = new PlayerPage()
|
||||||
|
|
||||||
if (await isIOS()) {
|
if (await isIOS()) {
|
||||||
|
@ -66,12 +63,6 @@ describe('Videos workflow', () => {
|
||||||
return loginPage.loginAsRootUser()
|
return loginPage.loginAsRootUser()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should close the welcome modal', async () => {
|
|
||||||
if (await skipIfUploadNotSupported()) return
|
|
||||||
|
|
||||||
await appPage.closeWelcomeModal()
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Should upload a video', async () => {
|
it('Should upload a video', async () => {
|
||||||
if (await skipIfUploadNotSupported()) return
|
if (await skipIfUploadNotSupported()) return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue