As a rule-of-thumb wp-browser should be installed in the root folder of your project.
If your project is a plugin then it should be installed in the root folder of your plugin; if your project is a theme it should be installed in the root folder of your theme.
If your project is a site I'd, personally install it in the site root folder.
The purpose of installing wp-browser in the root folder of a project is to keep the code and its tests under version control together.
Exceptions apply but, for most projects, that's what I would do.
Initializing the Composer project
Since Composer is a requirement of wp-browser and the only way to install it you should, first thing, initialize the Composer project.
If you've already initialized the Composer project you can skip this section.
Once you've decided where to install wp-browser navigate to that folder using the terminal and type:
1
composer init
Copied!
Composer will take you through a number of questions to setup some meta information about your project.
Do not install any dependency yet when asked (unless you know what you're doing) and, as a suggestion, set wordpress-plugin as "Package Type".
Also, since WordPress is licensed under the GPL-2.0+ you might want to set the "License" of your project to GPL-2.0-or-later.