Configuration File Adjustments | Bondar Academy
Course: Playwright UI Testing with TypeScript
Module: Advanced Tricks and Techniques
Instructor: Artem Bondar
Lesson Summary
This lesson focuses on the Playwright configuration file , detailing its structure and configuration options. The key points discussed include: Cleaning Up the Configuration File A good practice when working with PlayWriteConfig.ts is to remove irrelevant settings. The instructor demonstrates this by: Deleting default annotations that do not pertain to the project. Keeping only essential settings, such as retries and trace on first retry . Setting a default base URL and configuring timeouts. Understanding Configuration Structure The configuration file is divided into two main sections: Global Section : Contains settings applicable to all projects. Project Section : Allows for project-specific overrides of global settings. For example, you can set a different timeout for a specific project, like Chromium, while maintaining a global timeout. Project Organization Projects are not limited to browsers; they can represent different environments or test subsets. For instance: Create a project for page object tests with specific configurations. Available Configuration Options Refer to the Playwright documentation for detailed options, including: Reporter , Retries , Web Server , and Global Setup . Custom configuration files can be created for specific needs, such as production testing. Running Custom Configurations To run a custom configuration file, use the command: npx playwright-test-config= In summary, the Playwright configuration file is crucial for managing test settings, with options for global and project-specific configurations. Custom files can be created for specialized testing scenarios.