+ goOnP2PMediaLoaderEmbed () {
+ return go(FIXTURE_URLS.HLS_EMBED)
+ }
+
+ goOnP2PMediaLoaderPlaylistEmbed () {
+ return go(FIXTURE_URLS.HLS_PLAYLIST_EMBED)
+ }
+
+ async clickOnUpdate () {
+ await this.clickOnMoreDropdownIcon()
+
+ const items = await $$('.dropdown-menu.show .dropdown-item')
+
+ for (const item of items) {
+ const href = await item.getAttribute('href')
+
+ if (href?.includes('/update/')) {
+ await item.click()
+ return
+ }
+ }
+ }
+
+ clickOnSave () {
+ return $('.action-button-save').click()
+ }
+
+ async createPlaylist (name: string) {
+ const newPlaylistButton = () => $('.new-playlist-button')
+
+ await newPlaylistButton().waitForClickable()
+ await newPlaylistButton().click()
+
+ const displayName = () => $('#displayName')
+
+ await displayName().waitForDisplayed()
+ await displayName().setValue(name)
+
+ return $('.new-playlist-block input[type=submit]').click()
+ }
+
+ async saveToPlaylist (name: string) {
+ const playlist = () => $('my-video-add-to-playlist').$(`.playlist=${name}`)
+
+ await playlist().waitForDisplayed()
+
+ return playlist().click()
+ }
+
+ waitUntilVideoName (name: string, maxTime: number) {
+ return browser.waitUntil(async () => {
+ return (await this.getVideoName()) === name
+ }, { timeout: maxTime })
+ }
+
+ async clickOnMoreDropdownIcon () {
+ const dropdown = $('my-video-actions-dropdown .action-button')
+ await dropdown.click()
+
+ await $('.dropdown-menu.show .dropdown-item').waitForDisplayed()
+ }
+
+ private async getVideoNameElement () {
+ // We have 2 video info name block, pick the first that is not empty
+ const elem = async () => {
+ const elems = await $$('.video-info-first-row .video-info-name').filter(e => e.isDisplayed())
+
+ return elems[0]
+ }
+
+ await browser.waitUntil(async () => {
+ const e = await elem()
+
+ return e?.isDisplayed()
+ })
+
+ return elem()