docs: add final test summary and update form tests

This commit is contained in:
张翔
2026-03-06 13:17:40 +08:00
parent 8cfc16e142
commit f15830b0a6
8 changed files with 581 additions and 513 deletions
+6 -2
View File
@@ -23,12 +23,16 @@ export class ContactPage extends BasePage {
}
async getFormErrorMessage(): Promise<string> {
const errorElement = await this.page.locator('[data-testid="name-input"]').locator('..').locator('p.text-red-500').first();
const errorElement = await this.page.locator('p.mt-1.text-sm.text-\\[\\#C41E3A\\]').first();
return await errorElement.textContent() || '';
}
async getFormSuccessMessage(): Promise<string> {
await this.page.waitForTimeout(1000);
const successElement = await this.page.locator('text=消息已发送').first();
return await successElement.textContent() || '';
if (await successElement.count() > 0) {
return await successElement.textContent() || '';
}
return '';
}
}