Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✅ test: fix e2e issue (#11761)

Arvin Xu42339cd6d062
diff --git a/e2e/src/steps/home/sidebarAgent.steps.ts b/e2e/src/steps/home/sidebarAgent.steps.ts
index 644fc76746f..84096641053 100644
--- a/e2e/src/steps/home/sidebarAgent.steps.ts
+++ b/e2e/src/steps/home/sidebarAgent.steps.ts
@@ -361,8 +361,10 @@ Then('Agent 应该从列表中移除', async function (this: CustomWorld) {
await this.page.waitForTimeout(500);
- if (this.testContext.targetItemId) {
- const deletedItem = this.page.locator(`a[aria-label="${this.testContext.targetItemId}"]`);
+ // Use unique selector based on agent ID (href) to avoid false positives
+ // when multiple agents have the same name
+ if (this.testContext.targetItemSelector) {
+ const deletedItem = this.page.locator(this.testContext.targetItemSelector);
await expect(deletedItem).not.toBeVisible({ timeout: 5000 });
}