playwright
playwright copied to clipboard
[BUG] regex testid is not displayed in the trace file (parameters section)
System info
- Playwright Version: [v1.34]
- Operating System: Mac
- Browser: Chromium
- Other info:
Source code
- [x] I provided exact source code that allows reproducing the issue locally.
Link to the GitHub repository with the repro
[https://github.com/your_profile/playwright_issue_title]
or
Config file
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
use: {
trace: 'on',
video: 'on',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});
Test file (self-contained)
it('should show the testid in trace', async ({ page }) => {
await page.setContent(`<input id='checkbox' type='checkbox' data-testid='test-hello'></input>`);
await expect(page.getByTestId(/test-hello/)).toBeVisible();
});
Steps
- Run the tests using npx playwright test --ui
Expected
Select the assertion step in the trace file and click "Call". Observe the parameter section. locator: getByTestId(/test-hello/) should be displayed
Actual
Select the assertion step in the trace file and click "Call". Observe the parameter section. locator: getByTestId('') is displayed.