Skip to main content
TestingTube

Playwright Fixtures Explained: Built-in Fixtures (page, request & more)

QA Thoughts

85 views5 Jul 2026

YouTube

Ever wondered what `{ page }` or `{ request }` actually are in your Playwright tests? πŸ€” And why don't we ever have to write code to open a browser, create a page, or close it at the end of a test? In this video, we break down Playwright Fixtures! We explain how Playwright uses fixtures as "ready-made helpers" to automate the setup and teardown of your tests. We also do a side-by-side comparison of writing a test WITH fixtures versus writing one WITHOUT fixtures (where you have to manually launch Chromium and manage contexts). πŸ’‘ What you will learn in this video: β€’ What a fixture actually is (and why they are called "fixtures") β€’ Code Walkthrough: Playwright tests WITH vs. WITHOUT fixtures β€’ Why fixtures beat beforeEach & afterEach hooks for test isolation β€’ The "Toolbox" analogy: How to pull only the tools you need β€’ How to use multiple fixtures in a single test β€’ Preview of Custom Fixtures (using test.extend & test.use) for the next video! πŸ› οΈ The 5 Built-in Playwright Fixtures Covered: β€’ page βž” Represents a browser tab (for UI testing) β€’ browser βž” Represents the entire browser instance β€’ context βž” Represents a browser session (cookies, storage, etc.) β€’ request βž” Used for making API calls (for API testing) β€’ browserName βž” Tells you which browser is running (Chromium, Firefox, WebKit) If you want to write cleaner, more maintainable test automation scripts, understanding fixtures is key. Timestamps: 00:00 What are those arguments in our test functions? 01:02 What is a Fixture? (The automatic helper) 01:38 Why don't we write page.open() or page.close()? 02:34 Test Isolation: How fixtures keep tests independent 02:52 The 5 Built-in Fixtures explained 04:51 Writing a Playwright test WITHOUT fixtures (The manual way) 06:18 Why not just use beforeEach & afterEach hooks? 07:45 The Toolbox Analogy: Destructuring your fixtures 08:33 Examples of using browser, context, and browserName fixtures 09:50 The request fixture for API Testing 10:22 Using multiple fixtures in a single test 11:45 What's next? Sneak peek at Custom Fixtures If you found this tutorial helpful, please give it a like and subscribe for more Playwright content! #Playwright #TestAutomation #SoftwareTesting #PlaywrightTutorial #QAAutomation #WebTesting #BuiltInFixtures

Join the discussion

Sign in to join the discussion

Sign in