Skip to content

Commit 8e575aa

Browse files
committed
Update docs
1 parent 032c1c8 commit 8e575aa

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

Diff for: README.md

+48
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The reporter supports the following configuration options:
4040
| showError | Show error message in summary | `false` |
4141
| includeResults | Define which types of test results should be shown in the summary | `['pass', 'skipped', 'fail', 'flaky']` |
4242
| quiet | Do not show any output in the console | `false` |
43+
| azureStorageUrl | URL to the Azure Storage account where the screenshots are stored (optional) | `""` |
44+
| azureStorageSAS | Shared Access Signature (SAS) token to access the Azure Storage account (optional) | `""` |
4345

4446
To use these option, you can update the reporter configuration:
4547

@@ -66,4 +68,50 @@ export default defineConfig({
6668

6769
![Example with details](./assets/example-with-details.png)
6870

71+
## Showing result attachments
72+
73+
If you want to show attachments like when you use pixel matching, you need to provide the configuration for the blob service where the images will be stored.
74+
75+
> [!NOTE]
76+
> GitHub does not have an API to link images to the summary. Therefore, you need to store the images in a blob storage service and provide the URL to the images.
77+
78+
> [!IMPORTANT]
79+
> To show the attachments, you need to make sure to enable `showError` as well.
80+
81+
![Example with attachments](./assets/example-with-attachments.png)
82+
83+
### Azure Blob Storage
84+
85+
If you are using Azure Blob Storage, you need to provide the `azureStorageUrl` and `azureStorageSAS` configuration options.
86+
87+
Follow the next steps to get the URL and SAS token:
88+
89+
- Go to your Azure Portal
90+
- Navigate to your storage account or create a new one
91+
- Navigate to **data storage** > **containers**
92+
- Create a new container. Set the access level to **Blob (anonymous read access for blobs only)**
93+
- Open the container, and click on **Shared access signature**
94+
- Create a new shared access signature with the following settings:
95+
- Allowed permissions: **Add**
96+
- Expiry time: **Custom** (set the time you want)
97+
- Allowed protocols: **HTTPS only**
98+
- Click on **Generate SAS and URL**
99+
- Copy the **Blob SAS token**, this will be your `azureStorageSAS` value
100+
- Copy the **Blob service URL** and append the container name to it, this will be your `azureStorageUrl` value. Example: `https://<name>.blob.core.windows.net/<container-name>`.
101+
- Update the `playwright.config.js` file with the following configuration:
102+
103+
```ts
104+
import { defineConfig } from '@playwright/test';
105+
106+
export default defineConfig({
107+
reporter: [
108+
['@estruyf/github-actions-reporter', {
109+
showError: true,
110+
azureStorageUrl: 'https://<name>.blob.core.windows.net/<container-name>',
111+
azureStorageSAS: '<your-sas-token>'
112+
}]
113+
],
114+
});
115+
```
116+
69117
[![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Festruyf%2Fplaywright-github-actions-reporter&countColor=%23263759)](https://visitorbadge.io/status?path=https%3A%2F%2Fgithub.com%2Festruyf%2Fplaywright-github-actions-reporter)

Diff for: assets/example-with-attachments.png

579 KB
Loading

0 commit comments

Comments
 (0)