microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
64.43k stars 3.5k forks source link

[Bug]: Enabling CDPSession via context destroys reporting #31657

Closed jane-will-emp closed 2 weeks ago

jane-will-emp commented 3 weeks ago

Version

v1.45.1

Steps to reproduce

  1. Create a new typescript playwright project
  2. Create a example test case
  3. Add await page.context().newCDPSession(page) to enable a new CDPSession
  4. Run the test with enabled html report and trace viewer etc, the report will be empty

Expected behavior

Show a valid html report

Actual behavior

The report is an empty website or a report with zero tests (depends)

Additional context

I tried to create a test for passkey login, as described here

Environment

System:
    OS: macOS 13.6
    CPU: (10) arm64 Apple M1 Max
    Memory: 1.09 GB / 32.00 GB
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
  IDEs:
    VSCode: 1.91.0 - /opt/homebrew/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.45.1 => 1.45.1 
    playwright: ^1.45.1 => 1.45.1 
    playwright-extensions: ^0.0.1-alpha.7 => 0.0.1-alpha.7 
    playwright-lighthouse: ^2.2.2 => 2.2.2 
    playwright-webkit: ^1.45.1 => 1.45.1
jane-will-emp commented 3 weeks ago

I will create an example as a github repo. Just a minute

jane-will-emp commented 3 weeks ago

Okay it seems not be that easy I need more time to find the actual reason why it isn't working

yury-s commented 3 weeks ago

I cannot reproduce it with this example:

import {expect, test} from '@playwright/test';

test('overlay', async ({page}) => {
    await page.context().newCDPSession(page);
    await page.goto('https://playwright.dev/');
});

Please provide a self-contained reproduction that we could run locally.

yury-s commented 2 weeks ago

Closing per the response above, feel free to open a new issue if it doesn't work and you can provide a good repro.