This commit is contained in:
Daniil
2026-04-07 13:42:23 +03:00
parent d648678c68
commit 46f34bdcac
59 changed files with 2708 additions and 1312 deletions
+10 -10
View File
@@ -5,6 +5,8 @@ const PROJECT_ID = "75df675b-013b-4b1f-ab2d-075dadbcd0d9"
const DETECT_JOB_ID = "00000000-0000-0000-0000-000000000050"
const APPLY_JOB_ID = "00000000-0000-0000-0000-000000000051"
const TRANSCRIPTION_JOB_ID = "00000000-0000-0000-0000-000000000052"
const ORIGINAL_FILE_ID = "00000000-0000-0000-0000-000000000060"
const CUT_FILE_ID = "00000000-0000-0000-0000-000000000061"
const ORIGINAL_FILE_KEY = "projects/test/original-video.mp4"
const ORIGINAL_FILE_URL = "http://localhost:4444/files/original-video.mp4"
const CUT_FILE_KEY = "projects/test/cut-video.mp4"
@@ -52,8 +54,8 @@ test.describe("Silence Apply Flow", () => {
"silence-settings",
"processing",
],
primary_file_id: ORIGINAL_FILE_ID,
primary_file_key: ORIGINAL_FILE_KEY,
video_url: ORIGINAL_FILE_URL,
original_file_name: "original-video.mp4",
silence_settings: {
min_silence_duration_ms: 200,
@@ -133,19 +135,17 @@ test.describe("Silence Apply Flow", () => {
await route.fallback()
})
await page.route("**/api/files/get_file/**", async (route) => {
const url = new URL(route.request().url())
const filePath = url.searchParams.get("file_path")
const fileUrl =
filePath === CUT_FILE_KEY ? CUT_FILE_URL : ORIGINAL_FILE_URL
await page.route("**/api/files/files/*/resolve/", async (route) => {
const fileId = route.request().url().split("/files/")[1]?.split("/")[0]
const isCutFile = fileId === CUT_FILE_ID
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({
file_url: fileUrl,
file_path: filePath,
file_id: isCutFile ? CUT_FILE_ID : ORIGINAL_FILE_ID,
file_url: isCutFile ? CUT_FILE_URL : ORIGINAL_FILE_URL,
file_path: isCutFile ? CUT_FILE_KEY : ORIGINAL_FILE_KEY,
}),
})
})
@@ -181,8 +181,8 @@ test.describe("Silence Apply Flow", () => {
output_data:
applyStatus === "DONE"
? {
file_id: CUT_FILE_ID,
file_path: CUT_FILE_KEY,
file_url: CUT_FILE_URL,
}
: null,
}),