Table of Contents
- Forward
-
Preface
- What is unique about this book?
- Who should read this book?
- How to read this book?
- Send me feedback
-
1: What is Web Test Automation?
- 1.1: Test automation benefits
- 1.2: Reality check
- 1.3: Reasons for test automation failures
- 1.4: Successful web test automation
- 1.5: Why Playwright framework?
- 1.6: Why pytest and Python language?
- 1.7: Learning approach
- 1.8: Next action
-
2: Test Execution Environment Setup
- 2.1: Install Python with pyenv (recommended)
- 2.2: Install Playwright and pytest
- 2.3: Alternative Python setup: system wide
- 2.4: Alternative Python setup: with venv
- 2.5: Review
-
3: First Automated Test
- 3.1: Test Design
- 3.2: Installing TestWise (under 1 minute)
- 3.3: Create Automated Test
- 3.4: Create a test case
-
4: How Automated Testing works
- 4.1: Web test automation rhythm
- 4.2: Test syntax frameworks
- 4.3: pytest execution hooks
- 4.4: Run pytest tests from the command line
- 4.5: Review
-
5: Test Tool
- 5.1: TestWise: Next-Gen Functional Testing IDE
- 5.2: Visual Studio Code Programming Editor
- 5.3: PyCharm Development IDE
- 5.4: Review
-
6: Playwright Syntax in Nutshell
- 6.1: Browser, Context, and Page
- 6.2: Playwright locators
- 6.3: get_by_role()
- 6.4: get_by_label()
- 6.5: get_by_placeholder()
- 6.6: get_by_text()
- 6.7: get_by_test_id()
- 6.8: locator() with CSS/XPath
- 6.9: Page-level convenience methods
- 6.10: Locator chaining
- 6.11: Multiple matching elements
- 6.12: Playwright vs Selenium WebDriver
- 6.13: Review
-
7: Gain Productivity
- 7.1: Playwright CodeGen
- 7.2: Playwright Trace Viewer
- 7.3: Some Generic IDE Features
- 7.4: Keyboard shortcuts
- 7.5: More TestWise productivity features
- 7.6: Review
-
8: Case Study
- 8.1: Test site
- 8.2: Preparation
- 8.3: Create a test project
- 8.4: Test Suite: Sign in
- 8.5: Test Suite: Select Flights
- 8.6: Enter passenger details
- 8.7: Book confirmation after payment
- 8.8: Run all tests
- 8.9: Review
-
9: Maintainable Functional Test Design
- 9.1: Record/Playback leads to unmaintainable test scripts
- 9.2: Success criteria
- 9.3: Maintainable automated test design
- 9.4: Maintain with ease
- 9.5: Case Study: refine test scripts
-
10: Test Automation Characteristics
- 10.1: Specific
- 10.2: Clean
- 10.3: Independent
- 10.4: Frequent
- 10.5: Focused
- 10.6: Programmable
- 10.7: Creative
- 10.8: Sustainable
- 10.9: Review
-
11: Functional Test Refactoring
- 11.1: Code refactoring
- 11.2: Functional test refactoring
- 11.3: Tool support
- 11.4: Case study
- 11.5: Summary
- 11.6: Review
-
12: Set up Continuous Execution
- 12.1: Conventional Playwright test execution in CI/CD is suboptimal
- 12.2: BuildWise CT server setup
- 12.3: Sequential Execution
- 12.4: Parallel execution
- 12.5: Review
-
13: Preparing for Real-World Test Automation
- 13.1: Syntax errors
- 13.2: Beyond syntax errors
- 13.3: Set up source control
- 13.4: Test Data
- 13.5: Choose Robust Locators
- 13.6: Stabilize Tests
- 13.7: Test script maintenance is the primary effort
- 13.8: Custom libraries
- 13.9: Debugging
- 13.10: What is the best learning method?
- 13.11: Review
-
14: Team Collaboration
- 14.1: Pre-requisite
- 14.2: Developer-Tester Collaboration Scenario 1: “It worked on my machine”
- 14.3: Developer-Tester Collaboration Scenario 2: Programmers help QA engineers with technical challenges
- 14.4: Developer-Tester Collaboration Scenario 3: Acceptance Test-Driven Development
- 14.5: Business Analysts find E2E test automation useful too
- 14.6: Review
-
15: Clarifications
- 15.1: Real E2E Test Automation is far more challenging than coding
- 15.2: Neither possible or necessary to achieve 100% coverage
- 15.3: Gherkin BDD Framework
- 15.4: Headless testing
- 15.5: Codeless/Scriptless Test Automation
- 15.6: AI/Agentic Test Automation
- 15.7: Cross-browser functional testing
- 15.8: Data-Driven Test
- 15.9: Review
-
16: Adopting End-to-End Test Automation
- 16.1: Seek executive sponsorship
- 16.2: Choose a test framework
- 16.3: Select a test tool
- 16.4: Run as part of the CI/CD pipeline
- 16.5: Find a mentor
- 16.6: Manage expectations
- 16.7: Solo test automation
- 16.8: Common mistakes
- 16.9: Review
- 17: AI Won’t Replace Real Human E2E Test Automation
- Afterword
-
Appendix 1: Functional Test Refactoring Catalog
- Extract Function
- Move Test Scripts
- Extract to Page Class
- Introduce Page Object
- Rename
-
Appendix 2: Case Study: Test Automation in WhenWise App Development
- Build Stats
- Questions and Answers
-
Resources
- Books
- Tools
- Blog
- References