diff --git a/tests/playwright-test/expect.spec.ts b/tests/playwright-test/expect.spec.ts index 08ce16e7ec..c35cdd7c09 100644 --- a/tests/playwright-test/expect.spec.ts +++ b/tests/playwright-test/expect.spec.ts @@ -616,6 +616,33 @@ test('should print pending operations for toHaveText', async ({ runInlineTest }) expect(output).toContain('waiting for locator(\'no-such-thing\')'); }); +test('should only highlight unmatched regex in diff message for toHaveText with array', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + + test('toHaveText with mixed strings and regexes (array)', async ({ page }) => { + await page.setContent(\` +