mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	chore: hide docker integration behind the curtain (#17715)
This is not ready for the prime time yet.
This commit is contained in:
		
							parent
							
								
									d009500fa1
								
							
						
					
					
						commit
						d897407833
					
				| @ -146,59 +146,3 @@ The image will be tagged as `playwright:localbuild-focal` and could be run as: | ||||
| docker run --rm -it playwright:localbuild /bin/bash | ||||
| ``` | ||||
| 
 | ||||
| ## (Experimental) Playwright Test Docker Integration | ||||
| * langs: js | ||||
| 
 | ||||
| Playwright Test now ships an **experimental** Docker integration. The Docker container provides a consistent environment, eliminating browser rendering differences across platforms.  | ||||
| With this integration, **only** browser binaries are running inside a Docker container, | ||||
| while all the code is still running on the host operating system. | ||||
| 
 | ||||
| Playwright Test will automatically proxy host network traffic | ||||
| into the container, so browsers can access servers running on the host. | ||||
| 
 | ||||
| :::note | ||||
| Docker integration requires Docker installed & running on your computer. | ||||
| See https://docs.docker.com/get-docker/ | ||||
| 
 | ||||
| If you use [Docker Desktop](https://www.docker.com/products/docker-desktop/), make sure to increase | ||||
| default CPU and memory limit for better performance. | ||||
| ::: | ||||
| 
 | ||||
| Docker integration usage: | ||||
| 
 | ||||
| 1. Build a local Docker image that will be used to run containers. This step | ||||
|    needs to be done only once. | ||||
| 
 | ||||
|     ```bash js | ||||
|     npx playwright docker build | ||||
|     ``` | ||||
| 
 | ||||
| 1. Run Docker container in the background. | ||||
| 
 | ||||
|     ```bash js | ||||
|     npx playwright docker start | ||||
|     ``` | ||||
| 
 | ||||
| 1. Run tests inside Docker container using the `PLAYWRIGHT_DOCKER` environment variable. | ||||
|    You can set this environment variable as a part of your config: | ||||
| 
 | ||||
|     ```ts | ||||
|     // playwright.config.ts | ||||
|     import type { PlaywrightTestConfig } from '@playwright/test'; | ||||
| 
 | ||||
|     process.env.PLAYWRIGHT_DOCKER = '1'; | ||||
| 
 | ||||
|     const config: PlaywrightTestConfig = { | ||||
|       /* ... configuration ... */ | ||||
|     }; | ||||
|     export default config; | ||||
|     ``` | ||||
| 
 | ||||
|    NOTE: Playwright will automatically detect a running Docker container or start it if needed. | ||||
| 
 | ||||
| 1. Finally, stop background Docker container when you're done working with tests: | ||||
| 
 | ||||
|     ```bash js | ||||
|     npx playwright docker stop | ||||
|     ``` | ||||
| 
 | ||||
|  | ||||
| @ -276,7 +276,7 @@ function createStacklessError(message: string) { | ||||
| } | ||||
| 
 | ||||
| export function addDockerCLI(program: Command) { | ||||
|   const dockerCommand = program.command('docker') | ||||
|   const dockerCommand = program.command('docker', { hidden: true }) | ||||
|       .description(`Manage Docker integration (EXPERIMENTAL)`); | ||||
| 
 | ||||
|   dockerCommand.command('build') | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Andrey Lushnikov
						Andrey Lushnikov