Available from version "2.0.9" of @bigbinary/neeto-playwright-reporter
The following are the options and their default values that can be passed to @bigbinary/neeto-playwright-reporter
.
Parameter |
Type |
Description |
Required? |
Default Value |
---|---|---|---|---|
projectKey |
string |
The project key of the Project to which you want to report the tests. You can find more details here. |
Yes |
- |
apiKey |
string |
The API key generated for your workspace. You can find more details on generating an API key here. |
Yes |
- |
ciBuildId |
string |
|
Yes |
- |
tags |
string | string[] |
The tags you want to add to the run. It can be a single tag as a string or multiple tags as an array of strings. |
No |
- |
title |
string |
The title of the run. If no value is provided the commit message of the HEAD commit is chosen. If neither is available then the CI Build ID is displayed as the title. |
No |
The commit message of the HEAD commit. |
commitId |
string |
Used to manually specify the git commit ID if it cannot be accurately determined in the execution environment. If left empty, the git commit ID is picked from environment where the Playwright tests are executed. If both are unavailable the field is left empty. If the commit ID cannot be determined from the execution environment then its mandatory to mention the commit ID if you wish to use the commit status GitHub integration feature. |
No (Required for GitHub integration) |
The commit ID of the HEAD commit. |
author |
string |
Used to manually specify the git commit author if it cannot be accurately determined in the execution environment. If left empty, the git commit author is picked from environment where the Playwright tests are executed. If both are unavailable the field is left empty. |
No |
The author of the HEAD commit. |
branch |
string |
Used to manually specify the git branch if it cannot be accurately determined in the execution environment. If left empty, the git branch is picked from environment where the Playwright tests are executed. If both are unavailable the field is left empty. If the branch cannot be determined from the execution environment then its mandatory to mention the branch if you wish to use the PR comment GitHub integration feature. |
No (Required for GitHub integration) |
The branch in which the tests are executed. |
When to use the additional parameters?
While parameters like tags are optional and help you with run categorization and notification filtering, other parameters such as commit ID, author and branch are workarounds for CI platforms such as GitHub runners. This is because GitHub executes the CI jobs by creating a merge commit on the latest commit in the branch with the latest commit on HEAD pointer. Since the job is executed in this detached head, the commit ID, branch and author might not be properly accessible through git commands. In such situations, GitHub exposes these parameters as environment variables and secrets. You can find the variable reference here.
Eg:
# In GitHub actions
jobs:
greeting_job:
runs-on: ubuntu-latest
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
AUTHOR: ${{ github.event.commits[0].author.name }}
import { defineConfig } from 'playwright';
const neetoPlaywrightReporterConfig = {
ciBuildId: "ci-build-id",
apiKey: "api-key",
projectKey: "************************",
tags: ["smoke", "regression"],
title: process.env.COMMIT_MSG,
branch: process.env.GITHUB_BASE_REF,
author: process.env.AUTHOR,
};
export default defineConfig({
// other configurations...
reporter: [['@bigbinary/neeto-playwright-reporter', neetoPlaywrightReporterConfig]],
// other configurations...
});