test(export): streamline export cleanup and improve test reliability
Remove unnecessary UI reload and modal interactions during audiobook export cleanup to reduce flakiness under load. Set explicit timeout for long-running MP3 export test to ensure consistent execution. These changes enhance test stability and maintainability.
This commit is contained in:
parent
384369f48b
commit
4d12c6913a
1 changed files with 3 additions and 3 deletions
|
|
@ -243,11 +243,9 @@ async function resetAudiobookById(page: Page, bookId: string) {
|
||||||
|
|
||||||
async function resetAudiobookIfPresent(page: Page, bookId?: string) {
|
async function resetAudiobookIfPresent(page: Page, bookId?: string) {
|
||||||
// Prefer backend reset when bookId is available: deterministic and independent of modal timing.
|
// Prefer backend reset when bookId is available: deterministic and independent of modal timing.
|
||||||
|
// Do not block on UI re-open during end-of-test cleanup, which can be flaky under load.
|
||||||
if (bookId) {
|
if (bookId) {
|
||||||
await resetAudiobookById(page, bookId);
|
await resetAudiobookById(page, bookId);
|
||||||
await page.reload();
|
|
||||||
await openExportModal(page);
|
|
||||||
await expect(page.getByRole('button', { name: 'Start Generation' })).toBeVisible({ timeout: 60_000 });
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -273,6 +271,8 @@ async function resetAudiobookIfPresent(page: Page, bookId?: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
test('exports full MP3 audiobook for PDF using mocked 10s TTS sample', async ({ page }, testInfo) => {
|
test('exports full MP3 audiobook for PDF using mocked 10s TTS sample', async ({ page }, testInfo) => {
|
||||||
|
test.setTimeout(60_000);
|
||||||
|
|
||||||
// Ensure TTS is mocked and app is ready
|
// Ensure TTS is mocked and app is ready
|
||||||
await setupTest(page, testInfo);
|
await setupTest(page, testInfo);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue