docs: add final test summary and update form tests
This commit is contained in:
@@ -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 '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user