Configuration File Adjustments | Bondar Academy
Course: Playwright UI Testing with TypeScript
Module: Advanced Tricks and Techniques
Instructor: Artem Bondar
Lesson Summary
This lesson covers the details of the Playwright configuration file , focusing on its organization and the various options available for configuration. Cleaning Up the Configuration File The initial step involves cleaning up the config.ts file by removing unnecessary commented sections and unused configurations: Remove default test directory setting. Keep fully parallel setting. Set retries to one for all tests. Remove undefined workers and unnecessary reporters. Understanding the Structure The configuration file consists of two main sections: Global Configuration Project Configuration Each section has a main and a use block, allowing for different settings at the project level. For instance, you can set a different timeout for the Chromium project compared to the global setting. Configurable Options Key options available in the configuration include: Fully parallel Reporters Retries Test directory Test ignore and test match for specific test executions. Advanced Configuration Advanced options include: Global setup Output directory Timeout Viewport size Headless mode configuration. Multiple Configuration Files You can create multiple configuration files for different environments, such as playwright-prod.config.ts . To run tests with a specific config file, use: npx playwright-test --config=playwright-prod.config.ts This flexibility allows for tailored configurations based on project needs.