feat: add select format to download button

This commit is contained in:
2026-10-04 23:43:06 +05:00
parent 864f9cdc9f
commit e87bc1d715
13 changed files with 379 additions and 27 deletions
+10 -1
View File
@@ -117,7 +117,8 @@ export async function uploadViaDrop(
}
export async function downloadResultFile(page: Page): Promise<Download> {
const button = page.getByRole("button", { name: "Download result" });
// Split-кнопка: основная часть "Download" (image) или "Download ZIP" (files).
const button = page.getByRole("button", { name: /^Download( ZIP)?$/ });
await expect(button).toBeVisible();
const [download] = await Promise.all([
page.waitForEvent("download"),
@@ -126,6 +127,14 @@ export async function downloadResultFile(page: Page): Promise<Download> {
return download;
}
export async function chooseDownloadFormat(
page: Page,
format: string,
): Promise<void> {
await page.getByRole("button", { name: "Choose download format" }).click();
await page.getByRole("menuitemradio", { name: format, exact: true }).click();
}
export async function downloadResultBytes(
page: Page,
): Promise<{ name: string; bytes: Uint8Array }> {