diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-30 09:11:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-30 09:11:12 +0100 |
commit | 6b88559babc1e0490119a6b52411b10910d9da9d (patch) | |
tree | 5a82afdc92899e921f8631f2e6b07b889b794278 /client | |
parent | 4a7f90248b546803cab07188521ac97e175b31e6 (diff) | |
download | PeerTube-6b88559babc1e0490119a6b52411b10910d9da9d.tar.gz PeerTube-6b88559babc1e0490119a6b52411b10910d9da9d.tar.zst PeerTube-6b88559babc1e0490119a6b52411b10910d9da9d.zip |
Fix local e2e tests
Diffstat (limited to 'client')
-rw-r--r-- | client/e2e/src/po/my-account.ts | 11 | ||||
-rw-r--r-- | client/e2e/src/po/player.po.ts | 6 | ||||
-rw-r--r-- | client/e2e/src/po/video-upload.po.ts | 2 | ||||
-rw-r--r-- | client/e2e/src/videos.e2e-spec.ts | 2 | ||||
-rw-r--r-- | client/src/app/app.component.ts | 2 |
5 files changed, 19 insertions, 4 deletions
diff --git a/client/e2e/src/po/my-account.ts b/client/e2e/src/po/my-account.ts index a39e5cc58..0255cee16 100644 --- a/client/e2e/src/po/my-account.ts +++ b/client/e2e/src/po/my-account.ts | |||
@@ -16,8 +16,15 @@ export class MyAccountPage { | |||
16 | 16 | ||
17 | // My account Videos | 17 | // My account Videos |
18 | 18 | ||
19 | removeVideo (name: string) { | 19 | async removeVideo (name: string) { |
20 | return this.getVideoElement(name).element(by.css('my-delete-button')).click() | 20 | const container = this.getVideoElement(name) |
21 | |||
22 | await container.element(by.css('.dropdown-toggle')).click() | ||
23 | |||
24 | const dropdownMenu = container.element(by.css('.dropdown-menu .dropdown-item:nth-child(2)')) | ||
25 | await browser.wait(browser.ExpectedConditions.presenceOf(dropdownMenu)) | ||
26 | |||
27 | return dropdownMenu.click() | ||
21 | } | 28 | } |
22 | 29 | ||
23 | validRemove () { | 30 | validRemove () { |
diff --git a/client/e2e/src/po/player.po.ts b/client/e2e/src/po/player.po.ts index d18d81f16..1bba11171 100644 --- a/client/e2e/src/po/player.po.ts +++ b/client/e2e/src/po/player.po.ts | |||
@@ -16,6 +16,12 @@ export class PlayerPage { | |||
16 | return browser.wait(browser.ExpectedConditions.textToBePresentInElement(elem, text)) | 16 | return browser.wait(browser.ExpectedConditions.textToBePresentInElement(elem, text)) |
17 | } | 17 | } |
18 | 18 | ||
19 | waitUntilPlayerWrapper () { | ||
20 | const elem = element(by.css('#video-wrapper')) | ||
21 | |||
22 | return browser.wait(browser.ExpectedConditions.presenceOf(elem)) | ||
23 | } | ||
24 | |||
19 | async playAndPauseVideo (isAutoplay: boolean) { | 25 | async playAndPauseVideo (isAutoplay: boolean) { |
20 | const videojsEl = element(by.css('div.video-js')) | 26 | const videojsEl = element(by.css('div.video-js')) |
21 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl)) | 27 | await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl)) |
diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 9eb1e31c1..7de715a95 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts | |||
@@ -4,7 +4,7 @@ import { join } from 'path' | |||
4 | 4 | ||
5 | export class VideoUploadPage { | 5 | export class VideoUploadPage { |
6 | async navigateTo () { | 6 | async navigateTo () { |
7 | await element(by.css('.header .upload-button')).click() | 7 | await element(by.css('.header .publish-button')).click() |
8 | 8 | ||
9 | return browser.wait(browser.ExpectedConditions.visibilityOf(element(by.css('.upload-video-container')))) | 9 | return browser.wait(browser.ExpectedConditions.visibilityOf(element(by.css('.upload-video-container')))) |
10 | } | 10 | } |
diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index d9d2cb9b9..a73b9f318 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts | |||
@@ -206,6 +206,8 @@ describe('Videos workflow', () => { | |||
206 | 206 | ||
207 | await myAccountPage.goOnAssociatedPlaylistEmbed() | 207 | await myAccountPage.goOnAssociatedPlaylistEmbed() |
208 | 208 | ||
209 | await playerPage.waitUntilPlayerWrapper() | ||
210 | |||
209 | await browser.executeScript(`window.localStorage.setItem('access_token', '${accessToken}');`) | 211 | await browser.executeScript(`window.localStorage.setItem('access_token', '${accessToken}');`) |
210 | await browser.executeScript(`window.localStorage.setItem('refresh_token', '${refreshToken}');`) | 212 | await browser.executeScript(`window.localStorage.setItem('refresh_token', '${refreshToken}');`) |
211 | await browser.executeScript(`window.localStorage.setItem('token_type', 'Bearer');`) | 213 | await browser.executeScript(`window.localStorage.setItem('token_type', 'Bearer');`) |
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index c5cb54ddd..75f4bdfe6 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | 1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' |
2 | import { concat } from 'rxjs' | 2 | import { concat } from 'rxjs' |
3 | import { filter, first, map, pairwise, tap } from 'rxjs/operators' | 3 | import { filter, first, map, pairwise } from 'rxjs/operators' |
4 | import { DOCUMENT, PlatformLocation, ViewportScroller } from '@angular/common' | 4 | import { DOCUMENT, PlatformLocation, ViewportScroller } from '@angular/common' |
5 | import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core' | 5 | import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core' |
6 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | 6 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' |