# Scaffold and Run Playwright Tests with Bun

DevFeed: [Scaffold and Run Playwright Tests with Bun](<https://devfeed.tech/articles/what-happens-when-you-scaffold-a-playwright-framework-and-run-installed-tests-using-bun-22425.md>)

Original publisher: [Read original article](<https://www.tjmaher.com/2026/08/what-happens-when-you-create-playwright.html>)

Author: T.J. Maher (noreply@blogger.com)

Published: 2026-08-06T17:37:06Z

Content type: tutorial

Language: en

Sources: [T.J. Maher](<https://devfeed.tech/sources/t-j-maher.md>)

Topics: [Playwright](<https://devfeed.tech/topics/playwright.md>), [Bun](<https://devfeed.tech/topics/bun.md>), [Node.js](<https://devfeed.tech/topics/node-js.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Windows](<https://devfeed.tech/topics/windows.md>)

Tags: [bun](<https://devfeed.tech/tags/bun.md>), [bun-create-playwright](<https://devfeed.tech/tags/bun-create-playwright.md>), [playwright](<https://devfeed.tech/tags/playwright.md>), [test](<https://devfeed.tech/tags/test.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [windows](<https://devfeed.tech/tags/windows.md>)

## AI overview

A tutorial on creating a TypeScript Playwright project with Bun, installing its browsers on Windows, configuring a Bun lockfile and test script, and running the included tests. It notes that Playwright's test runner remains a Node.js program and documents an additional Bun and Playwright installation step for a Windows bug.

## Source excerpt

We covered in the last blog post how to install bun, a new package manager. In this blog post, we will look into using bun to install a new Playwright framework. Create the Playwright Framework Once I installed bun on my Windows PC and was up and running I created a new folder, "bun-create-playwright". I opened up that folder in VS Code, along with a new PowerShell terminal. In that terminal I entered: bun create playwright This activated the interactive Playwright installer that Playwright comes with. I selected I wanted it to create for me a TypeScript project, placing the tests in the default folder, tests, but I decided not to add a GitHub Actions workflow. I wanted to experiment with using GitLab. I chose it to set up and install all the browsers for me... which it did... using NPX, part of Node. Wait a second, when it comes to our Playwright framework, doesn't bun replace node? No. Bun might be a JavaScript runtime, a package manager, and a bundler shipped as a single software tool, but in our case we are simply using it as a package manager in our Playwright framework. Bun works alongside Node.js in the Playwright project. We still use Playwright's test runner, a Node.js program. Bun handles installations and run tasks. Alert: Windows Bug! Initially, that wasn't enough to install Playwright's internal browsers. There is a bug with bun + Playwright Windows where we also need to: bun add --dev @playwright/test bunx playwright install That was enough for the browsers to install. Create the Bun Lock File After the browsers are installed, we need to install bun in our project, to create from the package.json a bun installation. Run in the Terminal: bun install Review the newly created file bun.lock.file in the root directory of the project. Delete the package-lock.json file. Add the test script to the Package.json If you look in the package.json file, you can see that the scripts code block is currently empty. "scripts": {} Inside this code block, we will be addin