From 51b66ea7cb39f075f4deb8ea92ba70f3be289769 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Apr 2021 15:36:00 +0200 Subject: [PATCH] Fix E2E tests --- client/e2e/src/po/app.po.ts | 16 ---------------- client/e2e/src/po/login.po.ts | 3 +++ client/e2e/src/po/my-account.ts | 2 +- client/e2e/src/videos.e2e-spec.ts | 9 --------- 4 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 client/e2e/src/po/app.po.ts diff --git a/client/e2e/src/po/app.po.ts b/client/e2e/src/po/app.po.ts deleted file mode 100644 index 3ed65399e..000000000 --- a/client/e2e/src/po/app.po.ts +++ /dev/null @@ -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) - } -} diff --git a/client/e2e/src/po/login.po.ts b/client/e2e/src/po/login.po.ts index 90b65c7ea..20412ee0d 100644 --- a/client/e2e/src/po/login.po.ts +++ b/client/e2e/src/po/login.po.ts @@ -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') diff --git a/client/e2e/src/po/my-account.ts b/client/e2e/src/po/my-account.ts index 0255cee16..61d42214d 100644 --- a/client/e2e/src/po/my-account.ts +++ b/client/e2e/src/po/my-account.ts @@ -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[]) { diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index cb7926258..bcc810297 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts @@ -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