Set up Playwright in an existing repository. Use when you need to detect the package manager (npm, pnpm, yarn, bun), look up current Playwright install instructions, and install Playwright with a reproducible workflow.
npm, pnpm, yarn, or bun.playwrite (typo) or playwright.full: include Playwright package and browser binaries.package-only: add package only, no browser install yet.packageManager is missing, stop and ask the user to choose.--repo) instead of the workspace root.bash ./.github/skills/setup-playwright/scripts/setup-playwright.sh --repo ./first --mode full --smokebash ./.github/skills/setup-playwright/scripts/setup-playwright.sh --repo ./playwright-course/Starter --mode package-onlypackage.json in that path.package.json is missing, stop and ask for the correct repo path.package.json field packageManager.pnpm-lock.yaml => pnpmyarn.lock => yarnbun.lock or bun.lockb => bunpackage-lock.json or npm-shrinkwrap.json => npmnpm and explicitly state this assumption.npm init playwright@latestpnpm create playwrightyarn create playwrightbun create playwrightnpm:
npm install -D @playwright/testnpx playwright installpnpm:
pnpm add -D @playwright/testpnpm exec playwright installyarn:
yarn add -D @playwright/testyarn playwright installbun:
bun add -d @playwright/testbunx playwright installpackage-only mode, skip browser installation.playwright.config.* does not exist, run:
npx playwright test --init (or package-manager equivalent via exec)@playwright/test exists in devDependencies.playwright --version with the detected package manager.playwright test --list.packageManager from package.json.@playwright/test present in devDependencies.package-only).<manager><command 1><command 2><path><result>Add first end-to-end test or Integrate into CI