diff --git a/VKUI/reporter/action.yml b/VKUI/reporter/action.yml index 2f855148..6b67deee 100644 --- a/VKUI/reporter/action.yml +++ b/VKUI/reporter/action.yml @@ -4,6 +4,9 @@ inputs: playwrightReportURL: required: false description: 'HTML Playwright Report URL for publish comment' + axeReportURL: + required: false + description: 'HTML Axe Accessibility Report URL for publish comment' token: required: false description: 'token with access to your repository' diff --git a/VKUI/reporter/src/main.ts b/VKUI/reporter/src/main.ts index 7e40ebd4..e39f1bb1 100644 --- a/VKUI/reporter/src/main.ts +++ b/VKUI/reporter/src/main.ts @@ -25,10 +25,11 @@ async function run(): Promise { } const playwrightReportURL = core.getInput('playwrightReportURL', { required: false }); + const axeReportURL = core.getInput('axeReportURL', { required: false }); const token = core.getInput('token', { required: false }); if (playwrightReportURL && token) { - jobs.push(playwrightReport(playwrightReportURL, token)); + jobs.push(playwrightReport(token, playwrightReportURL, axeReportURL)); } await Promise.all(jobs); diff --git a/VKUI/reporter/src/playwrightReport.ts b/VKUI/reporter/src/playwrightReport.ts index 161e01bb..0fb27f42 100644 --- a/VKUI/reporter/src/playwrightReport.ts +++ b/VKUI/reporter/src/playwrightReport.ts @@ -12,7 +12,11 @@ function hasFailedScreenshots() { return isDataDirExist || isTraceDirExist; } -export async function playwrightReport(url: string, token: string) { +export async function playwrightReport( + token: string, + playwrightReportUrl: string, + axeReportUrl?: string, +) { const gh = github.getOctokit(token); const comment = new GitHubCommentBuilder(gh); @@ -22,7 +26,23 @@ export async function playwrightReport(url: string, token: string) { message.push('> ⚠️ Some screenshots were failed. See Playwright Report. \n\n'); } - message.push(`Playwright Report`.replace(/(^|\n) +/g, '')); + message.push( + `Playwright Report`.replace( + /(^|\n) +/g, + '', + ), + ); + + if (axeReportUrl) { + message.push('## ♿ a11y tests\n\n'); + + message.push( + `Axe Accessibility Report`.replace( + /(^|\n) +/g, + '', + ), + ); + } comment.add(message.join(' ')); await comment.write();