fix: remove navigation wait for AJAX form submission

This commit is contained in:
张翔
2026-03-06 18:42:45 +08:00
parent 767fa32c26
commit ccdef53776
+3 -4
View File
@@ -36,12 +36,11 @@ test.describe('表单验证测试', () => {
subject: '测试主题' subject: '测试主题'
}); });
const submitPromise = page.waitForNavigation();
await contactPage.submitForm(); await contactPage.submitForm();
await submitPromise; await page.waitForTimeout(3000);
const currentUrl = page.url(); const formExists = await page.locator('form').count();
expect(currentUrl).toContain('/contact'); expect(formExists).toBeGreaterThan(0);
}); });
test('联系表单 - 必填字段验证', async ({ page }) => { test('联系表单 - 必填字段验证', async ({ page }) => {