fix: update toast message extraction and test expectations
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user