fix: update toast message extraction and test expectations

This commit is contained in:
张翔
2026-03-06 17:55:06 +08:00
parent c8220feea9
commit fdf7bad5eb
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ export class ContactPage extends BasePage {
async getToastMessage(): Promise<{ message: string; type: 'success' | 'error' }> {
const toastElement = await this.page.locator('[data-testid="toast-notification"]');
if (await toastElement.count() > 0) {
const message = await toastElement.textContent() || '';
const messageElement = toastElement.locator('p');
const message = await messageElement.textContent() || '';
const type = await toastElement.getAttribute('data-type') as 'success' | 'error';
return { message, type };
}