Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix: markdown report publishing (#35500)

Yury Semikhatsky0acedf1ca243
diff --git a/packages/playwright-dashboard/src/ghaMarkdownReporter.ts b/packages/playwright-dashboard/src/ghaMarkdownReporter.ts
index b1771ea8c9..34b3447153 100644
--- a/packages/playwright-dashboard/src/ghaMarkdownReporter.ts
+++ b/packages/playwright-dashboard/src/ghaMarkdownReporter.ts
@@ -20,7 +20,6 @@ import * as core from '@actions/core';
import MarkdownReporter from './markdownReporter';
import type { MetadataWithCommitInfo } from 'playwright/src/isomorphic/types';
-import type { FullConfig } from '@playwright/test';
function getGithubToken() {
const token = process.env.GITHUB_TOKEN || core.getInput('github-token');
@@ -36,8 +35,6 @@ const octokit = getOctokit(getGithubToken());
const magicComment = '<!-- Generated by Playwright markdown reporter -->';
class GHAMarkdownReporter extends MarkdownReporter {
- declare config: FullConfig;
-
override async publishReport(report: string) {
core.info('Publishing report to PR.');
const { prNumber, prHref } = this.pullRequestFromMetadata();
@@ -89,7 +86,7 @@ class GHAMarkdownReporter extends MarkdownReporter {
}
private pullRequestFromMetadata() {
- const metadata = this.config.metadata as MetadataWithCommitInfo;
+ const metadata = this._config.metadata as MetadataWithCommitInfo;
const prHref = metadata.ci?.prHref;
return { prNumber: parseInt(prHref?.split('/').pop() ?? '', 10), prHref };
}
diff --git a/packages/playwright-dashboard/src/markdownReporter.ts b/packages/playwright-dashboard/src/markdownReporter.ts
index c60e4fc802..4171b18446 100644
--- a/packages/playwright-dashboard/src/markdownReporter.ts
+++ b/packages/playwright-dashboard/src/markdownReporter.ts
@@ -27,7 +27,7 @@ type MarkdownReporterOptions = {
class MarkdownReporter implements Reporter {
private _options: MarkdownReporterOptions;
private _fatalErrors: TestError[] = [];
- private _config!: FullConfig;
+ protected _config!: FullConfig;
private _suite!: Suite;
constructor(options: MarkdownReporterOptions) {