# How Playwright Frameworks get configured with playwright.config.ts

DevFeed: [How Playwright Frameworks get configured with playwright.config.ts](<https://devfeed.tech/articles/how-playwright-frameworks-get-configured-with-playwright-config-ts-22418.md>)

Original publisher: [Read original article](<https://www.tjmaher.com/2026/08/how-playwright-frameworks-get.html>)

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

Published: 2026-08-15T02:30:20Z

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>), [Testing](<https://devfeed.tech/topics/testing.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [browsers](<https://devfeed.tech/topics/browsers.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [browsers](<https://devfeed.tech/tags/browsers.md>), [bun](<https://devfeed.tech/tags/bun.md>), [bun-create-playwright](<https://devfeed.tech/tags/bun-create-playwright.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [config](<https://devfeed.tech/tags/config.md>), [playwright](<https://devfeed.tech/tags/playwright.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This tutorial examines the playwright.config.ts file generated by `bun create playwright`. It explains default test settings, browser projects for Chromium, Firefox, and WebKit, mobile and branded browser configurations, and how retries differ between local runs and CI/CD pipelines.

## Source excerpt

When we installed bun, a new package manager owned by Anthropic, then ran "bun create playwright", a new automation framework was stood up, along with sample tests, and a Playwright configuration file. In this post, we will be examining the file generated: playwright.config.ts. Personally, I find the pre-generated file very hard to scan... there are so many options and documentation in the comments, it is difficult for me to focus on the code. Let's examine just the code generated below. If you need to see the whole file, you can see it here: https://playwright.dev/docs/test-configuration Playwright.dev / Configuration mentions, "Playwright has many options to configure how your tests are run. You can specify these options in the configuration file". What is Configured By Default? import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './tests', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: 'html', // baseURL: 'http://localhost:3000', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', }, /* Configure projects for major browsers */ projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, { name: 'firefox', use: { ...devices['Desktop Firefox'] }, }, { name: 'webkit', use: { ...devices['Desktop Safari'] }, }, }); I know what you are thinking ... What the heck is process.env.CI ? 2 : 0? This is know as a ternary operator. It is a shorthand for: "If A then B, else C". You can run tests two ways: Locally, on your local machine, or through a CI / CD Pipeline like Jenkins, GitHub Actions, or GitLab. If you are running tests on CI / CD, the process.env.CI would automatically get set. Since A is true, the value of retries would be "2". If you are running tests locally, the process.env.CI would NOT get set. Since A is false, the value "0" would be selected. CI /