> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quiesco.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# テストランナー

> Vitest（推奨）、Jest、Cucumber：実行全体で1つのセッション、各テストの前にリセット、失敗時には証跡。

Quiescoはテストランナーからアプリを操作します。3つのランナーに専用のインテグレーションがあり、どれも同じように動作します。実行全体で1つのセッション（デバイスとアプリ）を使い、各テストの前にリセットし、別のプラットフォームやブラウザー向けのタグが付いたテストはスキップし（`@ios`、`@android`、`@web`、`@native`、`@chromium`、`@firefox`、`@webkit`。最も内側の階層が優先されます）、失敗時のメッセージには証跡ファイル（スクリーンショット、要素ツリー、アイドル状態、ログ）が列挙されます。

| ランナー | パッケージ | テスト | アプリ |
| - | - | - | - |
| **Vitest**（推奨） | `@quiesco/vitest` | TypeScript、`test(…)` | `app`フィクスチャー |
| Jest | `@quiesco/jest` | JavaScript、`test(…)` | グローバルの`quiesco.app` |
| Cucumber | `@quiesco/cucumber` | Gherkinのfeatureとステップ定義 | ステップ内の`this.app` |

## ランナーを選ぶ

`quiesco init`はどのランナーを使うかを尋ね（Vitestが選択済み。CIでは尋ねずにVitestを使います）、そのランナーのパッケージ、設定、最初のテストだけをインストールします。質問なしで選ぶには次のようにします。

```sh pnpm theme={null}
# または jest、cucumber
pnpm dlx quiesco init --runner vitest
```

```sh npm theme={null}
# または jest、cucumber
npx quiesco init --runner vitest
```

```sh bun theme={null}
# または jest、cucumber
bunx quiesco init --runner vitest
```

```sh yarn theme={null}
# または jest、cucumber
yarn dlx quiesco init --runner vitest
```

その後の`quiesco test`、`quiesco ui`、`quiesco list`は、Quiescoのパッケージがインストールされているランナーを使うので、`--runner`は不要です。複数インストールされている場合（または1つもない場合）は、Quiesco 0.6以前と同じくCucumberを使います。別のランナーを使うには`--runner`で指定します。

## 設定方法

ランナーごとの設定方法は、それぞれのページにあります。

> [card] [Vitest](https://docs.quiesco.dev/ja/vitest.md)
>
> vitest.config.mts、quiesco()のオプションとappフィクスチャー

> [card] [Jest](https://docs.quiesco.dev/ja/jest.md)
>
> プリセット、jest.config.cjsとグローバルのquiesco

> [card] [Cucumber](https://docs.quiesco.dev/ja/cucumber.md)
>
> cucumber.mjs、registerQuiesco()のオプションとWorld

## 実行

`npx quiesco test --platform ios`でテストを実行するか（インストール済みのもの以外を使うときは`--runner vitest|jest|cucumber`）、[`quiesco ui`](./ui)を使ってブラウザから実行します。3つすべてのサンプルが[examples/todo-app](https://github.com/h2nology/quiesco/tree/main/examples/todo-app)にあります。詳しくは[Vitest、Jestとその他のランナー](https://docs.quiesco.dev/ja/api-custom-runners.md)を、複数のデバイスで同時に実行する方法は[並列実行](https://docs.quiesco.dev/ja/parallel.md)を参照してください。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.