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
63.88k stars 3.46k forks source link

[Bug]: `create-playwright` adds duplicate .gitignore entries #31021

Open karlhorky opened 1 month ago

karlhorky commented 1 month ago

Version

1.44.1

Steps to reproduce

  1. Ensure that your .gitignore contains the following
    /test-results/
    /playwright-report/
    /blob-report/
    /playwright/.cache/
  2. Run pnpm create playwright
  3. Observe duplicate entries for /test-results/, /playwright-report/, /blob-report/, /playwright/.cache/

Expected behavior

create-playwright doesn't add duplicate entries to .gitignore

Actual behavior

create-playwright adds duplicate entries to .gitignore

Additional context

No response

Environment

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1
    Memory: 83.81 MB / 16.00 GB
  Binaries:
    Node: 20.13.1 - /opt/homebrew/bin/node
    npm: 10.5.2 - /opt/homebrew/bin/npm
    pnpm: 9.1.2 - /opt/homebrew/bin/pnpm
    bun: 1.1.4 - /opt/homebrew/bin/bun
  IDEs:
    VSCode: 1.89.1 - /opt/homebrew/bin/code
  Languages:
    Bash: 5.2.0 - /opt/homebrew/bin/bash
  npmPackages:
    @playwright/test: ^1.44.1 => 1.44.1
muhamedalahmed commented 1 month ago

To remove any duplicate lines in your .gitignore file: sort .gitignore | uniq > .gitignore.tmp mv .gitignore.tmp .gitignore

DerTimonius commented 1 month ago

Opened a PR that fixes this issue: https://github.com/microsoft/create-playwright/pull/122