-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
Description
Version
v1.56.0
Steps to reproduce
- Create a test file:
import { test, expect } from '@playwright/test';
test(
'example test with invalid annotation',
{ tag: ['@TEST-123'] },
{
tag: ['@TEST-123'],
annotation: 'bug', // should be { type: 'bug' }
description: 'https://example.com/issues/12345',
},
async ({ page }) => {
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example/);
}
);- Run the test with HTML reporter:
npx playwright test --reporter=html- Open the generated HTML report:
npx playwright show-report- Check console:
Uncaught TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at filter.ts:207
Expected behavior
The HTML report should always open - it should never crash at such a late in the browser regardless of what annotation data is provided
The type system should not promise type: string if the runtime doesn't enforce it
Actual behavior
- HTML report is generated;
- User opens the HTML report in a browser;
- React app loads and tries to filter/search tests;
- The getSearchValues() function is called to build search indices;
- It crashes on a.type.toLowerCase() when type is undefined/null.
Additional context
No response
Environment
System:
OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (8) arm64
Binaries:
Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
npmPackages:
@playwright/test: 1.56.0 => 1.56.0