Playwright + JS · Lesson 15 of 35
Module 15: Installation & Setup
Try it yourself
Implement buildLaunchSettings:
The editor has a worked example. Read it, tweak it, then press Mark as complete.
npm init playwright@latest
# Choose: JavaScriptplaywright.config.js// playwright.config.js
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests",
fullyParallel: true,
reporter: "html",
use: {
baseURL: "https://targetqa.com",
trace: "on-first-retry",
},
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
],
});Setting up Playwright with JavaScript takes less than two minutes. In this lesson, we will install Playwright, configure playwright.config.js, and learn how to run tests in headed, headless, and interactive UI modes. Let's get started!
Part of the Playwright + JS course (Playwright with JavaScript). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
Headless mode is significantly faster and uses less memory, making it ideal for continuous integration and rapid local test execution.
Finished reading?
Review the worked example in the editor, then mark the lesson complete.