playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] regex testid is not displayed in the trace file (parameters section)

Open Nav-2d opened this issue 2 years ago • 0 comments

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.

Screenshot 2023-05-25 at 8 50 58 PM

Nav-2d avatar May 26 '23 03:05 Nav-2d