Skip to content

Commit

Permalink
Update actions.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadahmad21 committed Oct 14, 2024
1 parent 7ac3fe7 commit 70fe3ac
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tools/e2e-utils/src/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Locator, Page } from '@playwright/test';
import { type PageUtils, expect } from '@wordpress/e2e-test-utils-playwright';
import type { PageUtils } from '@wordpress/e2e-test-utils-playwright';

export class Actions {
protected page: Page;
Expand Down Expand Up @@ -64,15 +64,12 @@ export class Actions {
name: 'Notifications',
});

const notificationShown = notifications
.locator('li[role="status"]', {
has: this.page.locator(`div[data-status="${status}"]`),
})
.last();
const notificationShown = notifications.locator('li[role="status"]', {
has: this.page.locator(`div[data-status="${status}"]`),
hasText: message,
});

await notificationShown.waitFor();

expect(await notificationShown.textContent()).toContain(message);
}

/**
Expand Down

0 comments on commit 70fe3ac

Please sign in to comment.