Skip to content

Commit

Permalink
docs: add docs about list-browsers command
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovRoman committed Jan 13, 2025
1 parent adc46d1 commit cd5fb1f
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 0 deletions.
69 changes: 69 additions & 0 deletions docs/command-line/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,75 @@ For example, [html-reporter][html-reporter] adds `gui` command.
testplane list-tests --help
```
## `list-browsers` command
Command to get all browsers from the config.
```bash
> npx testplane list-browsers --help
Usage: list-browsers [options]
Lists all browsers from the config
Options:
--type [type] return browsers in specified type ('tags': browserName and browserVersion, 'ids': browserId from config) (default: tags)
--format [format] return browsers in specified format ('json' / 'plain') (default: json)
-h, --help output usage information
```
For example,
```
npx testplane list-browsers --type ids --format plain
```
### Options {#list-browsers-options}
#### Type {#list-browsers-type}
Specify type of output data: browserId from config or browserName with browserVersion.
```bash
testplane list-browsers --type tags
```
#### Format {#list-browsers-format}
Specify format of output data: plain text or json.
```bash
testplane list-browsers --format json
```
#### Example {#list-browsers-example}
If you have the following "browsers" section in your [Testplane config](/docs/v8/config/main):
```json
{
"my-chrome": { "desiredCapabilities": { "browserName": "chrome", "browserVersion": "130.0" } },
"my-safari": { "desiredCapabilities": { "browserName": "safari" } }
}
```
The following commands will provide corresponding result:
| Command | Result |
|:--------------------------------------------------:|:----------------------------------------------------------------------------:|
| `testplane list-browsers --type ids --format plain` | `my-chrome my-safari` |
| `testplane list-browsers --type ids --format json` | `["my-chrome","my-safari"]` |
| `testplane list-browsers --type tags --format plain` | `chrome@130.0 safari` |
| `testplane list-browsers --type tags --format json` | `[{"browserName":"chrome","browserVersion":"130.0"},{"browserName":"safari"}]` |
#### Help {#list-browsers-help}
Prints out information about the command and its options.
```bash
testplane list-browsers --help
```
## `install-deps` command {#install-deps}
This command is a part of the guide [How to launch Testplane in the local browser](/docs/v8/guides/local-browsers).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,76 @@ it("test2", () => {});
testplane list-tests --help
```
## Команда `list-browsers`
Команда для получения всех браузеров из конфигурации.
```bash
> npx testplane list-browsers --help
Usage: list-browsers [options]
Lists all browsers from the config
Options:
--type [type] return browsers in specified type ('tags': browserName and browserVersion, 'ids': browserId from config) (default: tags)
--format [format] return browsers in specified format ('json' / 'plain') (default: json)
-h, --help output usage information
```
Например,
```
npx testplane list-browsers --type ids --format plain
```
### Опции {#list-browsers-options}
#### Type {#list-browsers-type}
Укажите тип выводимых данных: browserId из конфигурации или browserName с browserVersion.
```bash
testplane list-browsers --type tags
```
#### Format {#list-browsers-format}
Укажите формат выводимых данных: обычный текст или json.
```bash
testplane list-browsers --format json
```
#### Пример {#list-browsers-example}
Если у вас имеется следующий раздел "browsers" в вашей конфигурации [Testplane](/docs/v8/config/main):
```json
{
"my-chrome": { "desiredCapabilities": { "browserName": "chrome", "browserVersion": "130.0" } },
"my-safari": { "desiredCapabilities": { "browserName": "safari" } }
}
```
Следующие команды произведут соответствующий результат:
| Команда | Результат |
| :--------------------------------------------------: | :----------------------------------------------------------------------------: |
| `testplane list-browsers --type ids --format plain` | `my-chrome my-safari` |
| `testplane list-browsers --type ids --format json` | `["my-chrome","my-safari"]` |
| `testplane list-browsers --type tags --format plain` | `chrome@130.0 safari` |
| `testplane list-browsers --type tags --format json` | `[{"browserName":"chrome","browserVersion":"130.0"},{"browserName":"safari"}]` |
#### Help {#list-browsers-help}
Выводит информацию команде и ее опциях.
```bash
testplane list-browsers --help
```
## Команда `install-deps` {#install-deps}
Эта команда является частью рецепта [Как запустить Testplane в локальном браузере](/docs/v8/guides/local-browsers).
Expand Down

0 comments on commit cd5fb1f

Please sign in to comment.