Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(e2e): await element array length before comparing

Steven Enamakeld2ff306b6b79
diff --git a/app/test/e2e/helpers/element-helpers.ts b/app/test/e2e/helpers/element-helpers.ts
index 20024a72e9..0b4cc499a1 100644
--- a/app/test/e2e/helpers/element-helpers.ts
+++ b/app/test/e2e/helpers/element-helpers.ts
@@ -405,7 +405,7 @@ export async function waitForTestIdAtIndex(
}
const selector = testIdSelector(testId);
- await browser.waitUntil(async () => (await browser.$$(selector)).length > index, {
+ await browser.waitUntil(async () => (await (await browser.$$(selector)).length) > index, {
timeout,
timeoutMsg: `data-testid="${testId}" index ${index} not found within ${timeout}ms`,
});
@@ -417,7 +417,7 @@ export async function countTestId(testId: string): Promise<number> {
if (!isTauriDriver()) {
throw new Error(`countTestId is only supported on tauri-driver: ${testId}`);
}
- return (await browser.$$(testIdSelector(testId))).length;
+ return await (await browser.$$(testIdSelector(testId))).length;
}
/** Click an indexed repeated test-id control through the shared click path. */