> 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/bitbucket-pipelines-integration.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Bitbucket Pipelines 連携

Autify はお手持ちのBitbucket Pipelines から[Autify CLI](https://help.autify.com/nocode-web/autify-university/integrations/autify-command-line-interface.md) を利用することで簡単にテストプランやシナリオを実行できます。

## はじめてみよう

このドキュメントでは、どのようにBitbucket Pipelines でAutify CLI を利用するかを順に説明していきます。

### 前提条件

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

次に、[Autify NoCode Web](https://app.autify.com) でテストプランかテストシナリオを作成する必要があります。テストシナリオは、そのBitbucket Pipelines でソフトウェアがデプロイされるウェブサイトに対してレコーディングすることになります。テストプランまたはシナリオの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)必要があります。後ほど*Bitbucket Pipelines の変数*に保存するために、生成されたトークンはどこかにメモしておいて下さい。

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

### パーソナルアクセストークンをBitbucket Pipelines の変数に保存

上で生成したパーソナルアクセストークンを[Bitbucket のドキュメント](https://support.atlassian.com/ja/bitbucket-cloud/docs/variables-and-secrets/)に従って保存します。万が一トークンの値がログに曝露しないように、"Secured" を選択しておくことをお勧めします。変数の名前は任意ですが、`AUTIFY_WEB_ACCESS_TOKEN` と命名した場合はそれがAutify CLI が読み込むデフォルトの変数なので、後ほどこの変数を指定する必要がありあせん。ここではそうしたと仮定しておきます。

### Autify NoCode Web を実行するステップを追加

それでは、お手持ちのBitbucket Pipelines に新しいステップを追加しましょう。以下の例を参考にしてください。URL の値 (`https://app.autify.com/projects/00/scenarios/000`) は、上でメモしたURL になります。

パラメータの詳細はAutify CLI のドキュメントも参考にしてください: [Autify Command Line Interface (CLI)](https://help.autify.com/nocode-web/autify-university/integrations/autify-command-line-interface.md)

***

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

```yaml
- step:
      script:
        - curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
        - autify web test run https://app.autify.com/projects/00/scenarios/000
```

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

```yaml
- step:
      script:
        - curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
        - autify web test run https://app.autify.com/projects/00/scenarios/000 --wait --timeout 300
```

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

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

```yaml
- step:
      script:
        - curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
        - autify web test run https://app.autify.com/projects/00/scenarios/000 --url-replacements "https://example.com https://example.net"
```

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

## まとめ

[Autify CLI](https://help.autify.com/nocode-web/autify-university/integrations/autify-command-line-interface.md) をBitbucket Pipelines 中に使うことで、デプロイ後にテストプランやシナリオの実行を自動化できるので、無駄な時間を使うことなくリグレッションをすぐに検知して適切な行動を取ることができるようになります。


---

# 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/bitbucket-pipelines-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.
