> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/autify-university/integrations/circleci-integration.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# CircleCI 連携

Autify ではお手持ちのCircleCI workflow から簡単にテストプランやシナリオを実行できる公式のCircleCI Orb を提供しています。

## はじめてみよう

このドキュメントでは、皆さんのGit リポジトリでどのようにAutify のCircleCI 連携を利用するかを順に説明していきます。

### 前提条件

まず、すでにCircleCI workflow を使ってステージングやプロダクション等へのソフトウェアのデプロイを行なっているものとします。そのデプロイjob のすぐ後にAutify のテストを実行するjob を追加することで、新しくデプロイされたソフトウェアがエンドツーエンドのユーザ体験を損ねていないことを確認できるようにします。

次に、[Autify NoCode Web](https://app.autify.com) でテストプランかテストシナリオを作成する必要があります。テストシナリオは、そのCircleCI workflow でソフトウェアがデプロイされるウェブサイトに対してレコーディングすることになります。テストプランまたはシナリオのURL (例: `https://app.autify.com/projects/00/scenarios/000`) をメモしておいてください、後ほど利用します。

さらに、[パーソナルアクセストークンを生成する](https://help.autify.com/nocode-web/autify-university/integrations/integrate-with-api.md#issue-a-personal-access-token)必要があります。後ほどEnvironment Variables (環境変数) に保存するために、生成されたトークンはどこかにメモしておいて下さい。

*注: パーソナルアクセストークンは1人のユーザに紐づいてしまうので、CI/CD 連携のために組織にマシンユーザを作って、そのパーソナルアクセストークンを使うことをお勧めします。*

### パーソナルアクセストークンをEnvironment Variables に保存

上で生成したパーソナルアクセストークンを[CircleCI のドキュメント](https://circleci.com/docs/ja/env-vars)に従って、Environment Variables (環境変数) に保存します。名前は任意ですが、`AUTIFY_WEB_ACCESS_TOKEN` と命名した場合はそれがデフォルトの名前なので後ほどこの名前を指定する必要がありあせん。ここではそうしたと仮定しておきます。

### Autify for Web を実行するCircleCI job を追加

それでは、お手持ちのCircleCI workflow に新しいjob を追加しましょう。以下の例を参考にしてください。`autify-test-url` の値は、上でメモしたURL になります。

パラメータの詳細は CircleCI Orb のページも参考にしてください: <https://circleci.com/developer/orbs/orb/autify/autify-web>

***

シンプルにテストを開始してstep を終了 (テストの完了は待たない):

```yaml
orbs:
  autify-web: autify/autify-web@3
workflows:
  test-run:
    jobs:
      - autify-web/test-run:
          autify-test-url: 'https://app.autify.com/projects/00/scenarios/000'
```

テストを開始して、それが完了するかタイムアウトするまで待つ:

```yaml
orbs:
  autify-web: autify/autify-web@3
workflows:
  test-run:
    jobs:
      - autify-web/test-run:
          autify-test-url: 'https://app.autify.com/projects/00/scenarios/000'
          wait: true
          timeout: 300
```

**警告: この設定はテスト完了を待っている間もCircleCI build の時間を消費します。タイムアウトを延長するときは注意してください。**

`url-replacements` を使ってテストプラン又はシナリオを別のURL に対して開始する:

```yaml
orbs:
  autify-web: autify/autify-web@3
workflows:
  test-run:
    jobs:
      - autify-web/test-run:
          autify-test-url: 'https://app.autify.com/projects/00/scenarios/000'
          url-replacements: http://example.com=http://example.net
```

`url-replacements` はステージングのウェブサイトに対してプロダクションのウェブサイトで記録したテストシナリオを実行したい時などに有効です。

## まとめ

[Autify のCircleCI Orb](https://circleci.com/developer/orbs/orb/autify/autify-web) を使うことで、デプロイ後にテストプランやシナリオの実行を自動化できるので、無駄な時間を使うことなくリグレッションをすぐに検知して適切な行動を取ることができるようになります。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/autify-university/integrations/circleci-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
