Skip to content

feat(cli): add command to list installed browsers #35240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

niba
Copy link

@niba niba commented Mar 17, 2025

Add a new CLI command to list all browser installations managed by Playwright. Fixes #34183

This command shows browsers installed by the current Playwright instance
npx playwright list

image

To list browsers installed by all Playwright instances, use the --all flag:

npx playwright list --all

image

@niba
Copy link
Author

niba commented Mar 17, 2025

@microsoft-github-policy-service agree

@niba niba force-pushed the feat/list_command branch from 203f77c to 3c0f06e Compare March 17, 2025 18:39
@niba niba force-pushed the feat/list_command branch from 3c0f06e to 7f73578 Compare March 17, 2025 18:40

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [webkit-library] › tests/library/screenshot.spec.ts:44:14 › page screenshot › should work with a mobile viewport @webkit-ubuntu-22.04-node18

3 flaky ⚠️ [firefox-page] › tests/page/page-evaluate.spec.ts:403:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/screenshot.spec.ts:55:14 › page screenshot › should work with a mobile viewport and clip @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › tests/ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

38784 passed, 808 skipped
✔️✔️✔️

Merge workflow run.

@dgozman dgozman changed the title feat(cli): add command to list installed browsers (#34183) feat(cli): add command to list installed browsers Mar 20, 2025
Copy link
Contributor

@dgozman dgozman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I left some higher-level comments for now.

@dgozman
Copy link
Contributor

dgozman commented Apr 10, 2025

@niba Do you plan to finish this one? We've discussed this again with the team, and think that this should be a single command npx playwright install --list that will list browsers from all playwright installations, and highlight the current one similar to how you do it.

@niba
Copy link
Author

niba commented Apr 10, 2025

@dgozman I've been waiting for clarification about the CLI API. I'll finish it over the weekend. Thanks!

@niba niba force-pushed the feat/list_command branch from 521db69 to 89f9f22 Compare April 13, 2025 12:37

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

2 flaky ⚠️ [firefox-page] › page/page-evaluate.spec.ts:424:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

39133 passed, 806 skipped
✔️✔️✔️

Merge workflow run.

@niba
Copy link
Author

niba commented Apr 13, 2025

I refactored the code and implemented the logic as a ⁠--list option. I decided to remove some unnecessary new lines from the output because it can be a bit bloated if you have many instances on your computer. This is how it looks:

image

Copy link
Contributor

Test results for "tests 1"

3 flaky ⚠️ [firefox-page] › page/page-evaluate.spec.ts:424:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-network-response.spec.ts:321:3 › should return body for prefetch script @firefox-ubuntu-22.04-node18
⚠️ [webkit-library] › library/screenshot.spec.ts:44:14 › page screenshot › should work with a mobile viewport @webkit-ubuntu-22.04-node18

39029 passed, 921 skipped
✔️✔️✔️

Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: list installed browsers
3 participants