Slide 1

Slide 1 text

Stop Repeating Yourself Automate your E2E testing with Playwright -Niroj Sitikhu

Slide 2

Slide 2 text

Overview • Basics of Software Testing • Types of Software Testing • Testing Levels • E2E Testing and Tools • Introduction to Playwright • WHY Playwright? • Advantages & Limitations of Playwright • Demo

Slide 3

Slide 3 text

Software Testing Basics The process of evaluating a software application to detect and fix defects. Ensures the software meets user requirements and works as expected. Why is Software Testing Important? • Quality Assurance: Ensures high-quality software. • User Satisfaction: Provides a seamless user experience. • Error Detection: Identifies bugs early to reduce costs. • Security: Protects against vulnerabilities and data breaches.

Slide 4

Slide 4 text

Types of Software Testing 1. Manual Testing • Tests performed by humans, focus on exploratory and usability testing. • Flexible and allows human intuition. Great for exploratory and ad-hoc testing. • Time-consuming and prone to human error. Difficult to scale for repetitive tests. 2. Automated Testing • Uses tools to execute pre-written test scripts. Ideal for repetitive and regression tests. • Fast and reliable for repetitive tasks. Improves test coverage and efficiency. • Requires upfront investment in tools and scripting. Limited in handling exploratory or usability testing.

Slide 5

Slide 5 text

Software testing levels represent stages in the software development process where testing occurs. Each level targets specific application parts, ensuring the system functions as intended at different development stages. 1. Unit Testing 2. Integration Testing 3. System Testing 4. Acceptance Testing Testing Levels

Slide 6

Slide 6 text

Definition: Verifying the functionality of individual components of a software application. Unit Testing Goal: Ensuring each unit performs as expected. Unit Testing Scope: Focuses on the smallest testable parts of an application, such as functions, methods, or classes. Unit Testing

Slide 7

Slide 7 text

Focus: Verifying the interaction and functionality of different modules or components within a system. Scope: Different from unit tests, which test individual components in isolation. Goal: Ensuring that combined modules function correctly when interacting with each other. Integration Testing

Slide 8

Slide 8 text

Definition: System testing evaluates the complete and integrated application to verify it meets specified requirements. Purpose: Ensures the end-to-end functionality of the system as a whole. Timing: Occurs after integration testing. System Testing

Slide 9

Slide 9 text

Goal: Determine if a system meets business requirements and is ready for release. Focus: Validate the overall system against business needs, user expectations, and contractual agreements. Phase: Final phase of testing. Acceptance Testing

Slide 10

Slide 10 text

End-to-End Testing

Slide 11

Slide 11 text

Introduction to E2E Testing • A testing methodology to validate entire workflows from start to finish and essential for ensuring that a web application behaves correctly from a user's perspective. • Simulates real user interactions with the application. • Covers all layers: frontend, backend, database, and external services. Benefits: • Comprehensive Validation • User-Centric Approach • Prevents Integration Breakdowns • Improves User Experience

Slide 12

Slide 12 text

Advantages of E2E Testing • Faster feedback loops • Minimize late-stage rework • Reduces time spent on manual testing • Identifies cross-functional issues early • Supports parallel development • Shortens debugging time • Reduces the risk of technical debt • Supports CI/CD • Protects against regression in long term projects • Increases scalability of the development process

Slide 13

Slide 13 text

E2E Testing Tools

Slide 14

Slide 14 text

Introduction to Playwright Playwright is a powerful framework for automating browser tests of web applications. It’s great for creating and running end-to-end tests for workflows like a happy path. Open-source automation framework for end-to-end testing of modern web applications. Key Features: • Cross-Browser Support • Multi-Language Support • Headless and Headful Modes • Parallel Test Execution • API Testing • Network Interception • Native Mobile Emulation • Trace Viewer

Slide 15

Slide 15 text

WHY Playwright? Feature Playwright Selenium Cypress Language Supports JavaScript, TypeScript, Python, C#, Java Java, Python, JavaScript, Ruby, C#, PHP, etc. JavaScript, TypeScript Browser Supports Excellent (Chrome, Firefox, Safari, Edge) Excellent (All browsers) Limited (Primarily Chromium-based) Built-in Test Runner Yes No No Parallel Execution Built-in Depends on external tools like TestNG Limited API Testing Yes No Yes Network Interception Yes Limited Yes Real Browser Testing Yes Yes Yes Mobile Emulation Yes Limited Yes

Slide 16

Slide 16 text

Advantages of Using Playwright Unified API: With one API, you can test web apps across Chromium, Firefox, and WebKit. Removes the need to configure browser-specific settings Modern Web Compatibility: Supports features like WebSockets, Shadow DOM, iframes, and more Full Isolation: Tests are fully isolated at the browser context level, which prevents cross-test contamination. Faster Test Execution: Optimized to run tests faster, leveraging parallel execution and headless browsers. Improved Debugging: Tools like .pause(), trace viewer, and video recording make identifying issues easier. Open Source with Active Development: Playwright is continuously updated with new features and fixes, ensuring it stays relevant.

Slide 17

Slide 17 text

Challenges and Limitations of Playwright Learning Curve: Its advanced features may require time to master Resource-Intensive: Tests running multiple browser contexts or devices can consume significant memory and CPU resources Limited Ecosystem: Compared to Selenium, Playwright has fewer third-party integrations, though this is growing rapidly

Slide 18

Slide 18 text

Thank You!