From First Script to Enterprise-Scale Test Frameworks
Introduction
- Who This Book Is For
- How to Use This Book
- A Note on Versions
- Where to Go Next
Chapter 1: The Browser Automation Landscape
- Three Generations of Automation Tools
- The 2026 Testing Ecosystem
- What Modern Web Apps Demand from Automation
- Chapter 1 Summary
- Code Comparison: Playwright vs Selenium WebDriver
Chapter 2: Under the Hood: How Browsers and Playwright Work
- The DOM and the Event Loop
- From WebDriver to CDP
- The Browser Context Isolation Model
- The Life Cycle of a Test: Discovery to Report
- The Performance Numbers Behind the Design
- Chapter 2 Summary
- Demonstrating Browser Context Isolation
Chapter 3: Installation and First Steps
- Installing Playwright
- The Configuration File
- Your First Test and the ShopTest Project
- The Test Runner’s Toolkit
- Environment-Specific Configuration
- Chapter 3 Summary
- Environment-Specific Configuration Walkthrough
- Keeping Playwright and Browsers Up to Date
Chapter 4: Selectors and Locators: Finding What You Need
- The Built-In Locator Toolkit
- CSS, XPath and Shadow DOM
- Chaining, Filtering and Logical Composition
- Locator Anti-Patterns and How to Fix Them
- Strict Mode and the Locator Priority Hierarchy
- Chapter 4 Summary
- Practical Locator Selection Walkthrough
Chapter 5: Page Interactions: Clicking, Typing and Navigating
- Clicking with Confidence
- Typing and Form Automation
- Navigation Control
- Keyboard and Mouse Actions
- Iframes and Embedded Documents
- Touch Actions and File Handling
- When Auto-Waiting Is Not Enough
- Chapter 5 Summary
- Complete Form Submission Walkthrough
Chapter 6: Waits, Synchronization and Timing
- Actionability: The Checks Behind Every Action
- Configuring Timeouts
- Explicit Waits for Specific Conditions
- How Auto-Waiting Actually Works
- Race Conditions and Order Dependencies
- The waitForTimeout Anti-Pattern
- A Decision Framework for Waits
- Chapter 6 Summary
- Auto-Waiting vs Explicit Waits: Practical Comparison
Chapter 7: Assertions and Validation
- The Locator Assertion Catalog
- Text Assertions: Exact, Substring and Nested Content
- Custom Conditions: toPass and expect.poll
- Soft Assertions and When Not to Use Them
- Snapshot Testing with ARIA Snapshots
- Failure Output and Assertion Timeouts
- Chapter 7 Summary
- Complete Product Page Validation Walkthrough
Chapter 8: Test Organization: Fixtures, POM and Architecture
- Custom Fixtures
- Fixture Dependencies and Scopes
- The Page Object Model
- The Service Object Pattern
- Test Data Management and Directory Structure
- Choosing the Right Pattern: A Decision Guide
- Chapter 8 Summary
- Parameterized Testing with External Test Data
Chapter 9: API Testing and Network Interception
- Making Requests with the Request Fixture
- HTTP Methods and Response Objects
- Hybrid Testing: API Setup, Browser Verification
- Network Interception with page.route()
- Authentication via Interception
- Simulating Adverse Network Conditions
- Route Precedence, Lifecycle and Advanced Patterns
- Chapter 9 Summary
- Complete Hybrid API and Browser Testing Walkthrough
Chapter 10: Parallel Execution, Cross-Browser and Mobile Testing
- Mobile-First Debugging Techniques
- Real-Device vs. Emulator Trade-offs
- Common Mobile Flakiness Patterns and Fixes
- Chapter 10 Summary
- Complete Parallel Execution Configuration Walkthrough
Chapter 11: Debugging, Performance and Security
- The Trace Viewer
- Interactive Debugging: UI Mode, Inspector and Agents
- Failure Artifacts: Screenshots and Videos
- Performance Optimization Strategies
- Diagnosing Common Failure Signatures
- Chapter 11 Summary
- Debugging Workflow: From Failure to Fix
Chapter 12: CI/CD Integration: Shipping Playwright in Production
- GitHub Actions: The Complete Workflow
- Browser Binary Caching Strategies
- Runner Sizing and Cost Optimization
- GitLab CI: Equivalent Configuration
- Jenkins Pipeline: Equivalent Configuration
- Migration Path Between Platforms
- Chapter 12 Summary
- CI Platform Comparison: Same Logic, Different Syntax
- Summary of CI/CD Best Practices
Chapter 13: The ShopTest Project: From First Script to Enterprise Framework
- Chapter 3: The First Test
- Chapter 4: Locators: Finding What You Need
- Chapter 5: Interactions: Clicking, Typing and Navigating
- Chapter 7: Assertions: Validating Behavior
- Chapter 8: Test Organization: POM and Fixtures
- Chapter 9: API Testing and Network Interception
- Chapter 10: Parallel Execution, Cross-Browser and Mobile Testing
- Chapter 12: CI/CD Integration: Shipping in Production
- The Complete ShopTest Suite
- What Comes Next
Conclusion: Building Automation That Lasts
- What Makes Automation Succeed or Fail
- The Path Forward