Fixed timeout test
This commit is contained in:
parent
c4332247cb
commit
7dae7d12aa
|
|
@ -543,11 +543,12 @@ test('should respect expect.timeout', async ({ runInlineTest }) => {
|
||||||
'playwright.config.js': `module.exports = { expect: { timeout: 1000 } }`,
|
'playwright.config.js': `module.exports = { expect: { timeout: 1000 } }`,
|
||||||
'a.test.ts': `
|
'a.test.ts': `
|
||||||
import { test, expect } from '@playwright/test';
|
import { test, expect } from '@playwright/test';
|
||||||
|
import { stripVTControlCharacters } from 'node:util';
|
||||||
|
|
||||||
test('timeout', async ({ page }) => {
|
test('timeout', async ({ page }) => {
|
||||||
await page.goto('data:text/html,<div>A</div>');
|
await page.goto('data:text/html,<div>A</div>');
|
||||||
const error = await expect(page).toHaveURL('data:text/html,<div>B</div>').catch(e => e);
|
const error = await expect(page).toHaveURL('data:text/html,<div>B</div>').catch(e => e);
|
||||||
expect(error.message).toContain('expect.toHaveURL with timeout 1000ms');
|
expect(stripVTControlCharacters(error.message)).toContain('Timed out 1000ms waiting for expect(page).toHaveURL(expected)');
|
||||||
expect(error.message).toContain('data:text/html,<div>');
|
expect(error.message).toContain('data:text/html,<div>');
|
||||||
});
|
});
|
||||||
`,
|
`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue