From e69cb173ba63d0e556d4af6cbaf18b11f16af3a9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Jun 2019 08:11:25 +0200 Subject: Add more e2e tests --- client/e2e/src/po/my-account.ts | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 client/e2e/src/po/my-account.ts (limited to 'client/e2e/src/po/my-account.ts') 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 @@ +import { by, element } from 'protractor' + +export class MyAccountPage { + + navigateToMyVideos () { + return element(by.css('a[href="/my-account/videos"]')).click() + } + + navigateToMyPlaylists () { + return element(by.css('a[href="/my-account/video-playlists"]')).click() + } + + navigateToMyHistory () { + return element(by.css('a[href="/my-account/history/videos"]')).click() + } + + // My account Videos + + getLastVideoName () { + return this.getAllVideoNameElements().first().getText() + } + + removeLastVideo () { + return this.getLastVideoElement().element(by.css('my-delete-button')).click() + } + + validRemove () { + return element(by.css('.action-button-submit')).click() + } + + countVideos () { + return this.getAllVideoNameElements().count() + } + + // My account playlists + + getLastUpdatedPlaylistName () { + return this.getLastUpdatedPlaylist().element(by.css('.miniature-name')).getText() + } + + getLastUpdatedPlaylistVideosText () { + return this.getLastUpdatedPlaylist().element(by.css('.miniature-playlist-info-overlay')).getText() + } + + clickOnLastUpdatedPlaylist () { + return this.getLastUpdatedPlaylist().element(by.css('.miniature-thumbnail')).click() + } + + countTotalPlaylistElements () { + return element.all(by.css('my-video-playlist-element-miniature')).count() + } + + playPlaylist () { + return element(by.css('.playlist-info .miniature-thumbnail')).click() + } + + // My account Videos + + private getLastVideoElement () { + return element.all(by.css('.video')).first() + } + + private getAllVideoNameElements () { + return element.all(by.css('.video-miniature-name')) + } + + // My account playlists + + private getLastUpdatedPlaylist () { + return element.all(by.css('my-video-playlist-miniature')).first() + } +} -- cgit v1.2.3