mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-11-13 17:08:20 +00:00
feat: add select format to download button
This commit is contained in:
+10
-1
@@ -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 }> {
|
||||
|
||||
Reference in New Issue
Block a user