chore: improve test stability

This commit is contained in:
DarkSky
2026-07-07 12:26:56 +08:00
parent fe2a4db76b
commit 9f8e5c0eb3
3 changed files with 122 additions and 36 deletions
+5 -3
View File
@@ -18,11 +18,13 @@ export async function expectActiveTab(
export async function expectTabTitle(
page: Page,
index: number,
title: string | string[]
title: string | string[],
timeout?: number
) {
if (typeof title === 'string') {
await expect(page.getByTestId('workbench-tab').nth(index)).toContainText(
title
title,
{ timeout }
);
} else {
for (let i = 0; i < title.length; i++) {
@@ -32,7 +34,7 @@ export async function expectTabTitle(
.nth(index)
.getByTestId('split-view-label')
.nth(i)
).toContainText(title[i]);
).toContainText(title[i], { timeout });
}
}
}