---
title: Visual Studio Code integration
description: Learn how to integrate Allure Report with Visual Studio Code. Install the extension, generate test reports, and view results directly from the IDE.
---

# Visual Studio Code integration (Allure 2)

With the Allure extension for the Visual Studio Code, you can quickly generate and open test reports from its context menu.

The extension also provides a way to quickly upload test results to your Allure TestOps account, see the [Allure TestOps documentation](https://docs.qameta.io/allure-testops/ecosystem/vscode-plugin/).

## Installation

Warning:
Before installing the extension, make sure that the Allure Report command-line tool is [installed in your operating system](/docs/v2/install/).

1. Launch Visual Studio Code.

1. Open the **Extensions** view.

1. In the **Search Extensions in Marketplace** field, enter `qameta.allure-vscode`.

1. Click on the **Allure Support** extension, then click **Install**.

1. Wait for the installation to complete.

## Generating and serving test reports

The extension provides three operations.

- **[Generate and serve a test report](#generate-and-serve-a-test-report)**: given the test results, view a report in the browser.
- [Just generate a test report](#generate-a-test-report): given the test results, generate a report directory.
- [Just serve an existing test report](#serve-an-existing-test-report): given the report directory, view it in the browser.

### Generate and serve a test report

1. Run your tests as you would do normally.

   Assuming an [Allure integration](/docs/frameworks/) is configured correctly in your project, this must produce a test results directory at `allure-results`, `build/allure-results` or other location, depending on the configuration.

1. In the **Explorer** view, right-click on the test results directory and select **Allure Report: serve test results**.

   The test report will be generated in a temporary directory (outside of your project). A local web server for the directory will be automatically started.

1. In the **Allure** view, find the item with the same name as the test results directory.

   Hover the item to see the available actions:

   | Action                                                                                | Description                                      |
   | ------------------------------------------------------------------------------------- | ------------------------------------------------ |
   | ![Open browser](/images/integrations/vscode/open-browser.png "Open browser action")   | Open the test report in the default web browser. |
   | ![Shutdown server](/images/integrations/vscode/shutdown.png "Shutdown server action") | Stop the local web server.                       |

### Generate a test report

1. Run your tests as you would do normally.

   Assuming an [Allure integration](/docs/frameworks/) is configured correctly in your project, this must produce a test results directory at `allure-results`, `build/allure-results` or other location, depending on the configuration.

1. In the **Explorer** view, right-click on the test results directory and select **Allure Report: generate report**.

   The test report will be generated in a new directory named `allure-report-⟨DATE⟩_⟨TIME⟩`, for example: `allure-report-2023-05-23_08-37-17`.

1. To start a local server for viewing the report, right-click on the test report directory and select **Allure Report: serve generated report**.

### Serve an existing test report

1. Make sure that you have a previously generated directory with the HTML test report.

1. In the **Explorer** view, right-click on the report directory and select **Allure Report: serve generated report**.

1. In the **Allure** view, find the item with the same name as the report directory.

   Hover the item to see the available actions:

   | Action                                                        | Description                                      |
   | ------------------------------------------------------------- | ------------------------------------------------ |
   | ![Open browser](/images/integrations/vscode/open-browser.png) | Open the test report in the default web browser. |
   | ![Shutdown server](/images/integrations/vscode/shutdown.png)  | Stop the local web server.                       |
