fix: check submit button state after form submission
This commit is contained in:
@@ -36,11 +36,13 @@ test.describe('表单验证测试', () => {
|
||||
subject: '测试主题'
|
||||
});
|
||||
|
||||
await contactPage.submitForm();
|
||||
const submitButton = await page.locator('[data-testid="submit-button"]');
|
||||
await submitButton.click();
|
||||
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
const successMessage = await page.locator('text=消息已发送').count();
|
||||
expect(successMessage).toBeGreaterThan(0);
|
||||
|
||||
const buttonDisabled = await submitButton.isDisabled();
|
||||
expect(buttonDisabled).toBe(false);
|
||||
});
|
||||
|
||||
test('联系表单 - 必填字段验证', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user