diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 17a46d5d0..36dfecfaf 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -19,6 +19,8 @@ env: SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}} PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }} GH_BUILD_NUMBER: ${{ github.run_id }} + REPORT_PORTAL_URL: ${{ secrets.REPORT_PORTAL_URL }} + REPORT_PORTAL_TOKEN: ${{ secrets.REPORT_PORTAL_TOKEN }} MAXINSTANCES: 2 RETRY_COUNT: 2 diff --git a/cspell.json b/cspell.json index 20eb670c0..1cfdc84f5 100644 --- a/cspell.json +++ b/cspell.json @@ -30,6 +30,7 @@ "QNAME", "qshare", "repo", + "reportportal", "sharedlinks", "sidenav", "simpletask", diff --git a/package-lock.json b/package-lock.json index 160de2f93..00ce945a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,6 +59,7 @@ "@nx/eslint-plugin": "17.0.2", "@nx/workspace": "17.0.2", "@playwright/test": "^1.42.1", + "@reportportal/agent-js-playwright": "^5.1.4", "@schematics/angular": "14.1.2", "@types/event-emitter": "^0.3.3", "@types/jasmine": "~3.6.0", @@ -9354,6 +9355,98 @@ "node": ">=16" } }, + "node_modules/@reportportal/agent-js-playwright": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/@reportportal/agent-js-playwright/-/agent-js-playwright-5.1.8.tgz", + "integrity": "sha512-gLWTU8cw+TQtUmQz1oo0ztJpXeulYkpIlf7ybrZeR+ZGusQsVXtFTFS3vEGuqqvXCm+810vsfVDo9mQ470MARQ==", + "dev": true, + "dependencies": { + "@reportportal/client-javascript": "^5.1.3", + "strip-ansi": "6.0.1" + }, + "engines": { + "node": ">=14.x" + } + }, + "node_modules/@reportportal/client-javascript": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.1.3.tgz", + "integrity": "sha512-1/utoKnHUgiilR6Ep8pHvuNZGv5oDeI+x1/aJNu8IADoVG1U0Q4tB2trWHDIY07T/PCzrnzp6dVcCu/wLsdVRA==", + "dev": true, + "dependencies": { + "axios": "^1.6.8", + "axios-retry": "^4.1.0", + "glob": "^8.1.0", + "ini": "^2.0.0", + "uniqid": "^5.4.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=12.x" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@rollup/plugin-json": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", @@ -11459,16 +11552,28 @@ "dev": true }, "node_modules/axios": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", - "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dev": true, "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, + "node_modules/axios-retry": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.1.0.tgz", + "integrity": "sha512-svdth4H00yhlsjBbjfLQ/sMLkXqeLxhiFC1nE1JtkN/CIssGxqk0UwTEdrVjwA2gr3yJkAulwvDSIm4z4HyPvg==", + "dev": true, + "dependencies": { + "is-retry-allowed": "^2.2.0" + }, + "peerDependencies": { + "axios": "0.x || 1.x" + } + }, "node_modules/axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -18406,6 +18511,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-retry-allowed": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz", + "integrity": "sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-set": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", @@ -30791,6 +30908,12 @@ "node": ">= 0.8.0" } }, + "node_modules/uniqid": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-5.4.0.tgz", + "integrity": "sha512-38JRbJ4Fj94VmnC7G/J/5n5SC7Ab46OM5iNtSstB/ko3l1b5g7ALt4qzHFgGciFkyiRNtDXtLNb+VsxtMSE77A==", + "dev": true + }, "node_modules/unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", diff --git a/package.json b/package.json index d7dcb4d8d..ed715cc60 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "@nx/eslint-plugin": "17.0.2", "@nx/workspace": "17.0.2", "@playwright/test": "^1.42.1", + "@reportportal/agent-js-playwright": "^5.1.4", "@schematics/angular": "14.1.2", "@types/event-emitter": "^0.3.3", "@types/jasmine": "~3.6.0", diff --git a/projects/aca-playwright-shared/src/base-config/playwright.config.ts b/projects/aca-playwright-shared/src/base-config/playwright.config.ts index aecb99dbc..e21b96e54 100644 --- a/projects/aca-playwright-shared/src/base-config/playwright.config.ts +++ b/projects/aca-playwright-shared/src/base-config/playwright.config.ts @@ -22,14 +22,13 @@ * from Hyland Software. If not, see . */ -import { PlaywrightTestConfig, ReporterDescription, devices } from '@playwright/test'; +import { PlaywrightTestConfig, devices } from '@playwright/test'; import { timeouts } from '../utils'; +import { getReporter } from './report-portal.config'; require('@alfresco/adf-cli/tooling').dotenvConfig(); const { env } = process; -const report: ReporterDescription[] = (env.CI) ? [['github']] : [['html']]; - export const getGlobalConfig: PlaywrightTestConfig = { timeout: timeouts.globalTest, globalTimeout: timeouts.globalSpec, @@ -48,7 +47,8 @@ export const getGlobalConfig: PlaywrightTestConfig = { retries: env.CI ? 2 : 0, /* Opt out of parallel tests on CI. */ workers: 3, - reporter: [['list'], ...report], + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: [['list'], ...getReporter()], globalSetup: require.resolve('./global.setup'), testMatch: ['**/*.e2e.ts'], use: { diff --git a/projects/aca-playwright-shared/src/base-config/report-portal.config.ts b/projects/aca-playwright-shared/src/base-config/report-portal.config.ts new file mode 100644 index 000000000..18eb2292e --- /dev/null +++ b/projects/aca-playwright-shared/src/base-config/report-portal.config.ts @@ -0,0 +1,41 @@ +/* + * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * License rights for this program may be obtained from Hyland Software, Inc. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +import { ReporterDescription } from '@playwright/test'; +import { timeouts } from '../utils'; + +const { env } = process; + +export const getReportPortalConfig = () => { + const attributes = [ + { key: 'Job', value: `${env.GITHUB_JOB}` }, + { key: 'Build_type', value: `${env.GITHUB_EVENT_NAME}` }, + { key: 'Repository', value: `${env.GITHUB_REPOSITORY}` }, + { key: 'Branch', value: `${env.GITHUB_HEAD_REF || env.GITHUB_REF}` } + ]; + + const launch = `GitHub Actions - ACA`; + + return { + endpoint: env.REPORT_PORTAL_URL, + apiKey: env.REPORT_PORTAL_TOKEN, + project: 'alfresco-content-app', + launch, + includeTestSteps: true, + restClientConfig: { + timeout: timeouts.extendedTest + }, + attributes, + description: `[Run on GitHub Actions ${env.GITHUB_RUN_ID}](${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID})` + }; +}; + +export const getReporter = (): ReporterDescription[] => + env.CI + ? [['@reportportal/agent-js-playwright', getReportPortalConfig()], ['github']] + : [['html']];