]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/e2e/src/po/my-account.po.ts
Fix local E2E tests
[github/Chocobozzz/PeerTube.git] / client / e2e / src / po / my-account.po.ts
index 20dafbf0616eccb06ce1b3b58fd7b6471ea4a13c..8d5d878cef067bfddd0d59cc77616bd9a22b6f89 100644 (file)
@@ -54,10 +54,17 @@ export class MyAccountPage {
 
     await container.$('.dropdown-toggle').click()
 
-    const dropdownMenu = () => container.$$('.dropdown-menu .dropdown-item')[1]
+    const deleteItem = () => {
+      return $$('.dropdown-menu .dropdown-item').find<WebdriverIO.Element>(async v => {
+        const text = await v.getText()
 
-    await dropdownMenu().waitForDisplayed()
-    return dropdownMenu().click()
+        return text.includes('Delete')
+      })
+    }
+
+    await (await deleteItem()).waitForClickable()
+
+    return (await deleteItem()).click()
   }
 
   validRemove () {