Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
"INPUT_REPORTDIR": "${workspaceFolder}/tasks/UploadPortalHtmlReport/tests/fixtures",
"INPUT_TABNAME": "HTML Report",
"INPUT_REDACTSECRETS": "false",
"INPUT_FAILONEMPTY": "true"
"INPUT_FAILONEMPTY": "true",
"INPUT_INLINEASSETS": "true",
"INPUT_PUBLISHARCHIVE": "true",
"INPUT_FAILONFAILEDREPORTS": "false"
},
"skipFiles": [
"<node_internals>/**"
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# Azure DevOps HTML Report Portal

Publish self-contained HTML reports (Newman HTML Extra, Playwright, Cypress, coverage, or any other HTML file) and view them as a tab on Azure Pipelines build and release results.
Publish HTML reports and view them as a tab on Azure Pipelines build and release results.

Each tab embeds the report in the pipeline UI and provides a download link.
Each tab embeds the report in the pipeline UI, with per-report download and an optional zip of the whole folder.

This project is a fork of [maciejmaciejewski/azure-pipelines-postman](https://github.com/maciejmaciejewski/azure-pipelines-postman), generalized beyond Postman reports.

## Configuration

Add the **Upload HTML Report** task after your tests produce HTML output. Use `condition: succeededOrFailed()` so reports still publish when tests fail.

The task takes:
| Input | Default | Description |
| --- | --- | --- |
| `reportDir` | `$(System.DefaultWorkingDirectory)` | A single `.html`/`.htm` file, or a directory searched recursively |
| `tabName` | `HTML Report` | Tab label on the pipeline run |
| `inlineAssets` | `true` | Embed local CSS, JS, and images so multi-file reports (coverage, etc.) render in the tab |
| `publishArchive` | `true` | Attach a zip of a report **directory** (skipped above 50 MB; `node_modules` is omitted) |
| `redactSecrets` | `false` | Mask Bearer tokens and common secret keys (useful for Newman HTML Extra) |
| `failOnEmpty` | `true` | Fail when no HTML files are found |
| `failOnFailedReports` | `false` | Fail after upload when a report looks unsuccessful (Newman failed tests or Playwright `unexpected` count) |

- `reportDir` (required) — a single `.html`/`.htm` file, or a directory that is searched recursively
- `tabName` (optional) — tab label on the pipeline run (default: `HTML Report`)
- `redactSecrets` (optional) — mask Bearer tokens and common secret keys before upload (default: `false`)
- `failOnEmpty` (optional) — fail the task when no HTML files are found (default: `true`)

Reports should be **self-contained** HTML (CSS/JS inlined). Companion assets such as Playwright's `playwright-report/` folder are not published as a static site.
`index.html` is listed first when a directory contains several HTML files. A single report is expanded automatically in the tab.

```yaml
steps:
Expand All @@ -39,16 +42,19 @@ steps:
reportDir: '$(System.DefaultWorkingDirectory)/reports/newman.html'
tabName: 'Postman'
redactSecrets: true
failOnFailedReports: true
```

### Directory of reports
### Coverage or other multi-file HTML

Local `link`, `script`, and `img` references are inlined into each HTML file before upload. That is enough for typical coverage folders (JaCoCo, Istanbul). Playwright/Cypress apps that `fetch()` extra JSON at runtime still need a self-contained HTML export, or use **Download all** for the original folder.

```yaml
- task: UploadPortalHtmlReport@1
condition: succeededOrFailed()
inputs:
reportDir: '$(System.DefaultWorkingDirectory)/reports'
tabName: 'QA Reports'
reportDir: '$(System.DefaultWorkingDirectory)/coverage'
tabName: 'Coverage'
```

Run the task more than once with different `tabName` values to publish multiple report groups.
Expand Down
2 changes: 1 addition & 1 deletion azure-devops-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"publisher": "joneja09",
"public": false,
"author": "Jeff Jones",
"version": "1.2.0",
"version": "1.3.0",
"description": "Embed HTML reports in Azure Pipelines",
"galleryFlags": [],
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ steps:
extensionId: "html-report-portal"
extensionTag: dev
extensionName: "HTML Report Portal Dev"
extensionVersion: "1.2.$(Build.BuildId)"
extensionVersion: "1.3.$(Build.BuildId)"
updateTasksVersion: true
extensionVisibility: private
extensionPricing: free
Expand Down
9 changes: 2 additions & 7 deletions overview.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# HTML Report Portal

Publish self-contained HTML reports and view them as a tab on Azure Pipelines build and release results. Each tab embeds the report and provides a download link.
Publish HTML reports and view them as a tab on Azure Pipelines build and release results. Each tab embeds the report, offers a download, and can attach a zip of the original folder.

Use this for Newman HTML Extra, Playwright, Cypress, coverage, or any other self-contained HTML file.
Local CSS, JavaScript, and images are inlined by default so coverage-style folders render in the tab.

For full documentation see [GitHub](https://github.com/joneja09/azure-pipelines-html-viewer).

## Configuration

Add the **Upload HTML Report** task after your tests produce HTML output. Use `condition: succeededOrFailed()` so reports still publish when tests fail.

- `reportDir` (required): a single `.html`/`.htm` file, or a directory searched recursively
- `tabName` (optional): tab label on the pipeline run
- `redactSecrets` (optional): mask Bearer tokens and common secret keys (useful for Postman/Newman reports)
- `failOnEmpty` (optional): fail when no HTML files are found

```yaml
steps:
- task: UploadPortalHtmlReport@1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-pipelines-html-portal",
"version": "1.2.0",
"version": "1.3.0",
"description": "Embed HTML reports into Azure Pipelines build and release tabs",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions src/tabContent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ iframe.full-size {
height: calc(100vh - 180px);
min-height: 640px;
}

.archive-bar {
display: flex;
justify-content: flex-end;
margin: 0 0 12px 0;
}
Loading
Loading