+ const items: ElementFinder[] = await element.all(by.css('my-video-actions-dropdown .dropdown-menu .dropdown-item'))
+
+ for (const item of items) {
+ const href = await item.getAttribute('href')
+
+ if (href && href.includes('/update/')) {
+ await item.click()
+ return
+ }
+ }
+ }
+
+ async clickOnSave () {
+ return element(by.css('.action-button-save')).click()
+ }
+
+ async createPlaylist (name: string) {
+ await element(by.css('.new-playlist-button')).click()
+
+ await element(by.css('#displayName')).sendKeys(name)
+
+ return element(by.css('.new-playlist-block input[type=submit]')).click()
+ }
+
+ async saveToPlaylist (name: string) {
+ return element.all(by.css('my-video-add-to-playlist .playlist'))
+ .filter(p => p.getText().then(t => t === name))
+ .click()
+ }
+
+ waitUntilVideoName (name: string, maxTime: number) {
+ const elem = this.getVideoNameElement()
+
+ return browser.wait(ExpectedConditions.textToBePresentInElement(elem, name), maxTime)
+ }
+
+ private getVideoNameElement () {
+ // We have 2 video info name block, pick the first that is not empty
+ return element.all(by.css('.video-info-first-row .video-info-name'))
+ .filter(e => e.getText().then(t => !!t))
+ .first()