fix: check navigation behavior after form submission
This commit is contained in:
@@ -35,9 +35,13 @@ test.describe('表单验证测试', () => {
|
||||
message: formData.valid.message,
|
||||
subject: '测试主题'
|
||||
});
|
||||
|
||||
const submitPromise = page.waitForNavigation();
|
||||
await contactPage.submitForm();
|
||||
await submitPromise;
|
||||
|
||||
await expect(page.locator('[data-testid="success-message"]')).toBeVisible();
|
||||
const currentUrl = page.url();
|
||||
expect(currentUrl).toContain('/contact');
|
||||
});
|
||||
|
||||
test('联系表单 - 必填字段验证', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user