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.05k stars 3.47k forks source link

[Bug]: UI Mode and Trace Files missing recorded data but contain action history #31505

Open itz4blitz opened 2 weeks ago

itz4blitz commented 2 weeks ago

Version

1.45.0

Steps to reproduce

  1. Run any test which will fail (headless or headed)
  2. Open the trace file or if in UI mode check the top of the UI
  3. The browser window is missing from the trace/UI mode. The actions menu still contains all of the actions. If we click an action, we see nothing in the browser.

image

image

Expected behavior

When I run a test, once it fails, I expect to see the browsers and when I click on an action, I expect to see that replayed in the browser.

Actual behavior

My browser is empty in UI mode and the top menu which shows the timeline is empty. The same issue exists in the trace file.

Additional context

I tried deleting and reinstalling node_modules

Environment

Mac OS M3 Apple Silicon
Latest Playwright
Node.js 21.7.2
Yarn package manager
mxschmitt commented 2 weeks ago

We need something which we can run locally - are you able to provide us a zip or a small Git repository which surfaces the problem?

itz4blitz commented 2 weeks ago

Archive.zip

My apologies, I meant to include this. Here you are. This is my repo minus node_modules. I assume you can create the .env file with a BASE_URL and run it. However it will fail during setup since you won't have our API running locally to complete global setup - so I'm not 100% sure if you will find this useful.

I did create a new project and didn't run into this issue, so it seems this issue could be isolated to my project since updating to the latest version.

itz4blitz commented 2 weeks ago

html-reporter.zip

Here's one of the generated trace files. I modified an assertion to cause this test to fail and as you can see in the report, there's no data outside of the actions.

mxschmitt commented 2 weeks ago

Have you tried disabling video and only enabling tracing?

    video: 'on',
    contextOptions: {
      recordVideo: {
        dir: 'test-results/videos/'
      }
    }
itz4blitz commented 2 weeks ago

Have you tried disabling video and only enabling tracing?

    video: 'on',
    contextOptions: {
      recordVideo: {
        dir: 'test-results/videos/'
      }
    }

I will test this and report back. Thanks for the suggestion.

mxschmitt commented 1 week ago

This might be fixed in our Canary builds, could you try them? https://playwright.dev/docs/canary-releases

itz4blitz commented 1 week ago

Have you tried disabling video and only enabling tracing?

    video: 'on',
    contextOptions: {
      recordVideo: {
        dir: 'test-results/videos/'
      }
    }

I will test this and report back. Thanks for the suggestion.

Sorry for the delay, I had vacation last week and forgot to report back on this before leaving. I did try this and it didn't resolve my issue.

This might be fixed in our Canary builds, could you try them? https://playwright.dev/docs/canary-releases

This seems to have fixed it :) Thank you for the suggestion. Should I stay on Canary or switch back once it is fully released?

dgozman commented 1 day ago

@itz4blitz Could you please try the @beta version as well? We would like to release a patch version that fixes this issue, but would love for you to verify it fixes your problem. Once we release it, you can switch to the release version instead of a canary version.

npm install -D @playwright/test@beta
npx playwright install
npx playwrigh test