> ## 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.

# Playwright Reporting with TeamCity

> Upload Playwright results from TeamCity using the TestDino Recipe.

This guide walks through the complete setup of the TestDino TeamCity Recipe, including installation methods, configuration options, examples, and troubleshooting.

## Quick Reference

The TestDino TeamCity Recipe uploads Playwright results after each build. This table shows what artifacts each option includes.

| Upload Option                                 | What It Includes           |
| :-------------------------------------------- | :------------------------- |
| JSON only                                     | Test results, no artifacts |
| [Image Attachments](#configuration-reference) | Screenshots                |
| [Video Attachments](#configuration-reference) | Video recordings           |
| [Trace Files](#configuration-reference)       | Playwright traces          |
| [Full JSON Bundle](#configuration-reference)  | Everything                 |

## Prerequisites

* A <a href="https://app.testdino.com" target="_blank" rel="noopener noreferrer">TestDino account <Icon icon="arrow-up-right-from-square" size={12} /></a> with a project created
* A TestDino API key ([Generate API Keys](/guides/generate-api-keys))
* A TeamCity project with Playwright tests
* Playwright configured with JSON and HTML reporters in `playwright.config.js`:

```javascript playwright.config.js theme={null}
// ...existing config

reporter: [
  ['html', { outputDir: './playwright-report' }],  // Optional
  ['json', { outputFile: './playwright-report/report.json' }],  // ✅ Required
]
```

<Tip>
  **Tip**

  Want to get started quickly? Clone the [TestDino Example Repository](https://github.com/testdino-hq/TestDino-Example). It includes sample tests and ready-to-use CI configs.
</Tip>

## Installation Methods

<Tabs>
  <Tab title="Install from Administration (Global)">
    This installs the plugin for all projects in your TeamCity instance.

    1. Go to **TeamCity Administration**
    2. Open **Plugins**
    3. Click **Browse Plugins ([JetBrains Marketplace](https://plugins.jetbrains.com/plugin/29272-testdino--upload-playwright-report))**
    4. Search for **"TestDino"**
    5. Click **Install**
    6. Restart TeamCity if prompted

    Best for administrators who want the recipe available across all projects.
  </Tab>

  <Tab title="Install While Adding a Build Step (Quick)">
    This installs the recipe when you need it.

    1. Open your project's **Build Configuration**
    2. Go to **Build Steps**
    3. Click **Add Build Step**
    4. Under *Runner Type*, click **Browse Marketplace**
    5. Search for **"TestDino – Upload Playwright Report"**
    6. Click **Download & Install**
    7. The recipe appears immediately in the Runner dropdown

    Best for developers who want to get started fast.
  </Tab>
</Tabs>

## Adding the Build Step

<Steps>
  <Step title="Open Build Steps">
    1. Go to your TeamCity **Build Configuration**
    2. Click **Build Steps**
    3. Click **Add build step**

    <img src="https://tdstorageus.blob.core.windows.net/public/docs/installation-and-setup/ci-setup/playwright-teamcity/adding-build-step.webp" alt="Adding a build step in TeamCity" />
  </Step>

  <Step title="Select the Runner">
    From the **Runner Type** dropdown, select **TestDino - Upload Playwright Report**.

    The recipe configuration form appears.

    <img src="https://tdstorageus.blob.core.windows.net/public/docs/installation-and-setup/ci-setup/playwright-teamcity/select-runner.webp" alt="Select TestDino runner in TeamCity" />
  </Step>

  <Step title="Configure and Save">
    Fill in the fields based on your setup (see Configuration Reference below), then click **Save**.
  </Step>
</Steps>

## Configuration Reference

<img src="https://tdstorageus.blob.core.windows.net/public/docs/installation-and-setup/ci-setup/playwright-teamcity/configuration-reference.webp" alt="TeamCity configuration reference for TestDino" />

| Field                       | Description                                                                                       | Default               | When to Use                                                     |
| --------------------------- | ------------------------------------------------------------------------------------------------- | --------------------- | --------------------------------------------------------------- |
| **Report Directory**        | Folder containing your Playwright reports (JSON + HTML + artifacts)                               | `./playwright-report` | Change this if your reports live somewhere else                 |
| **TestDino API Token**      | Your project API key for authentication. Can also be set as `TESTDINO_TOKEN` environment variable | Required              | Always needed for secure uploads                                |
| **HTML Reports**            | Include the interactive HTML report                                                               | Checkbox              | Turn on when you want the full Playwright report UI in TestDino |
| **Image Attachments**       | Include screenshots captured during test runs                                                     | Checkbox              | Helpful for visual debugging and failure analysis               |
| **Video Attachments**       | Include video recordings of test executions                                                       | Checkbox              | Great for debugging flaky tests or complex UI flows             |
| **Trace Files**             | Include Playwright trace archives                                                                 | Checkbox              | Use when you need step-by-step debugging with the trace viewer  |
| **File Attachments**        | Include extra files like `.md`, `.pdf`, `.log`, or `.txt`                                         | Checkbox              | Useful if your tests generate logs or documentation             |
| **Full JSON Bundle**        | Upload everything: JSON + HTML + images + videos + traces + files                                 | Checkbox              | Best option for complete analytics in TestDino                  |
| **Custom JSON Report Path** | Override the default JSON file location                                                           | Empty                 | Set this if your JSON report has a non-standard path            |
| **Custom HTML Report Path** | Override the default HTML report folder                                                           | Empty                 | Set this if your HTML output is in a custom folder              |
| **Custom Trace Directory**  | Override the default trace folder                                                                 | Empty                 | Set this if traces are stored separately                        |
| **Verbose Logging**         | Show detailed debug output in build logs                                                          | Checkbox              | Turn on when troubleshooting upload issues                      |

## Configuration Examples

<Tabs>
  <Tab title="Basic Setup (JSON Only)">
    Upload only the JSON report for quick analytics:

    | Field              | Value                 |
    | :----------------- | :-------------------- |
    | Report Directory   | `./playwright-report` |
    | TestDino API Token | `your-api-key`        |
    | All checkboxes     | Unchecked             |
  </Tab>

  <Tab title="Full Analytics Setup">
    Upload everything for complete debugging capabilities:

    | Field              | Value                 |
    | :----------------- | :-------------------- |
    | Report Directory   | `./playwright-report` |
    | TestDino API Token | `your-api-key`        |
    | Full JSON Bundle   | Checked               |
  </Tab>

  <Tab title="Custom Paths Setup">
    When your reports use non-standard locations:

    | Field                   | Value                               |
    | :---------------------- | :---------------------------------- |
    | Report Directory        | `./test-output`                     |
    | TestDino API Token      | `your-api-key`                      |
    | Custom JSON Report Path | `./test-output/results/report.json` |
    | Custom HTML Report Path | `./test-output/html-report`         |
    | Custom Trace Directory  | `./test-output/traces`              |
    | HTML Reports            | Checked                             |
    | Trace Files             | Checked                             |
  </Tab>

  <Tab title="Screenshots and Videos Only">
    When you want visual artifacts without traces:

    | Field              | Value                 |
    | :----------------- | :-------------------- |
    | Report Directory   | `./playwright-report` |
    | TestDino API Token | `your-api-key`        |
    | HTML Reports       | Checked               |
    | Image Attachments  | Checked               |
    | Video Attachments  | Checked               |
  </Tab>
</Tabs>

## Using Environment Variables

Instead of entering your API token directly in the build step, use an environment variable for better security.

<Steps>
  <Step title="Setting the Token">
    1. Go to your TeamCity **Build Configuration**
    2. Click **Parameters**
    3. Add a new parameter:
       * **Name**: `env.TESTDINO_TOKEN`
       * **Value**: Your API key
       * **Type**: Password

    The recipe automatically reads `TESTDINO_TOKEN` from the environment. This keeps your key out of build logs and makes updates easier.
  </Step>

  <Step title="Benefits">
    * Token stays hidden in build logs
    * Easy to update without editing build steps
    * Shareable build configurations without exposing secrets
  </Step>
</Steps>

## Running Your Build

With the recipe configured:

1. Your Playwright tests run as usual
2. Reports and artifacts are generated
3. The TestDino recipe collects everything
4. Files are uploaded to your TestDino project
5. A confirmation message and link appear in the build log

<Tip>
  **Tip**

  Click the link to view your test run in TestDino.
</Tip>

## Troubleshooting

<AccordionGroup>
  <Accordion title="1. Upload Fails with Authentication Error">
    **Check your API token:**

    * Verify the token is correct and hasn't expired
    * Confirm the token has access to the right TestDino project
    * Make sure you've entered it in the recipe or set `TESTDINO_TOKEN` in the environment
  </Accordion>

  <Accordion title="2. Report Directory Not Found">
    **Verify your paths:**

    * Check that your Playwright tests actually ran and generated output
    * Confirm the path matches your `playwright.config.js` settings
    * Try using an absolute path if relative paths aren't working
  </Accordion>

  <Accordion title="3. Upload Succeeds, but Run Doesn't Appear">
    **Wait and refresh:**

    * Uploads can take a few seconds to process
    * Check the build log for error messages
    * Verify your API token has access to the project
    * Click the **Sync** button in the TestDino Test Runs view
  </Accordion>

  <Accordion title="4. Missing Artifacts (Screenshots, Videos, Traces)">
    **Enable the right checkboxes:**

    * Screenshots → **Image Attachments**
    * Videos → **Video Attachments**
    * Traces → **Trace Files**

    Or enable **Full JSON Bundle** to upload everything at once.
  </Accordion>

  <Accordion title="5. Build Step Runs Before Tests Finish">
    **Reorder your build steps:**

    * The TestDino step must run after your Playwright test step
    * Drag and drop to reorder in the Build Steps list
  </Accordion>

  <Accordion title="6. Need Detailed Logs?">
    Turn on **Verbose Logging** in the recipe settings. This adds extra output to your build log that helps pinpoint where things go wrong.
  </Accordion>
</AccordionGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="Keep Your API Token Secure">
    * Store the token in TeamCity parameters with password type
    * Avoid pasting tokens directly in build step fields
    * Replace tokens when they expire or if exposure is suspected
  </Accordion>

  <Accordion title="Upload What You Need">
    * For quick feedback, JSON-only is fastest
    * For debugging failures, add screenshots and traces
    * For full analysis, use the Full JSON Bundle option
  </Accordion>

  <Accordion title="Run TestDino After Tests Complete">
    Make sure the TestDino step runs after your Playwright tests finish. Consider setting the step to run **"Even if build steps fail"** so you can see failures in TestDino even when tests don't pass.
  </Accordion>

  <Accordion title="Match Your Report Paths">
    If you customize Playwright's output directories in `playwright.config.js`, update the recipe's custom path fields to match.
  </Accordion>

  <Accordion title="Use Verbose Logging During Setup">
    Turn on verbose logging when first configuring the recipe. Once everything works, you can turn it off to keep build logs clean.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="CI Optimization" icon="gauge-high" href="/guides/playwright-ci-optimization">
    Reduce CI time with smart reruns
  </Card>

  <Card title="Environment Mapping" icon="code-branch" href="/guides/environment-mapping">
    Route test results to Dev, Staging, or Production by branch
  </Card>

  <Card title="Integrations" icon="puzzle-piece" href="/integrations/overview">
    Connect Slack, Jira, Linear, Asana, and more
  </Card>

  <Card title="TestDino MCP" icon="plug" href="/mcp/overview">
    Access test results and fix issues with AI agents
  </Card>
</CardGroup>
