Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stop Repeating Yourself | Gurzu | Niroj

Gurzu
February 11, 2025

Stop Repeating Yourself | Gurzu | Niroj

Stop wasting time on repetitive testing! In this session, we’ll explore how Playwright can streamline your end-to-end (E2E) testing process by automating browser interactions efficiently. Learn how to write reliable, scalable tests and reduce manual effort while improving software quality.

Gurzu

February 11, 2025
Tweet

More Decks by Gurzu

Other Decks in Technology

Transcript

  1. 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
  2. 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.
  3. 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.
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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.
  14. 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