Skip to content

[Bug]: setting sources: false in trace config does not prevent source recording #32745

Closed

Description

@ibrocodes7

Version

1.46.0

Steps to reproduce

  1. Set up Playwright configuration in TypeScript with the following trace options:
{
    trace: 'on',
    sources: false,
    attachments: false,
    screenshots: true,
    snapshots: true
}
  1. Run a Playwright test with this configuration.
  2. Open the generated trace output after the test run.
  3. Check if source files are being recorded.

Expected behavior

No source files should be recorded in the trace when sources: false is specified in the configuration.
All other options (attachments: false, screenshots: true, snapshots: true) should work as expected.

Actual behavior

Source files are still being recorded despite setting sources: false.
Other options (attachments, screenshots, snapshots) behave as expected and follow the configuration properly.

Additional context

No response

Environment

System:
    OS: macOS 14.6.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.18 GB / 16.00 GB
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
    pnpm: 7.6.0 - ~/thoughtspot/node_modules/.bin/pnpm
  IDEs:
    VSCode: 1.93.1 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: 1.46.0 => 1.46.0

Activity

  1. mxschmitt commented on Sep 23, 2024

    @mxschmitt
    Contributor

    While I was able to reproduce the behaviour, it seems to work as expected:

    • When having sources: false we don't include them in the trace - but we will try to open the local file directly if its available. If you run the Trace Viewer locally, the files are available and we show them.
    • When having sources: true we include a copy of the source file into the trace.zip

    So when you try to open the trace.zip on https://trace.playwright.dev it won't show any sources if you set sources: false.

  2. mxschmitt commented on Sep 23, 2024

    @mxschmitt
    Contributor

    Closing as per above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions