Skip to content
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

docs: add docs about list-browsers command #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-grep-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` | `[email protected] 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-grep-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` | `[email protected] 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
Loading