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

# Run automated tests from Test Management

> Pick test cases in Test Management and start a GitHub Actions run of only the automated Playwright tests linked to them.

**Run automation** starts a GitHub Actions run of only the automated Playwright tests linked to the test cases you pick. You choose the test cases, a branch, and a workflow. The results arrive as a new test run in [Test Runs](https://docs.testdino.com/platform/playwright-test-runs), like any other test run from CI.

> [!NOTE]
>
> Before you start, you need:
>
> * The **Pro**, **Team**, or **Enterprise** plan, and the Owner, Admin, or Member role.
> * GitHub connected to the project. See [GitHub App](https://docs.testdino.com/integrations/ci-cd/github.md).
> * Test cases linked to automated tests. See [Linked Automation Tests](https://docs.testdino.com/test-management/test-cases/list-view.md#linked-automation-tests).
> * `@testdino/playwright` 2.11.1 or later and Playwright 1.56 or later in your project.
> * A workflow set up once, as shown below.

## Set up your workflow

Add a `testdino_selection` input to the GitHub Actions workflow that runs your Playwright tests, and pass it to `npx tdpw test`. Keep your existing triggers, setup, and install steps; the example shows only the lines to add.

```yaml .github/workflows/playwright.yml theme={null}
on:
  workflow_dispatch:
    inputs:
      testdino_selection: { required: false } # set by TestDino's Run automation
jobs:
  test:
    steps:
      - uses: actions/checkout@v4
      - name: Run tests
        env:
          TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
          TD_SELECTION: ${{ inputs.testdino_selection }}
        shell: bash
        run: |
          args=()
          if [ -n "$TD_SELECTION" ]; then
            args+=(--selection "$TD_SELECTION")
          fi
          npx tdpw test "${args[@]}"
```

* On a normal push the input is empty, so your whole suite runs as before.
* Pass the input through `env:`, as in the example.
* Add the workflow to every branch you want to run from TestDino.
* Don't ignore the test command's result: no `|| true`, `|| echo`, `continue-on-error`, `| tee` without `pipefail`, or `set +e`. Otherwise the CI job shows green even when tests fail or nothing ran.
* If the same workflow also has the [re-run inputs](https://docs.testdino.com/guides/debug-playwright-failures/configure-reruns-github-actions.md), set `testdino_rerun_from` to `required: false`.
* Sharded workflows work. See [sharded runs](https://docs.testdino.com/cli/testdino-playwright-nodejs.md#sharded-runs) to report the shards as 1 test run.

## Start a run

**1. Open Run automation**

Click **Run automation** in 1 of 3 places. Each decides which test cases are ticked when the dialog opens.

| Where | Ticked when it opens |
| :- | :- |
| Test Cases page, next to **+ New** | Nothing. Use **Select all** to run every linked test case. |
| Test Cases selection bar, after you select test cases | The selected test cases that are linked |
| The header of an open run (closed runs have no button) | The run's linked test cases that read `Not run in automation` |

If nothing is linked yet, the button looks muted and tells you what to do when you click it.

**2. Pick test cases**

Tick the test cases to run. Only linked test cases can be ticked; others show `No linked automated test`. Use the suite checkboxes, **Select all**, **Clear**, and search to build the list, then click **Next**. A run takes up to 1,000 test cases. To change them later, click **Back** or the step names at the top.

From a run, the chips **Not run in automation**, **Failed**, and **All automated** filter the list by each test case's CI result in that run.

**3. Choose a branch and workflow**

* **Branch**: the branch to run. From a run with a release branch, it starts on that branch; otherwise on the repository's default branch. Search the list or type a name.
* **Workflow**: the workflows on that branch that are set up for TestDino. **Show why** explains the others and what to change.
* **When a selected test is missing**: **Skip missing tests** (the default) or **Fail the CI job**. See [Tests missing on the branch](#tests-missing-on-the-branch).

If some selected tests may not be on the branch, a `N may not run · View details` badge appears. Click it to see which ones and why. Those test cases are tagged `Test not found` or `Not found last run`; hover the tag for the reason. You can still run.

If the workflow ignores the test command's result, a **Your workflow may hide test failures** box appears. Click **View fix** to see the file, the job, and the line to remove.

The button shows how many tests will run, such as `Run 12 selected tests`. A test that runs in 3 browsers counts 3 times.

**4. Run**

Click the **Run** button. The dialog shows **Run started**. Click **View in GitHub** to open the workflow run, or **Done** to close the dialog.

If GitHub is not connected yet, the dialog shows **Connect GitHub** instead of the branch and workflow. Connect it in the new tab, then click **Check again**. Your picks stay in the dialog.

## See the results

The results arrive as a new test run in [Test Runs](https://docs.testdino.com/platform/playwright-test-runs) when the GitHub run finishes. It shows who started it, such as `Manual · <name>`.

When you started from a run, the run page also shows the progress:

| The run page shows | Meaning |
| :- | :- |
| `Automated run started` | CI is running. On a run that reads the latest CI results, it clears once the results arrive. |
| `Nothing ran on <branch>.` and a reason | CI ran nothing, for example because none of the selected tests are on that branch. |
| `No results yet from the automated run started` | No results after 2 hours on a run that reads the latest CI results. Click **Check GitHub**. |

If the run reads a specific CI run, the new results don't appear in it, and the message stays until you dismiss it. Click **Show latest results** to switch the run to the latest CI results. See [Pull automated results from CI](https://docs.testdino.com/test-management/manual-testing/manual-runs.md#pull-automated-results-from-ci).

To retry only the tests that failed, open the new test run and click **Re-run**, then **This commit**. See [Re-run failed tests](https://docs.testdino.com/guides/debug-playwright-failures/rerun-failed-tests.md).

## Tests missing on the branch

Before running, CI checks which selected tests exist on the branch. A test renamed, moved, or deleted on that branch is not found.

| Situation | **Skip missing tests** | **Fail the CI job** |
| :- | :- | :- |
| Some tests are missing | Runs the rest. The CI job passes or fails based on those tests. | Runs the rest, then fails the CI job |
| No selected test is found | Fails the CI job and runs nothing | Same |
| The check itself cannot run | Runs the selection unchecked, with a warning in the CI log | Fails the CI job and runs nothing |

The new test run shows a badge next to its title, such as `2 tests not found`. Hover it to see why, or click it to see the missing tests and the test cases that link them. A renamed or moved test needs to be linked again from its test case.

## Troubleshooting

> **None of your workflows on \<branch> can run selected tests yet.**
>
> No active workflow on the chosen branch has the `testdino_selection` input. Click **Show why** under **Workflow** for the reason, then [set up your workflow](#set-up-your-workflow) on that branch.

> **TestDino isn't allowed to start workflows**
>
> The TestDino GitHub App needs **Actions** write permission. Ask an admin of your GitHub organization to approve it. See [GitHub App](https://docs.testdino.com/integrations/ci-cd/github.md).

> **GitHub has no branch named \<branch>.**
>
> **Run** stays disabled when the branch is not on GitHub. Pick an existing branch, or push the branch first.

> **None of the N selected tests were found, so nothing ran**
>
> None of the selected tests exist on the branch you ran: they were renamed, moved, or deleted there, or your Playwright arguments filter them out. Pick a branch that has the tests, or link the test cases again to the renamed tests.

> **The CI job is green, but tests were missing or nothing ran**
>
> Your workflow ignores the exit code of `npx tdpw test`, for example with `|| true`, `|| echo`, or `continue-on-error`. Remove it so a failed check fails the CI job. The TestDino CLI log still lists the missing tests. Step 2 warns about this with **Your workflow may hide test failures**.

> **error: unknown option '--selection'**
>
> The branch uses `@testdino/playwright` older than 2.11.1. Upgrade it on that branch.

> **--selection needs Playwright 1.56 or newer**
>
> Upgrade `@playwright/test` to 1.56 or later on that branch.

> **Selection \<id> is unknown or belongs to another project than this token's.**
>
> The workflow's `TESTDINO_TOKEN` is from a different TestDino project, or the selection id is wrong. Start the run from TestDino, and use an API key from the project you started it in. See [Generate API keys](https://docs.testdino.com/guides/generate-api-keys.md).

> **This run may already have started**
>
> TestDino could not confirm the start with GitHub. Check the Actions tab in your repository before starting again, so the same tests do not run twice.

## Related

> **[Link automated tests](https://docs.testdino.com/test-management/test-cases/list-view.md#linked-automation-tests)**
>
> Connect a test case to the automated test that covers it.

> **[Runs](https://docs.testdino.com/test-management/manual-testing/manual-runs.md)**
>
> Track manual and automated test cases in 1 run.

> **[Node.js CLI](https://docs.testdino.com/cli/testdino-playwright-nodejs.md)**
>
> Every `npx tdpw test` flag, including `--selection`.

> **[Re-run failed tests](https://docs.testdino.com/guides/debug-playwright-failures/rerun-failed-tests.md)**
>
> Run only the failed or flaky test cases from a finished test run.


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