diff options
author | Chocobozzz <me@florianbigard.com> | 2019-06-17 08:11:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-06-17 08:16:09 +0200 |
commit | e69cb173ba63d0e556d4af6cbaf18b11f16af3a9 (patch) | |
tree | d75c666b2a66f667db1e9dce7f9f606a6b30cfcb /client/e2e/src/po/my-account.ts | |
parent | 6b226c32782ea7779ced56c1e1090d8b51c5c504 (diff) | |
download | PeerTube-e69cb173ba63d0e556d4af6cbaf18b11f16af3a9.tar.gz PeerTube-e69cb173ba63d0e556d4af6cbaf18b11f16af3a9.tar.zst PeerTube-e69cb173ba63d0e556d4af6cbaf18b11f16af3a9.zip |
Add more e2e tests
Diffstat (limited to 'client/e2e/src/po/my-account.ts')
-rw-r--r-- | client/e2e/src/po/my-account.ts | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/client/e2e/src/po/my-account.ts b/client/e2e/src/po/my-account.ts new file mode 100644 index 000000000..e49372983 --- /dev/null +++ b/client/e2e/src/po/my-account.ts | |||
@@ -0,0 +1,72 @@ | |||
1 | import { by, element } from 'protractor' | ||
2 | |||
3 | export class MyAccountPage { | ||
4 | |||
5 | navigateToMyVideos () { | ||
6 | return element(by.css('a[href="/my-account/videos"]')).click() | ||
7 | } | ||
8 | |||
9 | navigateToMyPlaylists () { | ||
10 | return element(by.css('a[href="/my-account/video-playlists"]')).click() | ||
11 | } | ||
12 | |||
13 | navigateToMyHistory () { | ||
14 | return element(by.css('a[href="/my-account/history/videos"]')).click() | ||
15 | } | ||
16 | |||
17 | // My account Videos | ||
18 | |||
19 | getLastVideoName () { | ||
20 | return this.getAllVideoNameElements().first().getText() | ||
21 | } | ||
22 | |||
23 | removeLastVideo () { | ||
24 | return this.getLastVideoElement().element(by.css('my-delete-button')).click() | ||
25 | } | ||
26 | |||
27 | validRemove () { | ||
28 | return element(by.css('.action-button-submit')).click() | ||
29 | } | ||
30 | |||
31 | countVideos () { | ||
32 | return this.getAllVideoNameElements().count() | ||
33 | } | ||
34 | |||
35 | // My account playlists | ||
36 | |||
37 | getLastUpdatedPlaylistName () { | ||
38 | return this.getLastUpdatedPlaylist().element(by.css('.miniature-name')).getText() | ||
39 | } | ||
40 | |||
41 | getLastUpdatedPlaylistVideosText () { | ||
42 | return this.getLastUpdatedPlaylist().element(by.css('.miniature-playlist-info-overlay')).getText() | ||
43 | } | ||
44 | |||
45 | clickOnLastUpdatedPlaylist () { | ||
46 | return this.getLastUpdatedPlaylist().element(by.css('.miniature-thumbnail')).click() | ||
47 | } | ||
48 | |||
49 | countTotalPlaylistElements () { | ||
50 | return element.all(by.css('my-video-playlist-element-miniature')).count() | ||
51 | } | ||
52 | |||
53 | playPlaylist () { | ||
54 | return element(by.css('.playlist-info .miniature-thumbnail')).click() | ||
55 | } | ||
56 | |||
57 | // My account Videos | ||
58 | |||
59 | private getLastVideoElement () { | ||
60 | return element.all(by.css('.video')).first() | ||
61 | } | ||
62 | |||
63 | private getAllVideoNameElements () { | ||
64 | return element.all(by.css('.video-miniature-name')) | ||
65 | } | ||
66 | |||
67 | // My account playlists | ||
68 | |||
69 | private getLastUpdatedPlaylist () { | ||
70 | return element.all(by.css('my-video-playlist-miniature')).first() | ||
71 | } | ||
72 | } | ||