1
0
Fork 0

Fix E2E tests

This commit is contained in:
Chocobozzz 2021-04-20 15:36:00 +02:00
parent 9929fbd6f4
commit 51b66ea7cb
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 4 additions and 26 deletions

View file

@ -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)
}
}

View file

@ -4,6 +4,9 @@ export class LoginPage {
async loginAsRootUser () {
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#password')).sendKeys('test1')

View file

@ -28,7 +28,7 @@ export class MyAccountPage {
}
validRemove () {
return element(by.css('.action-button-submit')).click()
return element(by.css('input[type=submit]')).click()
}
countVideos (names: string[]) {

View file

@ -1,5 +1,4 @@
import { browser } from 'protractor'
import { AppPage } from './po/app.po'
import { LoginPage } from './po/login.po'
import { MyAccountPage } from './po/my-account'
import { PlayerPage } from './po/player.po'
@ -23,7 +22,6 @@ describe('Videos workflow', () => {
let videoUpdatePage: VideoUpdatePage
let myAccountPage: MyAccountPage
let loginPage: LoginPage
let appPage: AppPage
let playerPage: PlayerPage
let videoName = new Date().getTime() + ' video'
@ -37,7 +35,6 @@ describe('Videos workflow', () => {
videoUpdatePage = new VideoUpdatePage()
myAccountPage = new MyAccountPage()
loginPage = new LoginPage()
appPage = new AppPage()
playerPage = new PlayerPage()
if (await isIOS()) {
@ -66,12 +63,6 @@ describe('Videos workflow', () => {
return loginPage.loginAsRootUser()
})
it('Should close the welcome modal', async () => {
if (await skipIfUploadNotSupported()) return
await appPage.closeWelcomeModal()
})
it('Should upload a video', async () => {
if (await skipIfUploadNotSupported()) return