> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/guides/troubleshooting-playwright.md).

# Troubleshooting

Troubleshooting Playwright integration with Currents

{% hint style="info" %}
Run doesn't show up in Currents? Start with [Missing Runs](/guides/missing-runs.md). This page covers collecting debug information for support.
{% endhint %}

If you are experiencing issues with using `@currents/playwright`, enable debug mode to collect more information about the failure and submit a support request via our [support channels](/resources/support.md).

{% hint style="info" %} <mark style="color:yellow;">**TL;DR share the following information**</mark>

Collect environment information

* Package Versions
* Currents Run ID or Dashboard URL associated with the issue
* Screenshots or video recordings if applicable
* Full error message, including the stack trace, if available
* Full and relevant CI execution logs with sensitive information redacted
* CI pipeline configuration
  * The exact commands used during the execution
  * Relevant configuration of the CI setup stages

\
Collect and share the debug logs

* `npx pwc --pwc-debug=full ...` OR
* `npx pwc-p --pwc-debug=remote ...` OR
* `DEBUG=currents* playwright test ...`
  {% endhint %}

### 1. Collecting Environment Information

Please collect the following information to help us effectively debug the problem:

* The associated dashboard Run URL
* Screenshots if applicable
* Your setup method and configuration files
* The exact command used to run playwright
* Environment information (use the command below)

Use the following command to print information about your CI environment

```bash
npx envinfo --system --binaries --browsers --npmPackages --duplicates --npmGlobalPackages
```

### 2. Activate Debug Mode

{% hint style="warning" %}
Capture and share the **full** debug log - that will help the support person identify the root cause faster
{% endhint %}

`@currents/playwright` simplifies collecting the debug information by automatically uploading the logs to Currents.

To enable uploading the debug logs:

* For `pwc` command-line executable run `pwc --pwc-debug=full` OR
* For `pwc-p` run `pwc-p --pwc-debug=full` OR
* Set environment variable `DEBUG=currents* playwright test...`

`--pwc-debug` enables uploading the debug logs to our servers (see [pwc-p run](/resources/reporters/currents-playwright/pwc-p/pwc-p-run.md#debugging-and-output) documentation):

* `remote` uploads the debug logs to Currents servers;
* `full` prints the logs to stdout and also upload them to Currents.

For example:

{% tabs %}
{% tab title="pwc" %}

```bash
npx pwc --pwc-debug=full ...
```

{% endtab %}

{% tab title="pwc-p" %}

```
npx pwc-p --pwc-debug=full ...
```

{% endtab %}

{% tab title="Environment variable" %}

```
# on Linux
# PROJECT_ID and RECORD_KEY come from https://app.currents.dev
# CURRENTS_CI_BUILD_ID must be new for every run
CURRENTS_PROJECT_ID=PROJECT_ID \
CURRENTS_RECORD_KEY=RECORD_KEY \
CURRENTS_CI_BUILD_ID="debug-$(date +%s)" \
CURRENTS_DEBUG=full \
npx playwright test

# on Windows
## - set the environment variables first
cmd /V /C ^
set CURRENTS_DEBUG=full ^
set CURRENTS_PROJECT_ID=project_id&& ^
set CURRENTS_RECORD_KEY=record_key&& ^
set CURRENTS_CI_BUILD_ID=unique_build_id

## - the run the command
npx playwright test ...
```

{% endtab %}
{% endtabs %}

When enabled, the debug logs will be uploaded to Currents servers and a confirmation message will be shown after the run's completion, for example:

<figure><img src="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2F9vs5UtcNYFfBX7KK63wF%2Fcurrents-2023-12-11-15.56.04%402x.png?alt=media&amp;token=9012cc50-2f6d-4eb1-b237-ea9a9e32e974" alt=""><figcaption><p>Remote debug logs notification example</p></figcaption></figure>

## CI Link Issues

### Problem: CI link is missing or incorrect in the dashboard

Currents displays a link to the CI job/run where the tests were executed. If this link is missing or incorrect:

**Possible causes:**

1. **Auto-detection failed:** Your CI provider environment variables are not available in the test environment (e.g., inside a Docker container, custom runner, or self-hosted CI)
2. **Custom CI system:** Your CI provider is not automatically recognized by Currents
3. **URL override needed:** You need to manually specify the CI URL

**Solution:**

Set the `CURRENTS_CI_URL` environment variable to provide the correct CI job/run URL:

```bash
# GitHub Actions example
export CURRENTS_CI_URL="https://github.com/my-org/my-repo/actions/runs/$GITHUB_RUN_ID"

# GitLab CI example
export CURRENTS_CI_URL="$CI_JOB_URL"

# Jenkins example
export CURRENTS_CI_URL="$BUILD_URL"

# Custom CI system
export CURRENTS_CI_URL="https://ci.mycompany.com/builds/run-123"
```

For more details on `CURRENTS_CI_URL`, see [Configuration](/resources/reporters/currents-playwright/configuration.md).


---

# 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://docs.currents.dev/guides/troubleshooting-playwright.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.
