@one2x/playwright 1.57.0-alpha.1 → 1.57.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/mcp/sdk/http.js +12 -12
- package/package.json +2 -2
- package/lib/agents/generateAgents.js.map +0 -7
- package/lib/common/config.js.map +0 -7
- package/lib/common/configLoader.js.map +0 -7
- package/lib/common/esmLoaderHost.js.map +0 -7
- package/lib/common/expectBundle.js.map +0 -7
- package/lib/common/expectBundleImpl.js.map +0 -7
- package/lib/common/fixtures.js.map +0 -7
- package/lib/common/globals.js.map +0 -7
- package/lib/common/ipc.js.map +0 -7
- package/lib/common/poolBuilder.js.map +0 -7
- package/lib/common/process.js.map +0 -7
- package/lib/common/suiteUtils.js.map +0 -7
- package/lib/common/test.js.map +0 -7
- package/lib/common/testLoader.js.map +0 -7
- package/lib/common/testType.js.map +0 -7
- package/lib/common/validators.js.map +0 -7
- package/lib/fsWatcher.js.map +0 -7
- package/lib/index.js.map +0 -7
- package/lib/internalsForTest.js.map +0 -7
- package/lib/isomorphic/events.js.map +0 -7
- package/lib/isomorphic/folders.js.map +0 -7
- package/lib/isomorphic/stringInternPool.js.map +0 -7
- package/lib/isomorphic/teleReceiver.js.map +0 -7
- package/lib/isomorphic/teleSuiteUpdater.js.map +0 -7
- package/lib/isomorphic/testServerConnection.js.map +0 -7
- package/lib/isomorphic/testServerInterface.js.map +0 -7
- package/lib/isomorphic/testTree.js.map +0 -7
- package/lib/isomorphic/types.d.js.map +0 -7
- package/lib/loader/loaderMain.js.map +0 -7
- package/lib/matchers/expect.js.map +0 -7
- package/lib/matchers/matcherHint.js.map +0 -7
- package/lib/matchers/matchers.js.map +0 -7
- package/lib/matchers/toBeTruthy.js.map +0 -7
- package/lib/matchers/toEqual.js.map +0 -7
- package/lib/matchers/toHaveURL.js.map +0 -7
- package/lib/matchers/toMatchAriaSnapshot.js.map +0 -7
- package/lib/matchers/toMatchSnapshot.js.map +0 -7
- package/lib/matchers/toMatchText.js.map +0 -7
- package/lib/mcp/browser/actions.d.js.map +0 -7
- package/lib/mcp/browser/browserContextFactory.js.map +0 -7
- package/lib/mcp/browser/browserServerBackend.js.map +0 -7
- package/lib/mcp/browser/codegen.js.map +0 -7
- package/lib/mcp/browser/config.js.map +0 -7
- package/lib/mcp/browser/context.js.map +0 -7
- package/lib/mcp/browser/response.js.map +0 -7
- package/lib/mcp/browser/sessionLog.js.map +0 -7
- package/lib/mcp/browser/tab.js.map +0 -7
- package/lib/mcp/browser/tools/actionRetry.js.map +0 -7
- package/lib/mcp/browser/tools/common.js.map +0 -7
- package/lib/mcp/browser/tools/console.js.map +0 -7
- package/lib/mcp/browser/tools/dialogs.js.map +0 -7
- package/lib/mcp/browser/tools/evaluate.js.map +0 -7
- package/lib/mcp/browser/tools/files.js.map +0 -7
- package/lib/mcp/browser/tools/form.js.map +0 -7
- package/lib/mcp/browser/tools/install.js.map +0 -7
- package/lib/mcp/browser/tools/keyboard.js.map +0 -7
- package/lib/mcp/browser/tools/mouse.js.map +0 -7
- package/lib/mcp/browser/tools/navigate.js.map +0 -7
- package/lib/mcp/browser/tools/network.js.map +0 -7
- package/lib/mcp/browser/tools/pdf.js.map +0 -7
- package/lib/mcp/browser/tools/screenshot.js.map +0 -7
- package/lib/mcp/browser/tools/snapshot.js.map +0 -7
- package/lib/mcp/browser/tools/tabs.js.map +0 -7
- package/lib/mcp/browser/tools/tool.js.map +0 -7
- package/lib/mcp/browser/tools/tracing.js.map +0 -7
- package/lib/mcp/browser/tools/utils.js.map +0 -7
- package/lib/mcp/browser/tools/verify.js.map +0 -7
- package/lib/mcp/browser/tools/wait.js.map +0 -7
- package/lib/mcp/browser/tools.js.map +0 -7
- package/lib/mcp/browser/watchdog.js.map +0 -7
- package/lib/mcp/config.d.js.map +0 -7
- package/lib/mcp/extension/cdpRelay.js.map +0 -7
- package/lib/mcp/extension/extensionContextFactory.js.map +0 -7
- package/lib/mcp/extension/protocol.js.map +0 -7
- package/lib/mcp/index.js.map +0 -7
- package/lib/mcp/log.js.map +0 -7
- package/lib/mcp/program.js.map +0 -7
- package/lib/mcp/sdk/bundle.js.map +0 -7
- package/lib/mcp/sdk/exports.js.map +0 -7
- package/lib/mcp/sdk/http.js.map +0 -7
- package/lib/mcp/sdk/inProcessTransport.js.map +0 -7
- package/lib/mcp/sdk/mdb.js.map +0 -7
- package/lib/mcp/sdk/proxyBackend.js.map +0 -7
- package/lib/mcp/sdk/server.js.map +0 -7
- package/lib/mcp/sdk/tool.js.map +0 -7
- package/lib/mcp/test/browserBackend.js.map +0 -7
- package/lib/mcp/test/generatorTools.js.map +0 -7
- package/lib/mcp/test/plannerTools.js.map +0 -7
- package/lib/mcp/test/seed.js.map +0 -7
- package/lib/mcp/test/streams.js.map +0 -7
- package/lib/mcp/test/testBackend.js.map +0 -7
- package/lib/mcp/test/testContext.js.map +0 -7
- package/lib/mcp/test/testTool.js.map +0 -7
- package/lib/mcp/test/testTools.js.map +0 -7
- package/lib/mcpBundleImpl.js.map +0 -7
- package/lib/plugins/gitCommitInfoPlugin.js.map +0 -7
- package/lib/plugins/index.js.map +0 -7
- package/lib/plugins/webServerPlugin.js.map +0 -7
- package/lib/program.js.map +0 -7
- package/lib/reporters/base.js.map +0 -7
- package/lib/reporters/blob.js.map +0 -7
- package/lib/reporters/dot.js.map +0 -7
- package/lib/reporters/empty.js.map +0 -7
- package/lib/reporters/github.js.map +0 -7
- package/lib/reporters/html.js.map +0 -7
- package/lib/reporters/internalReporter.js.map +0 -7
- package/lib/reporters/json.js.map +0 -7
- package/lib/reporters/junit.js.map +0 -7
- package/lib/reporters/line.js.map +0 -7
- package/lib/reporters/list.js.map +0 -7
- package/lib/reporters/listModeReporter.js.map +0 -7
- package/lib/reporters/markdown.js.map +0 -7
- package/lib/reporters/merge.js.map +0 -7
- package/lib/reporters/multiplexer.js.map +0 -7
- package/lib/reporters/reporterV2.js.map +0 -7
- package/lib/reporters/teleEmitter.js.map +0 -7
- package/lib/reporters/versions/blobV1.js.map +0 -7
- package/lib/runner/dispatcher.js.map +0 -7
- package/lib/runner/failureTracker.js.map +0 -7
- package/lib/runner/lastRun.js.map +0 -7
- package/lib/runner/loadUtils.js.map +0 -7
- package/lib/runner/loaderHost.js.map +0 -7
- package/lib/runner/processHost.js.map +0 -7
- package/lib/runner/projectUtils.js.map +0 -7
- package/lib/runner/rebase.js.map +0 -7
- package/lib/runner/reporters.js.map +0 -7
- package/lib/runner/runner.js +0 -110
- package/lib/runner/sigIntWatcher.js.map +0 -7
- package/lib/runner/taskRunner.js.map +0 -7
- package/lib/runner/tasks.js.map +0 -7
- package/lib/runner/testGroups.js.map +0 -7
- package/lib/runner/testRunner.js.map +0 -7
- package/lib/runner/testServer.js.map +0 -7
- package/lib/runner/uiModeReporter.js.map +0 -7
- package/lib/runner/vcs.js.map +0 -7
- package/lib/runner/watchMode.js.map +0 -7
- package/lib/runner/workerHost.js.map +0 -7
- package/lib/third_party/pirates.js.map +0 -7
- package/lib/third_party/tsconfig-loader.js.map +0 -7
- package/lib/transform/babelBundle.js.map +0 -7
- package/lib/transform/babelBundleImpl.js.map +0 -7
- package/lib/transform/compilationCache.js.map +0 -7
- package/lib/transform/esmLoader.js.map +0 -7
- package/lib/transform/portTransport.js.map +0 -7
- package/lib/transform/transform.js.map +0 -7
- package/lib/util.js.map +0 -7
- package/lib/utilsBundle.js.map +0 -7
- package/lib/utilsBundleImpl.js.map +0 -7
- package/lib/worker/fixtureRunner.js.map +0 -7
- package/lib/worker/testInfo.js.map +0 -7
- package/lib/worker/testTracing.js.map +0 -7
- package/lib/worker/timeoutManager.js.map +0 -7
- package/lib/worker/util.js.map +0 -7
- package/lib/worker/workerMain.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/plugins/gitCommitInfoPlugin.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as fs from 'fs';\n\nimport { monotonicTime, spawnAsync } from 'playwright-core/lib/utils';\n\nimport type { TestRunnerPlugin } from './';\nimport type { FullConfig } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { GitCommitInfo, CIInfo, MetadataWithCommitInfo } from '../isomorphic/types';\n\nconst GIT_OPERATIONS_TIMEOUT_MS = 3000;\n\nexport const addGitCommitInfoPlugin = (fullConfig: FullConfigInternal) => {\n fullConfig.plugins.push({ factory: gitCommitInfoPlugin.bind(null, fullConfig) });\n};\n\nfunction print(s: string, ...args: any[]) {\n // eslint-disable-next-line no-console\n console.log('GitCommitInfo: ' + s, ...args);\n}\n\nfunction debug(s: string, ...args: any[]) {\n if (!process.env.DEBUG_GIT_COMMIT_INFO)\n return;\n print(s, ...args);\n}\n\nconst gitCommitInfoPlugin = (fullConfig: FullConfigInternal): TestRunnerPlugin => {\n return {\n name: 'playwright:git-commit-info',\n\n setup: async (config: FullConfig, configDir: string) => {\n const metadata = config.metadata as MetadataWithCommitInfo;\n const ci = await ciInfo();\n if (!metadata.ci && ci) {\n debug('ci info', ci);\n metadata.ci = ci;\n }\n\n if (fullConfig.captureGitInfo?.commit || (fullConfig.captureGitInfo?.commit === undefined && ci)) {\n const git = await gitCommitInfo(configDir).catch(e => print('failed to get git commit info', e));\n if (git) {\n debug('commit info', git);\n metadata.gitCommit = git;\n }\n }\n\n if (fullConfig.captureGitInfo?.diff || (fullConfig.captureGitInfo?.diff === undefined && ci)) {\n const diffResult = await gitDiff(configDir, ci).catch(e => print('failed to get git diff', e));\n if (diffResult) {\n debug(`diff length ${diffResult.length}`);\n metadata.gitDiff = diffResult;\n }\n }\n },\n };\n};\n\nasync function ciInfo(): Promise<CIInfo | undefined> {\n if (process.env.GITHUB_ACTIONS) {\n let pr: { title: string, number: number, baseHash: string } | undefined;\n try {\n const json = JSON.parse(await fs.promises.readFile(process.env.GITHUB_EVENT_PATH!, 'utf8'));\n pr = { title: json.pull_request.title, number: json.pull_request.number, baseHash: json.pull_request.base.sha };\n } catch {\n }\n\n return {\n commitHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/commit/${process.env.GITHUB_SHA}`,\n commitHash: process.env.GITHUB_SHA,\n prHref: pr ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/pull/${pr.number}` : undefined,\n prTitle: pr?.title,\n prBaseHash: pr?.baseHash,\n buildHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,\n };\n }\n\n if (process.env.GITLAB_CI) {\n return {\n commitHref: `${process.env.CI_PROJECT_URL}/-/commit/${process.env.CI_COMMIT_SHA}`,\n commitHash: process.env.CI_COMMIT_SHA,\n buildHref: process.env.CI_JOB_URL,\n branch: process.env.CI_COMMIT_REF_NAME,\n };\n }\n\n if (process.env.JENKINS_URL && process.env.BUILD_URL) {\n return {\n commitHref: process.env.BUILD_URL,\n commitHash: process.env.GIT_COMMIT,\n branch: process.env.GIT_BRANCH,\n };\n }\n\n // Open to PRs.\n}\n\nasync function gitCommitInfo(gitDir: string): Promise<GitCommitInfo | undefined> {\n const separator = `---786eec917292---`;\n const tokens = [\n '%H', // commit hash\n '%h', // abbreviated commit hash\n '%s', // subject\n '%B', // raw body (unwrapped subject and body)\n '%an', // author name\n '%ae', // author email\n '%at', // author date, UNIX timestamp\n '%cn', // committer name\n '%ce', // committer email\n '%ct', // committer date, UNIX timestamp\n '', // branch\n ];\n const output = await runGit(`git log -1 --pretty=format:\"${tokens.join(separator)}\" && git rev-parse --abbrev-ref HEAD`, gitDir);\n if (!output)\n return undefined;\n const [hash, shortHash, subject, body, authorName, authorEmail, authorTime, committerName, committerEmail, committerTime, branch] = output.split(separator);\n\n return {\n shortHash,\n hash,\n subject,\n body,\n author: {\n name: authorName,\n email: authorEmail,\n time: +authorTime * 1000,\n },\n committer: {\n name: committerName,\n email: committerEmail,\n time: +committerTime * 1000,\n },\n branch: branch.trim(),\n };\n}\n\nasync function gitDiff(gitDir: string, ci?: CIInfo): Promise<string | undefined> {\n const diffLimit = 100_000;\n if (ci?.prBaseHash) {\n // https://git-scm.com/docs/git-fetch\n await runGit(`git fetch origin ${ci.prBaseHash} --depth=1 --no-auto-maintenance --no-auto-gc --no-tags --no-recurse-submodules`, gitDir);\n const diff = await runGit(`git diff ${ci.prBaseHash} HEAD`, gitDir);\n if (diff)\n return diff.substring(0, diffLimit);\n }\n\n // Do not attempt to diff on CI commit.\n if (ci)\n return;\n\n // Check dirty state first.\n const uncommitted = await runGit('git diff', gitDir);\n if (uncommitted === undefined) {\n // Failed to run git diff.\n return;\n }\n if (uncommitted)\n return uncommitted.substring(0, diffLimit);\n\n // Assume non-shallow checkout on local.\n const diff = await runGit('git diff HEAD~1', gitDir);\n return diff?.substring(0, diffLimit);\n}\n\nasync function runGit(command: string, cwd: string): Promise<string | undefined> {\n debug(`running \"${command}\"`);\n const start = monotonicTime();\n const result = await spawnAsync(\n command,\n [],\n { stdio: 'pipe', cwd, timeout: GIT_OPERATIONS_TIMEOUT_MS, shell: true }\n );\n if (monotonicTime() - start > GIT_OPERATIONS_TIMEOUT_MS) {\n print(`timeout of ${GIT_OPERATIONS_TIMEOUT_MS}ms exceeded while running \"${command}\"`);\n return;\n }\n if (result.code)\n debug(`failure, code=${result.code}\\n\\n${result.stderr}`);\n else\n debug(`success`);\n return result.code ? undefined : result.stdout.trim();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAA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AO,KAAK;AAAA,EAC1E;AACA,UAAI,4BAAc,IAAI,QAAQ,2BAA2B;AACvD,UAAM,cAAc,yBAAyB,8BAA8B,OAAO,GAAG;AACrF;AAAA,EACF;AACA,MAAI,OAAO;AACT,UAAM,iBAAiB,OAAO,IAAI;AAAA;AAAA,EAAO,OAAO,MAAM,EAAE;AAAA;AAExD,UAAM,SAAS;AACjB,SAAO,OAAO,OAAO,SAAY,OAAO,OAAO,KAAK;AACtD;",
|
|
6
|
-
"names": ["diff"]
|
|
7
|
-
}
|
package/lib/plugins/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/plugins/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FullConfig, Suite } from '../../types/testReporter';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\nexport interface TestRunnerPlugin {\n name: string;\n setup?(config: FullConfig, configDir: string, reporter: ReporterV2): Promise<void>;\n populateDependencies?(): Promise<void>;\n startDevServer?(): Promise<() => Promise<void>>;\n clearCache?(): Promise<void>;\n begin?(suite: Suite): Promise<void>;\n end?(): Promise<void>;\n teardown?(): Promise<void>;\n}\n\nexport type TestRunnerPluginRegistration = {\n factory: TestRunnerPlugin | (() => TestRunnerPlugin | Promise<TestRunnerPlugin>);\n instance?: TestRunnerPlugin;\n devServerCleanup?: any;\n};\n\nexport { webServer } from './webServerPlugin';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCA,6BAA0B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/plugins/webServerPlugin.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport net from 'net';\nimport path from 'path';\n\nimport { launchProcess, isURLAvailable, monotonicTime, raceAgainstDeadline, ManualPromise } from 'playwright-core/lib/utils';\nimport { colors } from 'playwright-core/lib/utils';\nimport { debug } from 'playwright-core/lib/utilsBundle';\n\nimport type { TestRunnerPlugin } from '.';\nimport type { FullConfig } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\n\nexport type WebServerPluginOptions = {\n command: string;\n url?: string;\n wait?: { stdout?: RegExp, stderr?: RegExp, time?: number };\n ignoreHTTPSErrors?: boolean;\n timeout?: number;\n gracefulShutdown?: { signal: 'SIGINT' | 'SIGTERM', timeout?: number };\n reuseExistingServer?: boolean;\n cwd?: string;\n env?: { [key: string]: string; };\n stdout?: 'pipe' | 'ignore';\n stderr?: 'pipe' | 'ignore';\n name?: string;\n};\n\nconst DEFAULT_ENVIRONMENT_VARIABLES = {\n 'BROWSER': 'none', // Disable that create-react-app will open the page in the browser\n 'FORCE_COLOR': '1',\n 'DEBUG_COLORS': '1',\n};\n\nconst debugWebServer = debug('pw:webserver');\n\nexport class WebServerPlugin implements TestRunnerPlugin {\n private _isAvailableCallback?: () => Promise<boolean>;\n private _killProcess?: () => Promise<void>;\n private _processExitedPromise!: Promise<any>;\n private _options: WebServerPluginOptions;\n private _checkPortOnly: boolean;\n private _reporter?: ReporterV2;\n private _waitForStdioPromise: ManualPromise | undefined;\n\n name = 'playwright:webserver';\n\n constructor(options: WebServerPluginOptions, checkPortOnly: boolean) {\n this._options = options;\n this._checkPortOnly = checkPortOnly;\n }\n\n public async setup(config: FullConfig, configDir: string, reporter: ReporterV2) {\n this._reporter = reporter;\n this._isAvailableCallback = this._options.url ? getIsAvailableFunction(this._options.url, this._checkPortOnly, !!this._options.ignoreHTTPSErrors, this._reporter.onStdErr?.bind(this._reporter)) : undefined;\n this._options.cwd = this._options.cwd ? path.resolve(configDir, this._options.cwd) : configDir;\n try {\n await this._startProcess();\n await this._waitForProcess();\n } catch (error) {\n await this.teardown();\n throw error;\n }\n }\n\n public async teardown() {\n debugWebServer(`Terminating the WebServer`);\n await this._killProcess?.();\n debugWebServer(`Terminated the WebServer`);\n }\n\n private async _startProcess(): Promise<void> {\n let processExitedReject = (error: Error) => { };\n this._processExitedPromise = new Promise((_, reject) => processExitedReject = reject);\n\n const isAlreadyAvailable = await this._isAvailableCallback?.();\n if (isAlreadyAvailable) {\n debugWebServer(`WebServer is already available`);\n if (this._options.reuseExistingServer)\n return;\n const port = new URL(this._options.url!).port;\n throw new Error(`${this._options.url ?? `http://localhost${port ? ':' + port : ''}`} is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer.`);\n }\n\n if (!this._options.command)\n throw new Error('config.webServer.command cannot be empty');\n\n debugWebServer(`Starting WebServer process ${this._options.command}...`);\n const { launchedProcess, gracefullyClose } = await launchProcess({\n command: this._options.command,\n env: {\n ...DEFAULT_ENVIRONMENT_VARIABLES,\n ...process.env,\n ...this._options.env,\n },\n cwd: this._options.cwd,\n stdio: 'stdin',\n shell: true,\n attemptToGracefullyClose: async () => {\n if (process.platform === 'win32')\n throw new Error('Graceful shutdown is not supported on Windows');\n if (!this._options.gracefulShutdown)\n throw new Error('skip graceful shutdown');\n\n const { signal, timeout = 0 } = this._options.gracefulShutdown;\n\n // proper usage of SIGINT is to send it to the entire process group, see https://www.cons.org/cracauer/sigint.html\n // there's no such convention for SIGTERM, so we decide what we want. signaling the process group for consistency.\n process.kill(-launchedProcess.pid!, signal);\n\n return new Promise<void>((resolve, reject) => {\n const timer = timeout !== 0\n ? setTimeout(() => reject(new Error(`process didn't close gracefully within timeout`)), timeout)\n : undefined;\n launchedProcess.once('close', (...args) => {\n clearTimeout(timer);\n resolve();\n });\n });\n },\n log: () => {},\n onExit: code => processExitedReject(new Error(code ? `Process from config.webServer was not able to start. Exit code: ${code}` : 'Process from config.webServer exited early.')),\n tempDirectories: [],\n });\n this._killProcess = gracefullyClose;\n\n debugWebServer(`Process started`);\n\n if (this._options.wait?.stdout || this._options.wait?.stderr)\n this._waitForStdioPromise = new ManualPromise();\n let stdoutWaitCollector = this._options.wait?.stdout ? '' : undefined;\n let stderrWaitCollector = this._options.wait?.stderr ? '' : undefined;\n\n const resolveStdioPromise = () => {\n stderrWaitCollector = undefined;\n stdoutWaitCollector = undefined;\n this._waitForStdioPromise?.resolve();\n };\n\n launchedProcess.stderr!.on('data', data => {\n if (stderrWaitCollector !== undefined) {\n stderrWaitCollector += data.toString();\n if (this._options.wait?.stderr?.test(stderrWaitCollector))\n resolveStdioPromise();\n }\n\n if (debugWebServer.enabled || (this._options.stderr === 'pipe' || !this._options.stderr))\n this._reporter!.onStdErr?.(prefixOutputLines(data.toString(), this._options.name));\n });\n\n launchedProcess.stdout!.on('data', data => {\n if (stdoutWaitCollector !== undefined) {\n stdoutWaitCollector += data.toString();\n if (this._options.wait?.stdout?.test(stdoutWaitCollector))\n resolveStdioPromise();\n }\n\n if (debugWebServer.enabled || this._options.stdout === 'pipe')\n this._reporter!.onStdOut?.(prefixOutputLines(data.toString(), this._options.name));\n });\n }\n\n private async _waitForProcess() {\n // options.time is immune to the timeout.\n if (this._options.wait?.time)\n await new Promise(resolve => setTimeout(resolve, this._options.wait!.time));\n\n if (!this._isAvailableCallback && !this._waitForStdioPromise) {\n this._processExitedPromise.catch(() => {});\n return;\n }\n\n debugWebServer(`Waiting for availability...`);\n const launchTimeout = this._options.timeout || 60 * 1000;\n const cancellationToken = { canceled: false };\n const deadline = monotonicTime() + launchTimeout;\n\n const racingPromises = [this._processExitedPromise];\n if (this._isAvailableCallback)\n racingPromises.push(raceAgainstDeadline(() => waitFor(this._isAvailableCallback!, cancellationToken), deadline));\n if (this._waitForStdioPromise)\n racingPromises.push(raceAgainstDeadline(() => this._waitForStdioPromise!, deadline));\n\n const { timedOut } = await Promise.race(racingPromises);\n cancellationToken.canceled = true;\n if (timedOut)\n throw new Error(`Timed out waiting ${launchTimeout}ms from config.webServer.`);\n debugWebServer(`WebServer available`);\n }\n}\n\nasync function isPortUsed(port: number): Promise<boolean> {\n const innerIsPortUsed = (host: string) => new Promise<boolean>(resolve => {\n const conn = net\n .connect(port, host)\n .on('error', () => {\n resolve(false);\n })\n .on('connect', () => {\n conn.end();\n resolve(true);\n });\n });\n return await innerIsPortUsed('127.0.0.1') || await innerIsPortUsed('::1');\n}\n\nasync function waitFor(waitFn: () => Promise<boolean>, cancellationToken: { canceled: boolean }) {\n const logScale = [100, 250, 500];\n while (!cancellationToken.canceled) {\n const connected = await waitFn();\n if (connected)\n return;\n const delay = logScale.shift() || 1000;\n debugWebServer(`Waiting ${delay}ms`);\n await new Promise(x => setTimeout(x, delay));\n }\n}\n\nfunction getIsAvailableFunction(url: string, checkPortOnly: boolean, ignoreHTTPSErrors: boolean, onStdErr: ReporterV2['onStdErr']) {\n const urlObject = new URL(url);\n if (!checkPortOnly)\n return () => isURLAvailable(urlObject, ignoreHTTPSErrors, debugWebServer, onStdErr);\n const port = urlObject.port;\n return () => isPortUsed(+port);\n}\n\nexport const webServer = (options: WebServerPluginOptions): TestRunnerPlugin => {\n return new WebServerPlugin(options, false);\n};\n\nexport const webServerPluginsForConfig = (config: FullConfigInternal): TestRunnerPlugin[] => {\n const shouldSetBaseUrl = !!config.config.webServer;\n const webServerPlugins = [];\n for (const webServerConfig of config.webServers) {\n if (webServerConfig.port && webServerConfig.url)\n throw new Error(`Either 'port' or 'url' should be specified in config.webServer.`);\n\n let url: string | undefined;\n if (webServerConfig.port || webServerConfig.url) {\n url = webServerConfig.url || `http://localhost:${webServerConfig.port}`;\n\n // We only set base url when only the port is given. That's a legacy mode we have regrets about.\n if (shouldSetBaseUrl && !webServerConfig.url)\n process.env.PLAYWRIGHT_TEST_BASE_URL = url;\n }\n webServerPlugins.push(new WebServerPlugin({ ...webServerConfig, url }, webServerConfig.port !== undefined));\n }\n\n return webServerPlugins;\n};\n\nfunction prefixOutputLines(output: string, prefixName: string = 'WebServer'): string {\n const lastIsNewLine = output[output.length - 1] === '\\n';\n let lines = output.split('\\n');\n if (lastIsNewLine)\n lines.pop();\n lines = lines.map(line => colors.dim(`[${prefixName}] `) + line);\n if (lastIsNewLine)\n lines.push('');\n return lines.join('\\n');\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,iBAAgB;AAChB,kBAAiB;AAEjB,mBAAiG;AACjG,IAAAA,gBAAuB;AACvB,yBAAsB;AAuBtB,MAAM,gCAAgC;AAAA,EACpC,WAAW;AAAA;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB;AAClB;AAEA,MAAM,qBAAiB,0BAAM,cAAc;AAEpC,MAAM,gBAA4C;AAAA,EAWvD,YAAY,SAAiC,eAAwB;AAFrE,gBAAO;AAGL,SAAK,WAAW;AAChB,SAAK,iBAAiB;AAAA,EACxB;AAAA,EAEA,MAAa,MAAM,QAAoB,WAAmB,UAAsB;AAC9E,SAAK,YAAY;AACjB,SAAK,uBAAuB,KAAK,SAAS,MAAM,uBAAuB,KAAK,SAAS,KAAK,KAAK,gBAAgB,CAAC,CAAC,KAAK,SAAS,mBAAmB,K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IAAI,2BAA2B;AAAA,IAC3C;AACA,qBAAiB,KAAK,IAAI,gBAAgB,EAAE,GAAG,iBAAkB,IAAI,GAAG,gBAAgB,SAAS,MAAS,CAAC;AAAA,EAC7G;AAEA,SAAO;AACT;AAEA,SAAS,kBAAkB,QAAgB,aAAqB,aAAqB;AACnF,QAAM,gBAAgB,OAAO,OAAO,SAAS,CAAC,MAAM;AACpD,MAAI,QAAQ,OAAO,MAAM,IAAI;AAC7B,MAAI;AACF,UAAM,IAAI;AACZ,UAAQ,MAAM,IAAI,UAAQ,qBAAO,IAAI,IAAI,UAAU,IAAI,IAAI,IAAI;AAC/D,MAAI;AACF,UAAM,KAAK,EAAE;AACf,SAAO,MAAM,KAAK,IAAI;AACxB;",
|
|
6
|
-
"names": ["import_utils", "path", "net"]
|
|
7
|
-
}
|
package/lib/program.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/program.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable no-console */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { program } from 'playwright-core/lib/cli/program';\nimport { gracefullyProcessExitDoNotHang, startProfiling, stopProfiling } from 'playwright-core/lib/utils';\n\nimport { builtInReporters, defaultReporter, defaultTimeout } from './common/config';\nimport { loadConfigFromFile, loadEmptyConfigForMergeReports, resolveConfigLocation } from './common/configLoader';\nexport { program } from 'playwright-core/lib/cli/program';\nimport { terminalScreen } from './reporters/base';\nimport { showHTMLReport } from './reporters/html';\nimport { createMergedReport } from './reporters/merge';\nimport { filterProjects } from './runner/projectUtils';\nimport * as testServer from './runner/testServer';\nimport { runWatchModeLoop } from './runner/watchMode';\nimport { runAllTestsWithConfig, TestRunner } from './runner/testRunner';\nimport { createErrorCollectingReporter } from './runner/reporters';\nimport { ServerBackendFactory, runMainBackend } from './mcp/sdk/exports';\nimport { TestServerBackend } from './mcp/test/testBackend';\nimport { decorateCommand } from './mcp/program';\nimport { setupExitWatchdog } from './mcp/browser/watchdog';\nimport { ClaudeGenerator, OpencodeGenerator, VSCodeGenerator, CopilotGenerator } from './agents/generateAgents';\n\nimport type { ConfigCLIOverrides } from './common/ipc';\nimport type { TraceMode } from '../types/test';\nimport type { ReporterDescription } from '../types/test';\nimport type { Command } from 'playwright-core/lib/utilsBundle';\n\nconst packageJSON = require('../package.json');\n\nfunction addTestCommand(program: Command) {\n const command = program.command('test [test-filter...]');\n command.description('run tests with Playwright Test');\n const options = testOptions.sort((a, b) => a[0].replace(/-/g, '').localeCompare(b[0].replace(/-/g, '')));\n options.forEach(([name, { description, choices, preset }]) => {\n const option = command.createOption(name, description);\n if (choices)\n option.choices(choices);\n if (preset)\n option.preset(preset);\n // We don't set the default value here, because we want not specified options to\n // fall back to the user config, which we haven't parsed yet.\n command.addOption(option);\n return command;\n });\n command.action(async (args, opts) => {\n try {\n await runTests(args, opts);\n } catch (e) {\n console.error(e);\n gracefullyProcessExitDoNotHang(1);\n }\n });\n command.addHelpText('afterAll', `\nArguments [test-filter...]:\n Pass arguments to filter test files. Each argument is treated as a regular expression. Matching is performed against the absolute file paths.\n\nExamples:\n $ npx playwright test my.spec.ts\n $ npx playwright test some.spec.ts:42\n $ npx playwright test --headed\n $ npx playwright test --project=webkit`);\n}\n\nfunction addClearCacheCommand(program: Command) {\n const command = program.command('clear-cache');\n command.description('clears build and test caches');\n command.option('-c, --config <file>', `Configuration file, or a test directory with optional \"playwright.config.{m,c}?{js,ts}\"`);\n command.action(async opts => {\n const runner = new TestRunner(resolveConfigLocation(opts.config), {});\n const { status } = await runner.clearCache(createErrorCollectingReporter(terminalScreen));\n const exitCode = status === 'interrupted' ? 130 : (status === 'passed' ? 0 : 1);\n gracefullyProcessExitDoNotHang(exitCode);\n });\n}\n\nfunction addDevServerCommand(program: Command) {\n const command = program.command('dev-server', { hidden: true });\n command.description('start dev server');\n command.option('-c, --config <file>', `Configuration file, or a test directory with optional \"playwright.config.{m,c}?{js,ts}\"`);\n command.action(async options => {\n const runner = new TestRunner(resolveConfigLocation(options.config), {});\n await runner.startDevServer(createErrorCollectingReporter(terminalScreen), 'in-process');\n });\n}\n\nfunction addTestServerCommand(program: Command) {\n const command = program.command('test-server', { hidden: true });\n command.description('start test server');\n command.option('-c, --config <file>', `Configuration file, or a test directory with optional \"playwright.config.{m,c}?{js,ts}\"`);\n command.option('--host <host>', 'Host to start the server on', 'localhost');\n command.option('--port <port>', 'Port to start the server on', '0');\n command.action(opts => runTestServer(opts));\n}\n\nfunction addShowReportCommand(program: Command) {\n const command = program.command('show-report [report]');\n command.description('show HTML report');\n command.action((report, options) => showHTMLReport(report, options.host, +options.port));\n command.option('--host <host>', 'Host to serve report on', 'localhost');\n command.option('--port <port>', 'Port to serve report on', '9323');\n command.addHelpText('afterAll', `\nArguments [report]:\n When specified, opens given report, otherwise opens last generated report.\n\nExamples:\n $ npx playwright show-report\n $ npx playwright show-report playwright-report`);\n}\n\nfunction addMergeReportsCommand(program: Command) {\n const command = program.command('merge-reports [dir]');\n command.description('merge multiple blob reports (for sharded tests) into a single report');\n command.action(async (dir, options) => {\n try {\n await mergeReports(dir, options);\n } catch (e) {\n console.error(e);\n gracefullyProcessExitDoNotHang(1);\n }\n });\n command.option('-c, --config <file>', `Configuration file. Can be used to specify additional configuration for the output report.`);\n command.option('--reporter <reporter>', `Reporter to use, comma-separated, can be ${builtInReporters.map(name => `\"${name}\"`).join(', ')} (default: \"${defaultReporter}\")`);\n command.addHelpText('afterAll', `\nArguments [dir]:\n Directory containing blob reports.\n\nExamples:\n $ npx playwright merge-reports playwright-report`);\n}\n\nfunction addBrowserMCPServerCommand(program: Command) {\n const command = program.command('run-mcp-server', { hidden: true });\n command.description('Interact with the browser over MCP');\n decorateCommand(command, packageJSON.version);\n}\n\nfunction addTestMCPServerCommand(program: Command) {\n const command = program.command('run-test-mcp-server', { hidden: true });\n command.description('Interact with the test runner over MCP');\n command.option('--headless', 'run browser in headless mode, headed by default');\n command.option('-c, --config <file>', `Configuration file, or a test directory with optional \"playwright.config.{m,c}?{js,ts}\"`);\n command.option('--host <host>', 'host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.');\n command.option('--port <port>', 'port to listen on for SSE transport.');\n command.action(async options => {\n setupExitWatchdog();\n const backendFactory: ServerBackendFactory = {\n name: 'Playwright Test Runner',\n nameInConfig: 'playwright-test-runner',\n version: packageJSON.version,\n config: {} as any, // Test runner doesn't use MCP config\n create: () => new TestServerBackend(options.config, { muteConsole: options.port === undefined, headless: options.headless }),\n };\n const mdbUrl = await runMainBackend(\n backendFactory,\n {\n port: options.port === undefined ? undefined : +options.port\n },\n );\n if (mdbUrl)\n console.error('MCP Listening on: ', mdbUrl);\n });\n}\n\nfunction addInitAgentsCommand(program: Command) {\n const command = program.command('init-agents');\n command.description('Initialize repository agents');\n const option = command.createOption('--loop <loop>', 'Agentic loop provider');\n option.choices(['claude', 'copilot', 'opencode', 'vscode', 'vscode-legacy']);\n command.addOption(option);\n command.option('-c, --config <file>', `Configuration file to find a project to use for seed test`);\n command.option('--project <project>', 'Project to use for seed test');\n command.option('--prompts', 'Whether to include prompts in the agent initialization');\n command.action(async opts => {\n const config = await loadConfigFromFile(opts.config);\n if (opts.loop === 'opencode') {\n await OpencodeGenerator.init(config, opts.project, opts.prompts);\n } else if (opts.loop === 'vscode-legacy') {\n await VSCodeGenerator.init(config, opts.project);\n } else if (opts.loop === 'claude') {\n await ClaudeGenerator.init(config, opts.project, opts.prompts);\n } else {\n await CopilotGenerator.init(config, opts.project, opts.prompts);\n return;\n }\n });\n}\n\nasync function runTests(args: string[], opts: { [key: string]: any }) {\n await startProfiling();\n const cliOverrides = overridesFromOptions(opts);\n\n const config = await loadConfigFromFile(opts.config, cliOverrides, opts.deps === false);\n config.cliArgs = args;\n config.cliGrep = opts.grep as string | undefined;\n config.cliOnlyChanged = opts.onlyChanged === true ? 'HEAD' : opts.onlyChanged;\n config.cliGrepInvert = opts.grepInvert as string | undefined;\n config.cliListOnly = !!opts.list;\n config.cliProjectFilter = opts.project || undefined;\n config.cliPassWithNoTests = !!opts.passWithNoTests;\n config.cliLastFailed = !!opts.lastFailed;\n config.cliTestList = opts.testList ? path.resolve(process.cwd(), opts.testList) : undefined;\n config.cliTestListInvert = opts.testListInvert ? path.resolve(process.cwd(), opts.testListInvert) : undefined;\n\n // Evaluate project filters against config before starting execution. This enables a consistent error message across run modes\n filterProjects(config.projects, config.cliProjectFilter);\n\n if (opts.ui || opts.uiHost || opts.uiPort) {\n if (opts.onlyChanged)\n throw new Error(`--only-changed is not supported in UI mode. If you'd like that to change, see https://github.com/microsoft/playwright/issues/15075 for more details.`);\n\n const status = await testServer.runUIMode(opts.config, cliOverrides, {\n host: opts.uiHost,\n port: opts.uiPort ? +opts.uiPort : undefined,\n args,\n grep: opts.grep as string | undefined,\n grepInvert: opts.grepInvert as string | undefined,\n project: opts.project || undefined,\n reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : undefined,\n });\n await stopProfiling('runner');\n const exitCode = status === 'interrupted' ? 130 : (status === 'passed' ? 0 : 1);\n gracefullyProcessExitDoNotHang(exitCode);\n return;\n }\n\n if (process.env.PWTEST_WATCH) {\n if (opts.onlyChanged)\n throw new Error(`--only-changed is not supported in watch mode. If you'd like that to change, file an issue and let us know about your usecase for it.`);\n\n const status = await runWatchModeLoop(\n resolveConfigLocation(opts.config),\n {\n projects: opts.project,\n files: args,\n grep: opts.grep\n }\n );\n await stopProfiling('runner');\n const exitCode = status === 'interrupted' ? 130 : (status === 'passed' ? 0 : 1);\n gracefullyProcessExitDoNotHang(exitCode);\n return;\n }\n\n const status = await runAllTestsWithConfig(config);\n await stopProfiling('runner');\n const exitCode = status === 'interrupted' ? 130 : (status === 'passed' ? 0 : 1);\n gracefullyProcessExitDoNotHang(exitCode);\n}\n\nasync function runTestServer(opts: { [key: string]: any }) {\n const host = opts.host || 'localhost';\n const port = opts.port ? +opts.port : 0;\n const status = await testServer.runTestServer(opts.config, { }, { host, port });\n const exitCode = status === 'interrupted' ? 130 : (status === 'passed' ? 0 : 1);\n gracefullyProcessExitDoNotHang(exitCode);\n}\n\nasync function mergeReports(reportDir: string | undefined, opts: { [key: string]: any }) {\n const configFile = opts.config;\n const config = configFile ? await loadConfigFromFile(configFile) : await loadEmptyConfigForMergeReports();\n\n const dir = path.resolve(process.cwd(), reportDir || '');\n const dirStat = await fs.promises.stat(dir).catch(e => null);\n if (!dirStat)\n throw new Error('Directory does not exist: ' + dir);\n if (!dirStat.isDirectory())\n throw new Error(`\"${dir}\" is not a directory`);\n let reporterDescriptions: ReporterDescription[] | undefined = resolveReporterOption(opts.reporter);\n if (!reporterDescriptions && configFile)\n reporterDescriptions = config.config.reporter;\n if (!reporterDescriptions)\n reporterDescriptions = [[defaultReporter]];\n const rootDirOverride = configFile ? config.config.rootDir : undefined;\n await createMergedReport(config, dir, reporterDescriptions!, rootDirOverride);\n gracefullyProcessExitDoNotHang(0);\n}\n\nfunction overridesFromOptions(options: { [key: string]: any }): ConfigCLIOverrides {\n const overrides: ConfigCLIOverrides = {\n failOnFlakyTests: options.failOnFlakyTests ? true : undefined,\n forbidOnly: options.forbidOnly ? true : undefined,\n fullyParallel: options.fullyParallel ? true : undefined,\n globalTimeout: options.globalTimeout ? parseInt(options.globalTimeout, 10) : undefined,\n maxFailures: options.x ? 1 : (options.maxFailures ? parseInt(options.maxFailures, 10) : undefined),\n outputDir: options.output ? path.resolve(process.cwd(), options.output) : undefined,\n quiet: options.quiet ? options.quiet : undefined,\n repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : undefined,\n retries: options.retries ? parseInt(options.retries, 10) : undefined,\n reporter: resolveReporterOption(options.reporter),\n shard: resolveShardOption(options.shard),\n timeout: options.timeout ? parseInt(options.timeout, 10) : undefined,\n tsconfig: options.tsconfig ? path.resolve(process.cwd(), options.tsconfig) : undefined,\n ignoreSnapshots: options.ignoreSnapshots ? !!options.ignoreSnapshots : undefined,\n updateSnapshots: options.updateSnapshots,\n updateSourceMethod: options.updateSourceMethod,\n workers: options.workers,\n };\n\n if (options.browser) {\n const browserOpt = options.browser.toLowerCase();\n if (!['all', 'chromium', 'firefox', 'webkit'].includes(browserOpt))\n throw new Error(`Unsupported browser \"${options.browser}\", must be one of \"all\", \"chromium\", \"firefox\" or \"webkit\"`);\n const browserNames = browserOpt === 'all' ? ['chromium', 'firefox', 'webkit'] : [browserOpt];\n overrides.projects = browserNames.map(browserName => {\n return {\n name: browserName,\n use: { browserName },\n };\n });\n }\n\n if (options.headed || options.debug)\n overrides.use = { headless: false };\n if (!options.ui && options.debug) {\n overrides.debug = true;\n process.env.PWDEBUG = '1';\n }\n if (!options.ui && options.trace) {\n overrides.use = overrides.use || {};\n overrides.use.trace = options.trace;\n }\n if (overrides.tsconfig && !fs.existsSync(overrides.tsconfig))\n throw new Error(`--tsconfig \"${options.tsconfig}\" does not exist`);\n\n return overrides;\n}\n\nfunction resolveReporterOption(reporter?: string): ReporterDescription[] | undefined {\n if (!reporter || !reporter.length)\n return undefined;\n return reporter.split(',').map((r: string) => [resolveReporter(r)]);\n}\n\nfunction resolveShardOption(shard?: string): ConfigCLIOverrides['shard'] {\n if (!shard)\n return undefined;\n\n const shardPair = shard.split('/');\n\n if (shardPair.length !== 2) {\n throw new Error(\n `--shard \"${shard}\", expected format is \"current/all\", 1-based, for example \"3/5\".`,\n );\n }\n\n const current = parseInt(shardPair[0], 10);\n const total = parseInt(shardPair[1], 10);\n\n if (isNaN(total) || total < 1)\n throw new Error(`--shard \"${shard}\" total must be a positive number`);\n\n\n if (isNaN(current) || current < 1 || current > total) {\n throw new Error(\n `--shard \"${shard}\" current must be a positive number, not greater than shard total`,\n );\n }\n\n return { current, total };\n}\n\nfunction resolveReporter(id: string) {\n if (builtInReporters.includes(id as any))\n return id;\n const localPath = path.resolve(process.cwd(), id);\n if (fs.existsSync(localPath))\n return localPath;\n return require.resolve(id, { paths: [process.cwd()] });\n}\n\nconst kTraceModes: TraceMode[] = ['on', 'off', 'on-first-retry', 'on-all-retries', 'retain-on-failure', 'retain-on-first-failure'];\n\n// Note: update docs/src/test-cli-js.md when you update this, program is the source of truth.\n\nconst testOptions: [string, { description: string, choices?: string[], preset?: string }][] = [\n /* deprecated */ ['--browser <browser>', { description: `Browser to use for tests, one of \"all\", \"chromium\", \"firefox\" or \"webkit\" (default: \"chromium\")` }],\n ['-c, --config <file>', { description: `Configuration file, or a test directory with optional \"playwright.config.{m,c}?{js,ts}\"` }],\n ['--debug', { description: `Run tests with Playwright Inspector. Shortcut for \"PWDEBUG=1\" environment variable and \"--timeout=0 --max-failures=1 --headed --workers=1\" options` }],\n ['--fail-on-flaky-tests', { description: `Fail if any test is flagged as flaky (default: false)` }],\n ['--forbid-only', { description: `Fail if test.only is called (default: false)` }],\n ['--fully-parallel', { description: `Run all tests in parallel (default: false)` }],\n ['--global-timeout <timeout>', { description: `Maximum time this test suite can run in milliseconds (default: unlimited)` }],\n ['-g, --grep <grep>', { description: `Only run tests matching this regular expression (default: \".*\")` }],\n ['--grep-invert <grep>', { description: `Only run tests that do not match this regular expression` }],\n ['--headed', { description: `Run tests in headed browsers (default: headless)` }],\n ['--ignore-snapshots', { description: `Ignore screenshot and snapshot expectations` }],\n ['--last-failed', { description: `Only re-run the failures` }],\n ['--list', { description: `Collect all the tests and report them, but do not run` }],\n ['--max-failures <N>', { description: `Stop after the first N failures` }],\n ['--no-deps', { description: `Do not run project dependencies` }],\n ['--output <dir>', { description: `Folder for output artifacts (default: \"test-results\")` }],\n ['--only-changed [ref]', { description: `Only run test files that have been changed between 'HEAD' and 'ref'. Defaults to running all uncommitted changes. Only supports Git.` }],\n ['--pass-with-no-tests', { description: `Makes test run succeed even if no tests were found` }],\n ['--project <project-name...>', { description: `Only run tests from the specified list of projects, supports '*' wildcard (default: run all projects)` }],\n ['--quiet', { description: `Suppress stdio` }],\n ['--repeat-each <N>', { description: `Run each test N times (default: 1)` }],\n ['--reporter <reporter>', { description: `Reporter to use, comma-separated, can be ${builtInReporters.map(name => `\"${name}\"`).join(', ')} (default: \"${defaultReporter}\")` }],\n ['--retries <retries>', { description: `Maximum retry count for flaky tests, zero for no retries (default: no retries)` }],\n ['--shard <shard>', { description: `Shard tests and execute only the selected shard, specify in the form \"current/all\", 1-based, for example \"3/5\"` }],\n ['--test-list <file>', { description: `Path to a file containing a list of tests to run. See https://playwright.dev/docs/test-cli for more details.` }],\n ['--test-list-invert <file>', { description: `Path to a file containing a list of tests to skip. See https://playwright.dev/docs/test-cli for more details.` }],\n ['--timeout <timeout>', { description: `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${defaultTimeout})` }],\n ['--trace <mode>', { description: `Force tracing mode`, choices: kTraceModes as string[] }],\n ['--tsconfig <path>', { description: `Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately)` }],\n ['--ui', { description: `Run tests in interactive UI mode` }],\n ['--ui-host <host>', { description: `Host to serve UI on; specifying this option opens UI in a browser tab` }],\n ['--ui-port <port>', { description: `Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab` }],\n ['-u, --update-snapshots [mode]', { description: `Update snapshots with actual results. Running tests without the flag defaults to \"missing\"`, choices: ['all', 'changed', 'missing', 'none'], preset: 'changed' }],\n ['--update-source-method <method>', { description: `Chooses the way source is updated (default: \"patch\")`, choices: ['overwrite', '3way', 'patch'] }],\n ['-j, --workers <workers>', { description: `Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%)` }],\n ['-x', { description: `Stop after the first failure` }],\n];\n\naddTestCommand(program);\naddShowReportCommand(program);\naddMergeReportsCommand(program);\naddClearCacheCommand(program);\naddBrowserMCPServerCommand(program);\naddTestMCPServerCommand(program);\naddDevServerCommand(program);\naddTestServerCommand(program);\naddInitAgentsCommand(program);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,gBAAe;AACf,kBAAiB;AAEjB,qBAAwB;AACxB,mBAA8E;AAE9E,oBAAkE;AAClE,0BAA0F;AAC1F,IAAAA,kBAAwB;AACxB,kBAA+B;AAC/B,kBAA+B;AAC/B,mBAAmC;AACnC,0BAA+B;AAC/B,iBAA4B;AAC5B,uBAAiC;AACjC,wBAAkD;AAClD,uBAA8C;AAC9C,qBAAqD;AACrD,yBAAkC;AAClC,IAAAA,kBAAgC;AAChC,sBAAkC;AAClC,4BAAsF;AAOtF,MAAM,cAAc,QAAQ,iBAAiB;AAE7C,SAAS,eAAeC,UAAkB;AACxC,QAAM,UAAUA,SAAQ,QAAQ,uBAAuB;AACvD,UAAQ,YAAY,gCAAgC;AACpD,QAAM,UAAU,YAAY,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,QAAQ,MAAM,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,MAAM,EAAE,CAAC,CAAC;AACvG,UAAQ,QAAQ,CAAC,CAAC,MAAM,EAAE,aAAa,SAAS,OAAO,CAAC,MAAM;AAC5D,UAAM,SAAS,QAAQ,aAAa,MAAM,WAAW;AACrD,QAAI;AACF,aAAO,QAAQ,OAAO;AACxB,QAAI;AACF,aAAO,OAAO,MAAM;AAGtB,YAAQ,UAAU,MAAM;AACxB,WAAO;AAAA,EACT,CAAC;AACD,UAAQ,OAAO,OAAO,MAAM,SAAS;AACnC,QAAI;AACF,YAAM,SAAS,MAAM,IAAI;AAAA,IAC3B,SAAS,GAAG;AACV,cAAQ,MAAM,CAAC;AACf,uDAA+B,CAAC;AAAA,IAClC;AAAA,EAC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iC,EAAE,aAAa,8FAA8F,SAAS,CAAC,OAAO,WAAW,WAAW,MAAM,GAAG,QAAQ,UAAU,CAAC;AAAA,EAClN,CAAC,mCAAmC,EAAE,aAAa,wDAAwD,SAAS,CAAC,aAAa,QAAQ,OAAO,EAAE,CAAC;AAAA,EACpJ,CAAC,2BAA2B,EAAE,aAAa,kHAAkH,CAAC;AAAA,EAC9J,CAAC,MAAM,EAAE,aAAa,+BAA+B,CAAC;AACxD;AAEA,eAAe,sBAAO;AACtB,qBAAqB,sBAAO;AAC5B,uBAAuB,sBAAO;AAC9B,qBAAqB,sBAAO;AAC5B,2BAA2B,sBAAO;AAClC,wBAAwB,sBAAO;AAC/B,oBAAoB,sBAAO;AAC3B,qBAAqB,sBAAO;AAC5B,qBAAqB,sBAAO;",
|
|
6
|
-
"names": ["import_program", "program", "path", "status", "exitCode", "fs"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/base.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\n\nimport { getPackageManagerExecCommand, parseErrorStack } from 'playwright-core/lib/utils';\nimport { ms as milliseconds } from 'playwright-core/lib/utilsBundle';\nimport { colors as realColors, noColors } from 'playwright-core/lib/utils';\n\nimport { ansiRegex, resolveReporterOutputPath, stripAnsiEscapes } from '../util';\nimport { getEastAsianWidth } from '../utilsBundle';\n\nimport type { ReporterV2 } from './reporterV2';\nimport type { FullConfig, FullResult, Location, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\nimport type { Colors } from '@isomorphic/colors';\n\nexport type TestResultOutput = { chunk: string | Buffer, type: 'stdout' | 'stderr' };\nexport const kOutputSymbol = Symbol('output');\n\ntype ErrorDetails = {\n message: string;\n location?: Location;\n};\n\ntype TestSummary = {\n didNotRun: number;\n skipped: number;\n expected: number;\n interrupted: TestCase[];\n unexpected: TestCase[];\n flaky: TestCase[];\n failuresToPrint: TestCase[];\n fatalErrors: TestError[];\n};\n\nexport type CommonReporterOptions = {\n configDir: string,\n _mode?: 'list' | 'test' | 'merge',\n _commandHash?: string,\n};\n\nexport type Screen = {\n resolveFiles: 'cwd' | 'rootDir';\n colors: Colors;\n isTTY: boolean;\n ttyWidth: number;\n ttyHeight: number;\n stdout?: NodeJS.WriteStream;\n stderr?: NodeJS.WriteStream;\n};\n\nexport type TerminalScreen = Screen & {\n stdout: NodeJS.WriteStream;\n stderr: NodeJS.WriteStream;\n};\n\nconst DEFAULT_TTY_WIDTH = 100;\nconst DEFAULT_TTY_HEIGHT = 40;\n\n// eslint-disable-next-line no-restricted-properties\nconst originalProcessStdout = process.stdout;\n// eslint-disable-next-line no-restricted-properties\nconst originalProcessStderr = process.stderr;\n\n// Output goes to terminal.\nexport const terminalScreen: TerminalScreen = (() => {\n let isTTY = !!originalProcessStdout.isTTY;\n let ttyWidth = originalProcessStdout.columns || 0;\n let ttyHeight = originalProcessStdout.rows || 0;\n if (process.env.PLAYWRIGHT_FORCE_TTY === 'false' || process.env.PLAYWRIGHT_FORCE_TTY === '0') {\n isTTY = false;\n ttyWidth = 0;\n ttyHeight = 0;\n } else if (process.env.PLAYWRIGHT_FORCE_TTY === 'true' || process.env.PLAYWRIGHT_FORCE_TTY === '1') {\n isTTY = true;\n ttyWidth = originalProcessStdout.columns || DEFAULT_TTY_WIDTH;\n ttyHeight = originalProcessStdout.rows || DEFAULT_TTY_HEIGHT;\n } else if (process.env.PLAYWRIGHT_FORCE_TTY) {\n isTTY = true;\n const sizeMatch = process.env.PLAYWRIGHT_FORCE_TTY.match(/^(\\d+)x(\\d+)$/);\n if (sizeMatch) {\n ttyWidth = +sizeMatch[1];\n ttyHeight = +sizeMatch[2];\n } else {\n ttyWidth = +process.env.PLAYWRIGHT_FORCE_TTY;\n ttyHeight = DEFAULT_TTY_HEIGHT;\n }\n if (isNaN(ttyWidth))\n ttyWidth = DEFAULT_TTY_WIDTH;\n if (isNaN(ttyHeight))\n ttyHeight = DEFAULT_TTY_HEIGHT;\n }\n\n let useColors = isTTY;\n if (process.env.DEBUG_COLORS === '0' || process.env.DEBUG_COLORS === 'false' ||\n process.env.FORCE_COLOR === '0' || process.env.FORCE_COLOR === 'false')\n useColors = false;\n else if (process.env.DEBUG_COLORS || process.env.FORCE_COLOR)\n useColors = true;\n\n const colors = useColors ? realColors : noColors;\n return {\n resolveFiles: 'cwd',\n isTTY,\n ttyWidth,\n ttyHeight,\n colors,\n stdout: originalProcessStdout,\n stderr: originalProcessStderr,\n };\n})();\n\n// Output does not go to terminal, but colors are controlled with terminal env vars.\nexport const nonTerminalScreen: Screen = {\n colors: terminalScreen.colors,\n isTTY: false,\n ttyWidth: 0,\n ttyHeight: 0,\n resolveFiles: 'rootDir',\n};\n\n// Internal output for post-processing, should always contain real colors.\nexport const internalScreen: Screen = {\n colors: realColors,\n isTTY: false,\n ttyWidth: 0,\n ttyHeight: 0,\n resolveFiles: 'rootDir',\n};\n\nexport type TerminalReporterOptions = {\n screen?: TerminalScreen;\n omitFailures?: boolean;\n includeTestId?: boolean;\n};\n\nexport class TerminalReporter implements ReporterV2 {\n screen: TerminalScreen;\n config!: FullConfig;\n suite!: Suite;\n totalTestCount = 0;\n result!: FullResult;\n private fileDurations = new Map<string, { duration: number, workers: Set<number> }>();\n private _options: TerminalReporterOptions;\n private _fatalErrors: TestError[] = [];\n private _failureCount: number = 0;\n\n constructor(options: TerminalReporterOptions = {}) {\n this.screen = options.screen ?? terminalScreen;\n this._options = options;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: FullConfig) {\n this.config = config;\n }\n\n onBegin(suite: Suite) {\n this.suite = suite;\n this.totalTestCount = suite.allTests().length;\n }\n\n onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n this._appendOutput({ chunk, type: 'stdout' }, result);\n }\n\n onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n this._appendOutput({ chunk, type: 'stderr' }, result);\n }\n\n private _appendOutput(output: TestResultOutput, result: TestResult | undefined) {\n if (!result)\n return;\n (result as any)[kOutputSymbol] = (result as any)[kOutputSymbol] || [];\n (result as any)[kOutputSymbol].push(output);\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n if (result.status !== 'skipped' && result.status !== test.expectedStatus)\n ++this._failureCount;\n const projectName = test.titlePath()[1];\n const relativePath = relativeTestPath(this.screen, this.config, test);\n const fileAndProject = (projectName ? `[${projectName}] \u203A ` : '') + relativePath;\n const entry = this.fileDurations.get(fileAndProject) || { duration: 0, workers: new Set() };\n entry.duration += result.duration;\n entry.workers.add(result.workerIndex);\n this.fileDurations.set(fileAndProject, entry);\n }\n\n onError(error: TestError) {\n this._fatalErrors.push(error);\n }\n\n async onEnd(result: FullResult) {\n this.result = result;\n }\n\n protected fitToScreen(line: string, prefix?: string): string {\n if (!this.screen.ttyWidth) {\n // Guard against the case where we cannot determine available width.\n return line;\n }\n return fitToWidth(line, this.screen.ttyWidth, prefix);\n }\n\n protected generateStartingMessage() {\n const jobs = this.config.metadata.actualWorkers ?? this.config.workers;\n const shardDetails = this.config.shard ? `, shard ${this.config.shard.current} of ${this.config.shard.total}` : '';\n if (!this.totalTestCount)\n return '';\n return '\\n' + this.screen.colors.dim('Running ') + this.totalTestCount + this.screen.colors.dim(` test${this.totalTestCount !== 1 ? 's' : ''} using `) + jobs + this.screen.colors.dim(` worker${jobs !== 1 ? 's' : ''}${shardDetails}`);\n }\n\n protected getSlowTests(): [string, number][] {\n if (!this.config.reportSlowTests)\n return [];\n // Only pick durations that were served by single worker.\n const fileDurations = [...this.fileDurations.entries()].filter(([key, value]) => value.workers.size === 1).map(([key, value]) => [key, value.duration]) as [string, number][];\n fileDurations.sort((a, b) => b[1] - a[1]);\n const count = Math.min(fileDurations.length, this.config.reportSlowTests.max || Number.POSITIVE_INFINITY);\n const threshold = this.config.reportSlowTests.threshold;\n return fileDurations.filter(([, duration]) => duration > threshold).slice(0, count);\n }\n\n protected generateSummaryMessage({ didNotRun, skipped, expected, interrupted, unexpected, flaky, fatalErrors }: TestSummary) {\n const tokens: string[] = [];\n if (unexpected.length) {\n tokens.push(this.screen.colors.red(` ${unexpected.length} failed`));\n for (const test of unexpected)\n tokens.push(this.screen.colors.red(this.formatTestHeader(test, { indent: ' ' })));\n }\n if (interrupted.length) {\n tokens.push(this.screen.colors.yellow(` ${interrupted.length} interrupted`));\n for (const test of interrupted)\n tokens.push(this.screen.colors.yellow(this.formatTestHeader(test, { indent: ' ' })));\n }\n if (flaky.length) {\n tokens.push(this.screen.colors.yellow(` ${flaky.length} flaky`));\n for (const test of flaky)\n tokens.push(this.screen.colors.yellow(this.formatTestHeader(test, { indent: ' ' })));\n }\n if (skipped)\n tokens.push(this.screen.colors.yellow(` ${skipped} skipped`));\n if (didNotRun)\n tokens.push(this.screen.colors.yellow(` ${didNotRun} did not run`));\n if (expected)\n tokens.push(this.screen.colors.green(` ${expected} passed`) + this.screen.colors.dim(` (${milliseconds(this.result.duration)})`));\n if (fatalErrors.length && expected + unexpected.length + interrupted.length + flaky.length > 0)\n tokens.push(this.screen.colors.red(` ${fatalErrors.length === 1 ? '1 error was not a part of any test' : fatalErrors.length + ' errors were not a part of any test'}, see above for details`));\n\n return tokens.join('\\n');\n }\n\n protected generateSummary(): TestSummary {\n let didNotRun = 0;\n let skipped = 0;\n let expected = 0;\n const interrupted: TestCase[] = [];\n const interruptedToPrint: TestCase[] = [];\n const unexpected: TestCase[] = [];\n const flaky: TestCase[] = [];\n\n this.suite.allTests().forEach(test => {\n switch (test.outcome()) {\n case 'skipped': {\n if (test.results.some(result => result.status === 'interrupted')) {\n if (test.results.some(result => !!result.error))\n interruptedToPrint.push(test);\n interrupted.push(test);\n } else if (!test.results.length || test.expectedStatus !== 'skipped') {\n ++didNotRun;\n } else {\n ++skipped;\n }\n break;\n }\n case 'expected': ++expected; break;\n case 'unexpected': unexpected.push(test); break;\n case 'flaky': flaky.push(test); break;\n }\n });\n\n const failuresToPrint = [...unexpected, ...flaky, ...interruptedToPrint];\n return {\n didNotRun,\n skipped,\n expected,\n interrupted,\n unexpected,\n flaky,\n failuresToPrint,\n fatalErrors: this._fatalErrors,\n };\n }\n\n epilogue(full: boolean) {\n const summary = this.generateSummary();\n const summaryMessage = this.generateSummaryMessage(summary);\n if (full && summary.failuresToPrint.length && !this._options.omitFailures)\n this._printFailures(summary.failuresToPrint);\n this._printSlowTests();\n this._printSummary(summaryMessage);\n }\n\n private _printFailures(failures: TestCase[]) {\n this.writeLine('');\n failures.forEach((test, index) => {\n this.writeLine(this.formatFailure(test, index + 1));\n });\n }\n\n private _printSlowTests() {\n const slowTests = this.getSlowTests();\n slowTests.forEach(([file, duration]) => {\n this.writeLine(this.screen.colors.yellow(' Slow test file: ') + file + this.screen.colors.yellow(` (${milliseconds(duration)})`));\n });\n if (slowTests.length)\n this.writeLine(this.screen.colors.yellow(' Consider running tests from slow files in parallel. See: https://playwright.dev/docs/test-parallel'));\n }\n\n private _printSummary(summary: string) {\n if (summary.trim())\n this.writeLine(summary);\n }\n\n willRetry(test: TestCase): boolean {\n return test.outcome() === 'unexpected' && test.results.length <= test.retries;\n }\n\n formatTestTitle(test: TestCase, step?: TestStep): string {\n return formatTestTitle(this.screen, this.config, test, step, this._options);\n }\n\n formatTestHeader(test: TestCase, options: { indent?: string, index?: number, mode?: 'default' | 'error' } = {}): string {\n return formatTestHeader(this.screen, this.config, test, { ...options, includeTestId: this._options.includeTestId });\n }\n\n formatFailure(test: TestCase, index?: number): string {\n return formatFailure(this.screen, this.config, test, index, this._options);\n }\n\n formatError(error: TestError): ErrorDetails {\n return formatError(this.screen, error);\n }\n\n writeLine(line?: string) {\n this.screen.stdout?.write(line ? line + '\\n' : '\\n');\n }\n}\n\nexport function formatFailure(screen: Screen, config: FullConfig, test: TestCase, index?: number, options?: TerminalReporterOptions): string {\n const lines: string[] = [];\n const header = formatTestHeader(screen, config, test, { indent: ' ', index, mode: 'error', includeTestId: options?.includeTestId });\n lines.push(screen.colors.red(header));\n for (const result of test.results) {\n const resultLines: string[] = [];\n const errors = formatResultFailure(screen, test, result, ' ');\n if (!errors.length)\n continue;\n if (result.retry) {\n resultLines.push('');\n resultLines.push(screen.colors.gray(separator(screen, ` Retry #${result.retry}`)));\n }\n resultLines.push(...errors.map(error => '\\n' + error.message));\n const attachmentGroups = groupAttachments(result.attachments);\n for (let i = 0; i < attachmentGroups.length; ++i) {\n const attachment = attachmentGroups[i];\n if (attachment.name === 'error-context' && attachment.path) {\n resultLines.push('');\n resultLines.push(screen.colors.dim(` Error Context: ${relativeFilePath(screen, config, attachment.path)}`));\n continue;\n }\n\n if (attachment.name.startsWith('_'))\n continue;\n\n const hasPrintableContent = attachment.contentType.startsWith('text/');\n if (!attachment.path && !hasPrintableContent)\n continue;\n\n resultLines.push('');\n resultLines.push(screen.colors.dim(separator(screen, ` attachment #${i + 1}: ${screen.colors.bold(attachment.name)} (${attachment.contentType})`)));\n\n if (attachment.actual?.path) {\n if (attachment.expected?.path) {\n const expectedPath = relativeFilePath(screen, config, attachment.expected.path);\n resultLines.push(screen.colors.dim(` Expected: ${expectedPath}`));\n }\n const actualPath = relativeFilePath(screen, config, attachment.actual.path);\n resultLines.push(screen.colors.dim(` Received: ${actualPath}`));\n if (attachment.previous?.path) {\n const previousPath = relativeFilePath(screen, config, attachment.previous.path);\n resultLines.push(screen.colors.dim(` Previous: ${previousPath}`));\n }\n if (attachment.diff?.path) {\n const diffPath = relativeFilePath(screen, config, attachment.diff.path);\n resultLines.push(screen.colors.dim(` Diff: ${diffPath}`));\n }\n } else if (attachment.path) {\n const relativePath = relativeFilePath(screen, config, attachment.path);\n resultLines.push(screen.colors.dim(` ${relativePath}`));\n // Make this extensible\n if (attachment.name === 'trace') {\n const packageManagerCommand = getPackageManagerExecCommand();\n resultLines.push(screen.colors.dim(` Usage:`));\n resultLines.push('');\n resultLines.push(screen.colors.dim(` ${packageManagerCommand} playwright show-trace ${quotePathIfNeeded(relativePath)}`));\n resultLines.push('');\n }\n } else {\n if (attachment.contentType.startsWith('text/') && attachment.body) {\n let text = attachment.body.toString();\n if (text.length > 300)\n text = text.slice(0, 300) + '...';\n for (const line of text.split('\\n'))\n resultLines.push(screen.colors.dim(` ${line}`));\n }\n }\n resultLines.push(screen.colors.dim(separator(screen, ' ')));\n }\n lines.push(...resultLines);\n }\n lines.push('');\n return lines.join('\\n');\n}\n\nexport function formatRetry(screen: Screen, result: TestResult) {\n const retryLines = [];\n if (result.retry) {\n retryLines.push('');\n retryLines.push(screen.colors.gray(separator(screen, ` Retry #${result.retry}`)));\n }\n return retryLines;\n}\n\nfunction quotePathIfNeeded(path: string): string {\n if (/\\s/.test(path))\n return `\"${path}\"`;\n return path;\n}\n\nexport function formatResultFailure(screen: Screen, test: TestCase, result: TestResult, initialIndent: string): ErrorDetails[] {\n const errorDetails: ErrorDetails[] = [];\n\n if (result.status === 'passed' && test.expectedStatus === 'failed') {\n errorDetails.push({\n message: indent(screen.colors.red(`Expected to fail, but passed.`), initialIndent),\n });\n }\n if (result.status === 'interrupted') {\n errorDetails.push({\n message: indent(screen.colors.red(`Test was interrupted.`), initialIndent),\n });\n }\n\n for (const error of result.errors) {\n const formattedError = formatError(screen, error);\n errorDetails.push({\n message: indent(formattedError.message, initialIndent),\n location: formattedError.location,\n });\n }\n return errorDetails;\n}\n\nexport function relativeFilePath(screen: Screen, config: FullConfig, file: string): string {\n if (screen.resolveFiles === 'cwd')\n return path.relative(process.cwd(), file);\n return path.relative(config.rootDir, file);\n}\n\nfunction relativeTestPath(screen: Screen, config: FullConfig, test: TestCase): string {\n return relativeFilePath(screen, config, test.location.file);\n}\n\nexport function stepSuffix(step: TestStep | undefined) {\n const stepTitles = step ? step.titlePath() : [];\n return stepTitles.map(t => t.split('\\n')[0]).map(t => ' \u203A ' + t).join('');\n}\n\nfunction formatTestTitle(screen: Screen, config: FullConfig, test: TestCase, step?: TestStep, options: { includeTestId?: boolean } = {}): string {\n // root, project, file, ...describes, test\n const [, projectName, , ...titles] = test.titlePath();\n const location = `${relativeTestPath(screen, config, test)}:${test.location.line}:${test.location.column}`;\n const testId = options.includeTestId ? `[id=${test.id}] ` : '';\n const projectLabel = options.includeTestId ? `project=` : '';\n const projectTitle = projectName ? `[${projectLabel}${projectName}] \u203A ` : '';\n const testTitle = `${testId}${projectTitle}${location} \u203A ${titles.join(' \u203A ')}`;\n const extraTags = test.tags.filter(t => !testTitle.includes(t));\n return `${testTitle}${stepSuffix(step)}${extraTags.length ? ' ' + extraTags.join(' ') : ''}`;\n}\n\nfunction formatTestHeader(screen: Screen, config: FullConfig, test: TestCase, options: { indent?: string, index?: number, mode?: 'default' | 'error', includeTestId?: boolean } = {}): string {\n const title = formatTestTitle(screen, config, test, undefined, options);\n const header = `${options.indent || ''}${options.index ? options.index + ') ' : ''}${title}`;\n let fullHeader = header;\n\n // Render the path to the deepest failing test.step.\n if (options.mode === 'error') {\n const stepPaths = new Set<string>();\n for (const result of test.results.filter(r => !!r.errors.length)) {\n const stepPath: string[] = [];\n const visit = (steps: TestStep[]) => {\n const errors = steps.filter(s => s.error);\n if (errors.length > 1)\n return;\n if (errors.length === 1 && errors[0].category === 'test.step') {\n stepPath.push(errors[0].title);\n visit(errors[0].steps);\n }\n };\n visit(result.steps);\n stepPaths.add(['', ...stepPath].join(' \u203A '));\n }\n fullHeader = header + (stepPaths.size === 1 ? stepPaths.values().next().value : '');\n }\n return separator(screen, fullHeader);\n}\n\nexport function formatError(screen: Screen, error: TestError): ErrorDetails {\n const message = error.message || error.value || '';\n const stack = error.stack;\n if (!stack && !error.location)\n return { message };\n\n const tokens = [];\n\n // Now that we filter out internals from our stack traces, we can safely render\n // the helper / original exception locations.\n const parsedStack = stack ? prepareErrorStack(stack) : undefined;\n tokens.push(parsedStack?.message || message);\n\n if (error.snippet) {\n let snippet = error.snippet;\n if (!screen.colors.enabled)\n snippet = stripAnsiEscapes(snippet);\n tokens.push('');\n tokens.push(snippet);\n }\n\n if (parsedStack && parsedStack.stackLines.length)\n tokens.push(screen.colors.dim(parsedStack.stackLines.join('\\n')));\n\n let location = error.location;\n if (parsedStack && !location)\n location = parsedStack.location;\n\n if (error.cause)\n tokens.push(screen.colors.dim('[cause]: ') + formatError(screen, error.cause).message);\n\n return {\n location,\n message: tokens.join('\\n'),\n };\n}\n\nexport function separator(screen: Screen, text: string = ''): string {\n if (text)\n text += ' ';\n const columns = Math.min(100, screen.ttyWidth || 100);\n return text + screen.colors.dim('\u2500'.repeat(Math.max(0, columns - stripAnsiEscapes(text).length)));\n}\n\nfunction indent(lines: string, tab: string) {\n return lines.replace(/^(?=.+$)/gm, tab);\n}\n\nexport function prepareErrorStack(stack: string): {\n message: string;\n stackLines: string[];\n location?: Location;\n} {\n return parseErrorStack(stack, path.sep, !!process.env.PWDEBUGIMPL);\n}\n\nfunction characterWidth(c: string) {\n return getEastAsianWidth.eastAsianWidth(c.codePointAt(0)!);\n}\n\nfunction stringWidth(v: string) {\n let width = 0;\n for (const { segment } of new Intl.Segmenter(undefined, { granularity: 'grapheme' }).segment(v))\n width += characterWidth(segment);\n return width;\n}\n\nfunction suffixOfWidth(v: string, width: number) {\n const segments = [...new Intl.Segmenter(undefined, { granularity: 'grapheme' }).segment(v)];\n let suffixBegin = v.length;\n for (const { segment, index } of segments.reverse()) {\n const segmentWidth = stringWidth(segment);\n if (segmentWidth > width)\n break;\n width -= segmentWidth;\n suffixBegin = index;\n }\n return v.substring(suffixBegin);\n}\n\n// Leaves enough space for the \"prefix\" to also fit.\nexport function fitToWidth(line: string, width: number, prefix?: string): string {\n const prefixLength = prefix ? stripAnsiEscapes(prefix).length : 0;\n width -= prefixLength;\n if (stringWidth(line) <= width)\n return line;\n\n // Even items are plain text, odd items are control sequences.\n const parts = line.split(ansiRegex);\n const taken: string[] = [];\n for (let i = parts.length - 1; i >= 0; i--) {\n if (i % 2) {\n // Include all control sequences to preserve formatting.\n taken.push(parts[i]);\n } else {\n let part = suffixOfWidth(parts[i], width);\n const wasTruncated = part.length < parts[i].length;\n if (wasTruncated && parts[i].length > 0) {\n // Add ellipsis if we are truncating.\n part = '\\u2026' + suffixOfWidth(parts[i], width - 1);\n }\n taken.push(part);\n width -= stringWidth(part);\n }\n }\n return taken.reverse().join('');\n}\n\nfunction resolveFromEnv(name: string): string | undefined {\n const value = process.env[name];\n if (value)\n return path.resolve(process.cwd(), value);\n return undefined;\n}\n\n// In addition to `outputFile` the function returns `outputDir` which should\n// be cleaned up if present by some reporters contract.\nexport function resolveOutputFile(reporterName: string, options: {\n configDir: string,\n outputDir?: string,\n fileName?: string,\n outputFile?: string,\n default?: {\n fileName: string,\n outputDir: string,\n }\n}): { outputFile: string, outputDir?: string } | undefined {\n const name = reporterName.toUpperCase();\n let outputFile = resolveFromEnv(`PLAYWRIGHT_${name}_OUTPUT_FILE`);\n if (!outputFile && options.outputFile)\n outputFile = path.resolve(options.configDir, options.outputFile);\n if (outputFile)\n return { outputFile };\n\n let outputDir = resolveFromEnv(`PLAYWRIGHT_${name}_OUTPUT_DIR`);\n if (!outputDir && options.outputDir)\n outputDir = path.resolve(options.configDir, options.outputDir);\n if (!outputDir && options.default)\n outputDir = resolveReporterOutputPath(options.default.outputDir, options.configDir, undefined);\n if (!outputDir)\n outputDir = options.configDir;\n\n const reportName = process.env[`PLAYWRIGHT_${name}_OUTPUT_NAME`] ?? options.fileName ?? options.default?.fileName;\n if (!reportName)\n return undefined;\n outputFile = path.resolve(outputDir, reportName);\n\n return { outputFile, outputDir };\n}\n\ntype TestAttachment = TestResult['attachments'][number];\n\ntype TestAttachmentGroup = TestAttachment & {\n expected?: TestAttachment;\n actual?: TestAttachment;\n diff?: TestAttachment;\n previous?: TestAttachment;\n};\n\nfunction groupAttachments(attachments: TestResult['attachments']): TestAttachmentGroup[] {\n const result: TestAttachmentGroup[] = [];\n const attachmentsByPrefix = new Map<string, TestAttachment>();\n for (const attachment of attachments) {\n if (!attachment.path) {\n result.push(attachment);\n continue;\n }\n\n const match = attachment.name.match(/^(.*)-(expected|actual|diff|previous)(\\.[^.]+)?$/);\n if (!match) {\n result.push(attachment);\n continue;\n }\n\n const [, name, category] = match;\n let group: TestAttachmentGroup | undefined = attachmentsByPrefix.get(name);\n if (!group) {\n group = { ...attachment, name };\n attachmentsByPrefix.set(name, group);\n result.push(group);\n }\n if (category === 'expected')\n group.expected = attachment;\n else if (category === 'actual')\n group.actual = attachment;\n else if (category === 'diff')\n group.diff = attachment;\n else if (category === 'previous')\n group.previous = attachment;\n }\n return result;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AAEjB,mBAA8D;AAC9D,yBAAmC;AACnC,IAAAA,gBAA+C;AAE/C,kBAAuE;AACvE,IAAAC,sBAAkC;AAO3B,MAAM,gBAAgB,OAAO,QAAQ;AAuC5C,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAG3B,MAAM,wBAAwB,QAAQ;AAEtC,MAAM,wBAAwB,QAAQ;AAG/B,MAAM,kBAAkC,MAAM;AACnD,MAAI,QAAQ,CAAC,CAAC,sBAAsB;AACpC,MAAI,WAAW,sBAAsB,WAAW;AAChD,MAAI,YAAY,sBAAsB,QAAQ;AAC9C,MAAI,QAAQ,IAAI,yBAAyB,WAAW,QAAQ,IAAI,yBAAyB,KAAK;AAC5F,YAAQ;AACR,eAAW;AACX,gBAAY;AAAA,EACd,WAA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
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/blob.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport { Readable } from 'stream';\n\nimport { removeFolders, sanitizeForFilePath } from 'playwright-core/lib/utils';\nimport { ManualPromise, calculateSha1, createGuid, getUserAgent } from 'playwright-core/lib/utils';\nimport { mime } from 'playwright-core/lib/utilsBundle';\nimport { yazl } from 'playwright-core/lib/zipBundle';\n\nimport { resolveOutputFile, CommonReporterOptions } from './base';\nimport { TeleReporterEmitter } from './teleEmitter';\n\nimport type { BlobReporterOptions } from '../../types/test';\nimport type { FullConfig, FullResult, TestResult } from '../../types/testReporter';\nimport type { BlobReportMetadata, JsonAttachment, JsonEvent } from '../isomorphic/teleReceiver';\nimport type { EventEmitter } from 'events';\n\nexport const currentBlobReportVersion = 2;\n\nexport class BlobReporter extends TeleReporterEmitter {\n private readonly _messages: JsonEvent[] = [];\n private readonly _attachments: { originalPath: string, zipEntryPath: string }[] = [];\n private readonly _options: BlobReporterOptions & CommonReporterOptions;\n private readonly _salt: string;\n private _config!: FullConfig;\n\n constructor(options: BlobReporterOptions & CommonReporterOptions) {\n super(message => this._messages.push(message));\n this._options = options;\n if (this._options.fileName && !this._options.fileName.endsWith('.zip'))\n throw new Error(`Blob report file name must end with .zip extension: ${this._options.fileName}`);\n this._salt = createGuid();\n }\n\n override onConfigure(config: FullConfig) {\n const metadata: BlobReportMetadata = {\n version: currentBlobReportVersion,\n userAgent: getUserAgent(),\n name: process.env.PWTEST_BOT_NAME,\n shard: config.shard ?? undefined,\n pathSeparator: path.sep,\n };\n this._messages.push({\n method: 'onBlobReportMetadata',\n params: metadata\n });\n\n this._config = config;\n super.onConfigure(config);\n }\n\n override async onEnd(result: FullResult): Promise<void> {\n await super.onEnd(result);\n\n const zipFileName = await this._prepareOutputFile();\n\n const zipFile = new yazl.ZipFile();\n const zipFinishPromise = new ManualPromise<undefined>();\n const finishPromise = zipFinishPromise.catch(e => {\n throw new Error(`Failed to write report ${zipFileName}: ` + e.message);\n });\n\n (zipFile as any as EventEmitter).on('error', error => zipFinishPromise.reject(error));\n zipFile.outputStream.pipe(fs.createWriteStream(zipFileName)).on('close', () => {\n zipFinishPromise.resolve(undefined);\n }).on('error', error => zipFinishPromise.reject(error));\n\n for (const { originalPath, zipEntryPath } of this._attachments) {\n if (!fs.statSync(originalPath, { throwIfNoEntry: false })?.isFile())\n continue;\n zipFile.addFile(originalPath, zipEntryPath);\n }\n\n const lines = this._messages.map(m => JSON.stringify(m) + '\\n');\n const content = Readable.from(lines);\n zipFile.addReadStream(content, 'report.jsonl');\n zipFile.end();\n\n await finishPromise;\n }\n\n private async _prepareOutputFile() {\n const { outputFile, outputDir } = resolveOutputFile('BLOB', {\n ...this._options,\n default: {\n fileName: this._defaultReportName(this._config),\n outputDir: 'blob-report',\n }\n })!;\n if (!process.env.PWTEST_BLOB_DO_NOT_REMOVE)\n await removeFolders([outputDir!]);\n await fs.promises.mkdir(path.dirname(outputFile), { recursive: true });\n return outputFile;\n }\n\n private _defaultReportName(config: FullConfig) {\n let reportName = 'report';\n if (this._options._commandHash)\n reportName += '-' + sanitizeForFilePath(this._options._commandHash);\n if (config.shard) {\n const paddedNumber = `${config.shard.current}`.padStart(`${config.shard.total}`.length, '0');\n reportName = `${reportName}-${paddedNumber}`;\n }\n return `${reportName}.zip`;\n }\n\n override _serializeAttachments(attachments: TestResult['attachments']): JsonAttachment[] {\n return super._serializeAttachments(attachments).map(attachment => {\n if (!attachment.path)\n return attachment;\n // Add run guid to avoid clashes between shards.\n const sha1 = calculateSha1(attachment.path + this._salt);\n const extension = mime.getExtension(attachment.contentType) || 'dat';\n const newPath = `resources/${sha1}.${extension}`;\n this._attachments.push({ originalPath: attachment.path, zipEntryPath: newPath });\n return {\n ...attachment,\n path: newPath,\n };\n });\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AACf,kBAAiB;AACjB,oBAAyB;AAEzB,mBAAmD;AACnD,IAAAA,gBAAuE;AACvE,yBAAqB;AACrB,uBAAqB;AAErB,kBAAyD;AACzD,yBAAoC;AAO7B,MAAM,2BAA2B;AAEjC,MAAM,qBAAqB,uCAAoB;AAAA,EAOpD,YAAY,SAAsD;AAChE,UAAM,aAAW,KAAK,UAAU,KAAK,OAAO,CAAC;AAP/C,SAAiB,YAAyB,CAAC;AAC3C,SAAiB,eAAiE,CAAC;AAOjF,SAAK,WAAW;AAChB,QAAI,KAAK,SAAS,YAAY,CAAC,KAAK,SAAS,SAAS,SAAS,MAAM;AACnE,YAAM,IAAI,MAAM,uDAAuD,KAAK,SAAS,QAAQ,EAAE;AACjG,SAAK,YAAQ,0BAAW;AAAA,EAC1B;AAAA,EAES,YAAY,QAAoB;AACvC,UAAM,WAA+B;AAAA,MACnC,SAAS;AAAA,MACT,eAAW,4BAAa;AAAA,MACxB,MAAM,QAAQ,IAAI;AAAA,MAClB,OAAO,OAAO,SAAS;AAAA,MACvB,eAAe,YAAAC,QAAK;AAAA,IACtB;AACA,SAAK,UAAU,KAAK;AAAA,MAClB,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV,CAAC;AAED,SAAK,UAAU;AACf,UAAM,YAAY,MAAM;AAAA,EAC1B;AAAA,EAEA,MAAe,MAAM,QAAmC;AACtD,UAAM,MAAM,MAAM,MAAM;AAExB,UA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,EAEQ,mBAAmB,QAAoB;AAC7C,QAAI,aAAa;AACjB,QAAI,KAAK,SAAS;AAChB,oBAAc,UAAM,kCAAoB,KAAK,SAAS,YAAY;AACpE,QAAI,OAAO,OAAO;AAChB,YAAM,eAAe,GAAG,OAAO,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,MAAM,KAAK,GAAG,QAAQ,GAAG;AAC3F,mBAAa,GAAG,UAAU,IAAI,YAAY;AAAA,IAC5C;AACA,WAAO,GAAG,UAAU;AAAA,EACtB;AAAA,EAES,sBAAsB,aAA0D;AACvF,WAAO,MAAM,sBAAsB,WAAW,EAAE,IAAI,gBAAc;AAChE,UAAI,CAAC,WAAW;AACd,eAAO;AAET,YAAM,WAAO,6BAAc,WAAW,OAAO,KAAK,KAAK;AACvD,YAAM,YAAY,wBAAK,aAAa,WAAW,WAAW,KAAK;AAC/D,YAAM,UAAU,aAAa,IAAI,IAAI,SAAS;AAC9C,WAAK,aAAa,KAAK,EAAE,cAAc,WAAW,MAAM,cAAc,QAAQ,CAAC;AAC/E,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM;AAAA,MACR;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
-
"names": ["import_utils", "path", "fs"]
|
|
7
|
-
}
|
package/lib/reporters/dot.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/dot.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TerminalReporter } from './base';\n\nimport type { FullResult, Suite, TestCase, TestError, TestResult } from '../../types/testReporter';\n\nclass DotReporter extends TerminalReporter {\n private _counter = 0;\n\n override onBegin(suite: Suite) {\n super.onBegin(suite);\n this.writeLine(this.generateStartingMessage());\n }\n\n override onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n super.onStdOut(chunk, test, result);\n if (!this.config.quiet)\n this.screen.stdout.write(chunk);\n }\n\n override onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n super.onStdErr(chunk, test, result);\n if (!this.config.quiet)\n this.screen.stderr.write(chunk);\n }\n\n override onTestEnd(test: TestCase, result: TestResult) {\n super.onTestEnd(test, result);\n if (this._counter === 80) {\n this.screen.stdout.write('\\n');\n this._counter = 0;\n }\n ++this._counter;\n if (result.status === 'skipped') {\n this.screen.stdout.write(this.screen.colors.yellow('\u00B0'));\n return;\n }\n if (this.willRetry(test)) {\n this.screen.stdout.write(this.screen.colors.gray('\u00D7'));\n return;\n }\n switch (test.outcome()) {\n case 'expected': this.screen.stdout.write(this.screen.colors.green('\u00B7')); break;\n case 'unexpected': this.screen.stdout.write(this.screen.colors.red(result.status === 'timedOut' ? 'T' : 'F')); break;\n case 'flaky': this.screen.stdout.write(this.screen.colors.yellow('\u00B1')); break;\n }\n }\n\n override onError(error: TestError): void {\n super.onError(error);\n this.writeLine('\\n' + this.formatError(error).message);\n this._counter = 0;\n }\n\n override async onEnd(result: FullResult) {\n await super.onEnd(result);\n this.screen.stdout.write('\\n');\n this.epilogue(true);\n }\n}\n\nexport default DotReporter;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiC;AAIjC,MAAM,oBAAoB,6BAAiB;AAAA,EAA3C;AAAA;AACE,SAAQ,WAAW;AAAA;AAAA,EAEV,QAAQ,OAAc;AAC7B,UAAM,QAAQ,KAAK;AACnB,SAAK,UAAU,KAAK,wBAAwB,CAAC;A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AAM,QAAoB;AACvC,UAAM,MAAM,MAAM,MAAM;AACxB,SAAK,OAAO,OAAO,MAAM,IAAI;AAC7B,SAAK,SAAS,IAAI;AAAA,EACpB;AACF;AAEA,IAAO,cAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/empty.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ReporterV2 } from './reporterV2';\n\nclass EmptyReporter implements ReporterV2 {\n version(): 'v2' {\n return 'v2';\n }\n\n printsToStdio() {\n return false;\n }\n}\n\nexport default EmptyReporter;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,MAAM,cAAoC;AAAA,EACxC,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,EACT;AACF;AAEA,IAAO,gBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/github.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\n\nimport { noColors } from 'playwright-core/lib/utils';\nimport { ms as milliseconds } from 'playwright-core/lib/utilsBundle';\n\nimport { TerminalReporter, formatResultFailure, formatRetry } from './base';\nimport { stripAnsiEscapes } from '../util';\n\nimport type { FullResult, TestCase, TestError } from '../../types/testReporter';\n\ntype GitHubLogType = 'debug' | 'notice' | 'warning' | 'error';\n\ntype GitHubLogOptions = Partial<{\n title: string;\n file: string;\n col: number;\n endColumn: number;\n line: number;\n endLine: number;\n}>;\n\nclass GitHubLogger {\n private _log(message: string, type: GitHubLogType = 'notice', options: GitHubLogOptions = {}) {\n message = message.replace(/\\n/g, '%0A');\n const configs = Object.entries(options)\n .map(([key, option]) => `${key}=${option}`)\n .join(',');\n // eslint-disable-next-line no-restricted-properties\n process.stdout.write(stripAnsiEscapes(`::${type} ${configs}::${message}\\n`));\n }\n\n debug(message: string, options?: GitHubLogOptions) {\n this._log(message, 'debug', options);\n }\n\n error(message: string, options?: GitHubLogOptions) {\n this._log(message, 'error', options);\n }\n\n notice(message: string, options?: GitHubLogOptions) {\n this._log(message, 'notice', options);\n }\n\n warning(message: string, options?: GitHubLogOptions) {\n this._log(message, 'warning', options);\n }\n}\n\nexport class GitHubReporter extends TerminalReporter {\n githubLogger = new GitHubLogger();\n\n constructor(options: { omitFailures?: boolean } = {}) {\n super(options);\n this.screen = { ...this.screen, colors: noColors };\n }\n\n printsToStdio() {\n return false;\n }\n\n override async onEnd(result: FullResult) {\n await super.onEnd(result);\n this._printAnnotations();\n }\n\n override onError(error: TestError) {\n const errorMessage = this.formatError(error).message;\n this.githubLogger.error(errorMessage);\n }\n\n private _printAnnotations() {\n const summary = this.generateSummary();\n const summaryMessage = this.generateSummaryMessage(summary);\n if (summary.failuresToPrint.length)\n this._printFailureAnnotations(summary.failuresToPrint);\n this._printSlowTestAnnotations();\n this._printSummaryAnnotation(summaryMessage);\n }\n\n private _printSlowTestAnnotations() {\n this.getSlowTests().forEach(([file, duration]) => {\n const filePath = workspaceRelativePath(path.join(process.cwd(), file));\n this.githubLogger.warning(`${filePath} took ${milliseconds(duration)}`, {\n title: 'Slow Test',\n file: filePath,\n });\n });\n }\n\n private _printSummaryAnnotation(summary: string){\n this.githubLogger.notice(summary, {\n title: '\uD83C\uDFAD Playwright Run Summary'\n });\n }\n\n private _printFailureAnnotations(failures: TestCase[]) {\n failures.forEach((test, index) => {\n const title = this.formatTestTitle(test);\n const header = this.formatTestHeader(test, { indent: ' ', index: index + 1, mode: 'error' });\n for (const result of test.results) {\n const errors = formatResultFailure(this.screen, test, result, ' ');\n for (const error of errors) {\n const options: GitHubLogOptions = {\n file: workspaceRelativePath(error.location?.file || test.location.file),\n title,\n };\n if (error.location) {\n options.line = error.location.line;\n options.col = error.location.column;\n }\n const message = [header, ...formatRetry(this.screen, result), error.message].join('\\n');\n this.githubLogger.error(message, options);\n }\n }\n });\n }\n}\n\nfunction workspaceRelativePath(filePath: string): string {\n return path.relative(process.env['GITHUB_WORKSPACE'] ?? '', filePath);\n}\n\nexport default GitHubReporter;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AAEjB,mBAAyB;AACzB,yBAAmC;AAEnC,kBAAmE;AACnE,kBAAiC;AAejC,MAAM,aAAa;AAAA,EACT,KAAK,SAAiB,OAAsB,UAAU,UAA4B,CAAC,GAAG;AAC5F,cAAU,QAAQ,QAAQ,OAAO,KAAK;AACtC,UAAM,UAAU,OAAO,QAAQ,OAAO,EACjC,IAAI,CAAC,CAAC,KAAK,MAAM,MAAM,GAAG,GAAG,IAAI,MAAM,EAAE,EACzC,KAAK,GAAG;AAEb,YAAQ,OAAO,UAAM,8BAAiB,KAAK,IAAI,IA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"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport { Transform } from 'stream';\n\nimport { HttpServer, MultiMap, assert, calculateSha1, getPackageManagerExecCommand, copyFileAndMakeWritable, gracefullyProcessExitDoNotHang, removeFolders, sanitizeForFilePath, toPosixPath } from 'playwright-core/lib/utils';\nimport { colors } from 'playwright-core/lib/utils';\nimport { open } from 'playwright-core/lib/utilsBundle';\nimport { mime } from 'playwright-core/lib/utilsBundle';\nimport { yazl } from 'playwright-core/lib/zipBundle';\n\nimport { CommonReporterOptions, formatError, formatResultFailure, internalScreen } from './base';\nimport { codeFrameColumns } from '../transform/babelBundle';\nimport { resolveReporterOutputPath, stripAnsiEscapes } from '../util';\n\nimport type { ReporterV2 } from './reporterV2';\nimport type { HtmlReporterOptions as HtmlReporterConfigOptions, Metadata, TestAnnotation } from '../../types/test';\nimport type * as api from '../../types/testReporter';\nimport type { HTMLReport, HTMLReportOptions, Location, Stats, TestAttachment, TestCase, TestCaseSummary, TestFile, TestFileSummary, TestResult, TestStep } from '@html-reporter/types';\nimport type { ZipFile } from 'playwright-core/lib/zipBundle';\nimport type { TransformCallback } from 'stream';\n\ntype TestEntry = {\n testCase: TestCase;\n testCaseSummary: TestCaseSummary\n};\n\ntype HtmlReportOpenOption = NonNullable<HtmlReporterConfigOptions['open']>;\nconst htmlReportOptions: HtmlReportOpenOption[] = ['always', 'never', 'on-failure'];\n\nconst isHtmlReportOption = (type: string): type is HtmlReportOpenOption => {\n return htmlReportOptions.includes(type as HtmlReportOpenOption);\n};\n\nclass HtmlReporter implements ReporterV2 {\n private config!: api.FullConfig;\n private suite!: api.Suite;\n private _options: HtmlReporterConfigOptions & CommonReporterOptions;\n private _outputFolder!: string;\n private _attachmentsBaseURL!: string;\n private _open: string | undefined;\n private _port: number | undefined;\n private _host: string | undefined;\n private _buildResult: { ok: boolean, singleTestId: string | undefined } | undefined;\n private _topLevelErrors: api.TestError[] = [];\n\n constructor(options: HtmlReporterConfigOptions & CommonReporterOptions) {\n this._options = options;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n printsToStdio() {\n return false;\n }\n\n onConfigure(config: api.FullConfig) {\n this.config = config;\n }\n\n onBegin(suite: api.Suite) {\n const { outputFolder, open, attachmentsBaseURL, host, port } = this._resolveOptions();\n this._outputFolder = outputFolder;\n this._open = open;\n this._host = host;\n this._port = port;\n this._attachmentsBaseURL = attachmentsBaseURL;\n const reportedWarnings = new Set<string>();\n for (const project of this.config.projects) {\n if (this._isSubdirectory(outputFolder, project.outputDir) || this._isSubdirectory(project.outputDir, outputFolder)) {\n const key = outputFolder + '|' + project.outputDir;\n if (reportedWarnings.has(key))\n continue;\n reportedWarnings.add(key);\n writeLine(colors.red(`Configuration Error: HTML reporter output folder clashes with the tests output folder:`));\n writeLine(`\n html reporter folder: ${colors.bold(outputFolder)}\n test results folder: ${colors.bold(project.outputDir)}`);\n writeLine('');\n writeLine(`HTML reporter will clear its output directory prior to being generated, which will lead to the artifact loss.\n`);\n }\n }\n this.suite = suite;\n }\n\n _resolveOptions(): { outputFolder: string, open: HtmlReportOpenOption, attachmentsBaseURL: string, host: string | undefined, port: number | undefined } {\n const outputFolder = reportFolderFromEnv() ?? resolveReporterOutputPath('playwright-report', this._options.configDir, this._options.outputFolder);\n return {\n outputFolder,\n open: getHtmlReportOptionProcessEnv() || this._options.open || 'on-failure',\n attachmentsBaseURL: process.env.PLAYWRIGHT_HTML_ATTACHMENTS_BASE_URL || this._options.attachmentsBaseURL || 'data/',\n host: process.env.PLAYWRIGHT_HTML_HOST || this._options.host,\n port: process.env.PLAYWRIGHT_HTML_PORT ? +process.env.PLAYWRIGHT_HTML_PORT : this._options.port,\n };\n }\n\n _isSubdirectory(parentDir: string, dir: string): boolean {\n const relativePath = path.relative(parentDir, dir);\n return !!relativePath && !relativePath.startsWith('..') && !path.isAbsolute(relativePath);\n }\n\n onError(error: api.TestError): void {\n this._topLevelErrors.push(error);\n }\n\n async onEnd(result: api.FullResult) {\n const projectSuites = this.suite.suites;\n await removeFolders([this._outputFolder]);\n let noSnippets: boolean | undefined;\n if (process.env.PLAYWRIGHT_HTML_NO_SNIPPETS === 'false' || process.env.PLAYWRIGHT_HTML_NO_SNIPPETS === '0')\n noSnippets = false;\n else if (process.env.PLAYWRIGHT_HTML_NO_SNIPPETS)\n noSnippets = true;\n noSnippets = noSnippets || this._options.noSnippets;\n\n let noCopyPrompt: boolean | undefined;\n if (process.env.PLAYWRIGHT_HTML_NO_COPY_PROMPT === 'false' || process.env.PLAYWRIGHT_HTML_NO_COPY_PROMPT === '0')\n noCopyPrompt = false;\n else if (process.env.PLAYWRIGHT_HTML_NO_COPY_PROMPT)\n noCopyPrompt = true;\n noCopyPrompt = noCopyPrompt || this._options.noCopyPrompt;\n\n const builder = new HtmlBuilder(this.config, this._outputFolder, this._attachmentsBaseURL, {\n title: process.env.PLAYWRIGHT_HTML_TITLE || this._options.title,\n noSnippets,\n noCopyPrompt,\n });\n this._buildResult = await builder.build(this.config.metadata, projectSuites, result, this._topLevelErrors);\n }\n\n async onExit() {\n if (process.env.CI || !this._buildResult)\n return;\n const { ok, singleTestId } = this._buildResult;\n const shouldOpen = !!process.stdin.isTTY && (this._open === 'always' || (!ok && this._open === 'on-failure'));\n if (shouldOpen) {\n await showHTMLReport(this._outputFolder, this._host, this._port, singleTestId);\n } else if (this._options._mode === 'test' && !!process.stdin.isTTY) {\n const packageManagerCommand = getPackageManagerExecCommand();\n const relativeReportPath = this._outputFolder === standaloneDefaultFolder() ? '' : ' ' + path.relative(process.cwd(), this._outputFolder);\n const hostArg = this._host ? ` --host ${this._host}` : '';\n const portArg = this._port ? ` --port ${this._port}` : '';\n writeLine('');\n writeLine('To open last HTML report run:');\n writeLine(colors.cyan(`\n ${packageManagerCommand} playwright show-report${relativeReportPath}${hostArg}${portArg}\n`));\n }\n }\n}\n\nfunction reportFolderFromEnv(): string | undefined {\n // Note: PLAYWRIGHT_HTML_REPORT is for backwards compatibility.\n const envValue = process.env.PLAYWRIGHT_HTML_OUTPUT_DIR || process.env.PLAYWRIGHT_HTML_REPORT;\n return envValue ? path.resolve(envValue) : undefined;\n}\n\nfunction getHtmlReportOptionProcessEnv(): HtmlReportOpenOption | undefined {\n // Note: PW_TEST_HTML_REPORT_OPEN is for backwards compatibility.\n const htmlOpenEnv = process.env.PLAYWRIGHT_HTML_OPEN || process.env.PW_TEST_HTML_REPORT_OPEN;\n if (!htmlOpenEnv)\n return undefined;\n if (!isHtmlReportOption(htmlOpenEnv)) {\n writeLine(colors.red(`Configuration Error: HTML reporter Invalid value for PLAYWRIGHT_HTML_OPEN: ${htmlOpenEnv}. Valid values are: ${htmlReportOptions.join(', ')}`));\n return undefined;\n }\n return htmlOpenEnv;\n}\n\nfunction standaloneDefaultFolder(): string {\n return reportFolderFromEnv() ?? resolveReporterOutputPath('playwright-report', process.cwd(), undefined);\n}\n\nexport async function showHTMLReport(reportFolder: string | undefined, host: string = 'localhost', port?: number, testId?: string) {\n const folder = reportFolder ?? standaloneDefaultFolder();\n try {\n assert(fs.statSync(folder).isDirectory());\n } catch (e) {\n writeLine(colors.red(`No report found at \"${folder}\"`));\n gracefullyProcessExitDoNotHang(1);\n return;\n }\n const server = startHtmlReportServer(folder);\n await server.start({ port, host, preferredPort: port ? undefined : 9323 });\n let url = server.urlPrefix('human-readable');\n writeLine('');\n writeLine(colors.cyan(` Serving HTML report at ${url}. Press Ctrl+C to quit.`));\n if (testId)\n url += `#?testId=${testId}`;\n url = url.replace('0.0.0.0', 'localhost');\n await open(url, { wait: true }).catch(() => {});\n await new Promise(() => {});\n}\n\nexport function startHtmlReportServer(folder: string): HttpServer {\n const server = new HttpServer();\n server.routePrefix('/', (request, response) => {\n let relativePath = new URL('http://localhost' + request.url).pathname;\n if (relativePath.startsWith('/trace/file')) {\n const url = new URL('http://localhost' + request.url!);\n try {\n return server.serveFile(request, response, url.searchParams.get('path')!);\n } catch (e) {\n return false;\n }\n }\n if (relativePath === '/')\n relativePath = '/index.html';\n const absolutePath = path.join(folder, ...relativePath.split('/'));\n return server.serveFile(request, response, absolutePath);\n });\n return server;\n}\n\ntype DataMap = Map<string, { testFile: TestFile, testFileSummary: TestFileSummary }>;\n\nclass HtmlBuilder {\n private _config: api.FullConfig;\n private _reportFolder: string;\n private _stepsInFile = new MultiMap<string, TestStep>();\n private _dataZipFile: ZipFile;\n private _hasTraces = false;\n private _attachmentsBaseURL: string;\n private _options: HTMLReportOptions;\n\n constructor(config: api.FullConfig, outputDir: string, attachmentsBaseURL: string, options: HTMLReportOptions) {\n this._config = config;\n this._reportFolder = outputDir;\n this._options = options;\n fs.mkdirSync(this._reportFolder, { recursive: true });\n this._dataZipFile = new yazl.ZipFile();\n this._attachmentsBaseURL = attachmentsBaseURL;\n }\n\n async build(metadata: Metadata, projectSuites: api.Suite[], result: api.FullResult, topLevelErrors: api.TestError[]): Promise<{ ok: boolean, singleTestId: string | undefined }> {\n const data: DataMap = new Map();\n for (const projectSuite of projectSuites) {\n const projectName = projectSuite.project()!.name;\n for (const fileSuite of projectSuite.suites) {\n const fileName = this._relativeLocation(fileSuite.location)!.file;\n this._createEntryForSuite(data, projectName, fileSuite, fileName, true);\n }\n }\n if (!this._options.noSnippets)\n createSnippets(this._stepsInFile);\n\n let ok = true;\n for (const [fileId, { testFile, testFileSummary }] of data) {\n const stats = testFileSummary.stats;\n for (const test of testFileSummary.tests) {\n if (test.outcome === 'expected')\n ++stats.expected;\n if (test.outcome === 'skipped')\n ++stats.skipped;\n if (test.outcome === 'unexpected')\n ++stats.unexpected;\n if (test.outcome === 'flaky')\n ++stats.flaky;\n ++stats.total;\n }\n stats.ok = stats.unexpected + stats.flaky === 0;\n if (!stats.ok)\n ok = false;\n\n const testCaseSummaryComparator = (t1: TestCaseSummary, t2: TestCaseSummary) => {\n const w1 = (t1.outcome === 'unexpected' ? 1000 : 0) + (t1.outcome === 'flaky' ? 1 : 0);\n const w2 = (t2.outcome === 'unexpected' ? 1000 : 0) + (t2.outcome === 'flaky' ? 1 : 0);\n return w2 - w1;\n };\n testFileSummary.tests.sort(testCaseSummaryComparator);\n\n this._addDataFile(fileId + '.json', testFile);\n }\n const htmlReport: HTMLReport = {\n metadata,\n startTime: result.startTime.getTime(),\n duration: result.duration,\n files: [...data.values()].map(e => e.testFileSummary),\n projectNames: projectSuites.map(r => r.project()!.name),\n stats: { ...[...data.values()].reduce((a, e) => addStats(a, e.testFileSummary.stats), emptyStats()) },\n errors: topLevelErrors.map(error => formatError(internalScreen, error).message),\n options: this._options,\n };\n htmlReport.files.sort((f1, f2) => {\n const w1 = f1.stats.unexpected * 1000 + f1.stats.flaky;\n const w2 = f2.stats.unexpected * 1000 + f2.stats.flaky;\n return w2 - w1;\n });\n\n this._addDataFile('report.json', htmlReport);\n\n let singleTestId: string | undefined;\n if (htmlReport.stats.total === 1) {\n const testFile: TestFile = data.values().next().value!.testFile;\n singleTestId = testFile.tests[0].testId;\n }\n\n // Copy app.\n const appFolder = path.join(require.resolve('playwright-core'), '..', 'lib', 'vite', 'htmlReport');\n await copyFileAndMakeWritable(path.join(appFolder, 'index.html'), path.join(this._reportFolder, 'index.html'));\n\n // Copy trace viewer.\n if (this._hasTraces) {\n const traceViewerFolder = path.join(require.resolve('playwright-core'), '..', 'lib', 'vite', 'traceViewer');\n const traceViewerTargetFolder = path.join(this._reportFolder, 'trace');\n const traceViewerAssetsTargetFolder = path.join(traceViewerTargetFolder, 'assets');\n fs.mkdirSync(traceViewerAssetsTargetFolder, { recursive: true });\n for (const file of fs.readdirSync(traceViewerFolder)) {\n if (file.endsWith('.map') || file.includes('watch') || file.includes('assets'))\n continue;\n await copyFileAndMakeWritable(path.join(traceViewerFolder, file), path.join(traceViewerTargetFolder, file));\n }\n for (const file of fs.readdirSync(path.join(traceViewerFolder, 'assets'))) {\n if (file.endsWith('.map') || file.includes('xtermModule'))\n continue;\n await copyFileAndMakeWritable(path.join(traceViewerFolder, 'assets', file), path.join(traceViewerAssetsTargetFolder, file));\n }\n }\n\n await this._writeReportData(path.join(this._reportFolder, 'index.html'));\n\n\n return { ok, singleTestId };\n }\n\n private async _writeReportData(filePath: string) {\n fs.appendFileSync(filePath, '<script id=\"playwrightReportBase64\" type=\"application/zip\">data:application/zip;base64,');\n await new Promise(f => {\n this._dataZipFile!.end(undefined, () => {\n this._dataZipFile!.outputStream\n .pipe(new Base64Encoder())\n .pipe(fs.createWriteStream(filePath, { flags: 'a' })).on('close', f);\n });\n });\n fs.appendFileSync(filePath, '</script>');\n }\n\n private _addDataFile(fileName: string, data: any) {\n this._dataZipFile.addBuffer(Buffer.from(JSON.stringify(data)), fileName);\n }\n\n private _createEntryForSuite(data: DataMap, projectName: string, suite: api.Suite, fileName: string, deep: boolean) {\n const fileId = calculateSha1(fileName).slice(0, 20);\n let fileEntry = data.get(fileId);\n if (!fileEntry) {\n fileEntry = {\n testFile: { fileId, fileName, tests: [] },\n testFileSummary: { fileId, fileName, tests: [], stats: emptyStats() },\n };\n data.set(fileId, fileEntry);\n }\n\n const { testFile, testFileSummary } = fileEntry;\n const testEntries: TestEntry[] = [];\n this._processSuite(suite, projectName, [], deep, testEntries);\n for (const test of testEntries) {\n testFile.tests.push(test.testCase);\n testFileSummary.tests.push(test.testCaseSummary);\n }\n }\n\n private _processSuite(suite: api.Suite, projectName: string, path: string[], deep: boolean, outTests: TestEntry[]) {\n const newPath = [...path, suite.title];\n suite.entries().forEach(e => {\n if (e.type === 'test')\n outTests.push(this._createTestEntry(e, projectName, newPath));\n else if (deep)\n this._processSuite(e, projectName, newPath, deep, outTests);\n });\n }\n\n private _createTestEntry(test: api.TestCase, projectName: string, path: string[]): TestEntry {\n const duration = test.results.reduce((a, r) => a + r.duration, 0);\n const location = this._relativeLocation(test.location)!;\n path = path.slice(1).filter(path => path.length > 0);\n const results = test.results.map(r => this._createTestResult(test, r));\n\n return {\n testCase: {\n testId: test.id,\n title: test.title,\n projectName,\n location,\n duration,\n annotations: this._serializeAnnotations(test.annotations),\n tags: test.tags,\n outcome: test.outcome(),\n path,\n results,\n ok: test.outcome() === 'expected' || test.outcome() === 'flaky',\n },\n testCaseSummary: {\n testId: test.id,\n title: test.title,\n projectName,\n location,\n duration,\n annotations: this._serializeAnnotations(test.annotations),\n tags: test.tags,\n outcome: test.outcome(),\n path,\n ok: test.outcome() === 'expected' || test.outcome() === 'flaky',\n results: results.map(result => {\n return { attachments: result.attachments.map(a => ({ name: a.name, contentType: a.contentType, path: a.path })) };\n }),\n },\n };\n }\n\n private _serializeAttachments(attachments: JsonAttachment[]) {\n let lastAttachment: TestAttachment | undefined;\n return attachments.map(a => {\n if (a.name === 'trace')\n this._hasTraces = true;\n\n if ((a.name === 'stdout' || a.name === 'stderr') && a.contentType === 'text/plain') {\n if (lastAttachment &&\n lastAttachment.name === a.name &&\n lastAttachment.contentType === a.contentType) {\n lastAttachment.body += stripAnsiEscapes(a.body as string);\n return null;\n }\n a.body = stripAnsiEscapes(a.body as string);\n lastAttachment = a as TestAttachment;\n return a;\n }\n\n if (a.path) {\n let fileName = a.path;\n try {\n const buffer = fs.readFileSync(a.path);\n const sha1 = calculateSha1(buffer) + path.extname(a.path);\n fileName = this._attachmentsBaseURL + sha1;\n fs.mkdirSync(path.join(this._reportFolder, 'data'), { recursive: true });\n fs.writeFileSync(path.join(this._reportFolder, 'data', sha1), buffer);\n } catch (e) {\n }\n return {\n name: a.name,\n contentType: a.contentType,\n path: fileName,\n body: a.body,\n };\n }\n\n if (a.body instanceof Buffer) {\n if (isTextContentType(a.contentType)) {\n // Content type is like this: \"text/html; charset=UTF-8\"\n const charset = a.contentType.match(/charset=(.*)/)?.[1];\n try {\n const body = a.body.toString(charset as any || 'utf-8');\n return {\n name: a.name,\n contentType: a.contentType,\n body,\n };\n } catch (e) {\n // Invalid encoding, fall through and save to file.\n }\n }\n\n fs.mkdirSync(path.join(this._reportFolder, 'data'), { recursive: true });\n const extension = sanitizeForFilePath(path.extname(a.name).replace(/^\\./, '')) || mime.getExtension(a.contentType) || 'dat';\n const sha1 = calculateSha1(a.body) + '.' + extension;\n fs.writeFileSync(path.join(this._reportFolder, 'data', sha1), a.body);\n return {\n name: a.name,\n contentType: a.contentType,\n path: this._attachmentsBaseURL + sha1,\n };\n }\n\n // string\n return {\n name: a.name,\n contentType: a.contentType,\n body: a.body,\n };\n }).filter(Boolean) as TestAttachment[];\n }\n\n private _serializeAnnotations(annotations: api.TestCase['annotations']): TestAnnotation[] {\n // Annotations can be pushed directly, with a wrong type.\n return annotations.map(a => ({\n type: a.type,\n description: a.description === undefined ? undefined : String(a.description),\n location: a.location ? {\n file: a.location.file,\n line: a.location.line,\n column: a.location.column,\n } : undefined,\n }));\n }\n\n private _createTestResult(test: api.TestCase, result: api.TestResult): TestResult {\n return {\n duration: result.duration,\n startTime: result.startTime.toISOString(),\n retry: result.retry,\n steps: dedupeSteps(result.steps).map(s => this._createTestStep(s, result)),\n errors: formatResultFailure(internalScreen, test, result, '').map(error => {\n return {\n message: error.message,\n codeframe: error.location ? createErrorCodeframe(error.message, error.location) : undefined\n };\n }),\n status: result.status,\n annotations: this._serializeAnnotations(result.annotations),\n attachments: this._serializeAttachments([\n ...result.attachments,\n ...result.stdout.map(m => stdioAttachment(m, 'stdout')),\n ...result.stderr.map(m => stdioAttachment(m, 'stderr'))]),\n };\n }\n\n private _createTestStep(dedupedStep: DedupedStep, result: api.TestResult): TestStep {\n const { step, duration, count } = dedupedStep;\n const skipped = dedupedStep.step.annotations?.find(a => a.type === 'skip');\n let title = step.title;\n if (skipped)\n title = `${title} (skipped${skipped.description ? ': ' + skipped.description : ''})`;\n const testStep: TestStep = {\n title,\n startTime: step.startTime.toISOString(),\n duration,\n steps: dedupeSteps(step.steps).map(s => this._createTestStep(s, result)),\n attachments: step.attachments.map(s => {\n const index = result.attachments.indexOf(s);\n if (index === -1)\n throw new Error('Unexpected, attachment not found');\n return index;\n }),\n location: this._relativeLocation(step.location),\n error: step.error?.message,\n count,\n skipped: !!skipped,\n };\n if (step.location)\n this._stepsInFile.set(step.location.file, testStep);\n return testStep;\n }\n\n private _relativeLocation(location: api.Location | undefined): api.Location | undefined {\n if (!location)\n return undefined;\n const file = toPosixPath(path.relative(this._config.rootDir, location.file));\n return {\n file,\n line: location.line,\n column: location.column,\n };\n }\n}\n\nconst emptyStats = (): Stats => {\n return {\n total: 0,\n expected: 0,\n unexpected: 0,\n flaky: 0,\n skipped: 0,\n ok: true,\n };\n};\n\nconst addStats = (stats: Stats, delta: Stats): Stats => {\n stats.total += delta.total;\n stats.skipped += delta.skipped;\n stats.expected += delta.expected;\n stats.unexpected += delta.unexpected;\n stats.flaky += delta.flaky;\n stats.ok = stats.ok && delta.ok;\n return stats;\n};\n\nclass Base64Encoder extends Transform {\n private _remainder: Buffer | undefined;\n\n override _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void {\n if (this._remainder) {\n chunk = Buffer.concat([this._remainder, chunk]);\n this._remainder = undefined;\n }\n\n const remaining = chunk.length % 3;\n if (remaining) {\n this._remainder = chunk.slice(chunk.length - remaining);\n chunk = chunk.slice(0, chunk.length - remaining);\n }\n chunk = chunk.toString('base64');\n this.push(Buffer.from(chunk));\n callback();\n }\n\n override _flush(callback: TransformCallback): void {\n if (this._remainder)\n this.push(Buffer.from(this._remainder.toString('base64')));\n callback();\n }\n}\n\nfunction isTextContentType(contentType: string) {\n return contentType.startsWith('text/') || contentType.startsWith('application/json');\n}\n\ntype JsonAttachment = {\n name: string;\n body?: string | Buffer;\n path?: string;\n contentType: string;\n};\n\nfunction stdioAttachment(chunk: Buffer | string, type: 'stdout' | 'stderr'): JsonAttachment {\n return {\n name: type,\n contentType: 'text/plain',\n body: typeof chunk === 'string' ? chunk : chunk.toString('utf-8')\n };\n}\n\ntype DedupedStep = { step: api.TestStep, count: number, duration: number };\n\nfunction dedupeSteps(steps: api.TestStep[]) {\n const result: DedupedStep[] = [];\n let lastResult = undefined;\n for (const step of steps) {\n const canDedupe = !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;\n const lastStep = lastResult?.step;\n if (canDedupe && lastResult && lastStep && step.category === lastStep.category && step.title === lastStep.title && step.location?.file === lastStep.location?.file && step.location?.line === lastStep.location?.line && step.location?.column === lastStep.location?.column) {\n ++lastResult.count;\n lastResult.duration += step.duration;\n continue;\n }\n lastResult = { step, count: 1, duration: step.duration };\n result.push(lastResult);\n if (!canDedupe)\n lastResult = undefined;\n }\n return result;\n}\n\nfunction createSnippets(stepsInFile: MultiMap<string, TestStep>) {\n for (const file of stepsInFile.keys()) {\n let source: string;\n try {\n source = fs.readFileSync(file, 'utf-8') + '\\n//';\n } catch (e) {\n continue;\n }\n const lines = source.split('\\n').length;\n const highlighted = codeFrameColumns(source, { start: { line: lines, column: 1 } }, { highlightCode: true, linesAbove: lines, linesBelow: 0 });\n const highlightedLines = highlighted.split('\\n');\n const lineWithArrow = highlightedLines[highlightedLines.length - 1];\n for (const step of stepsInFile.get(file)) {\n // Don't bother with snippets that have less than 3 lines.\n if (step.location!.line < 2 || step.location!.line >= lines)\n continue;\n // Cut out snippet.\n const snippetLines = highlightedLines.slice(step.location!.line - 2, step.location!.line + 1);\n // Relocate arrow.\n const index = lineWithArrow.indexOf('^');\n const shiftedArrow = lineWithArrow.slice(0, index) + ' '.repeat(step.location!.column - 1) + lineWithArrow.slice(index);\n // Insert arrow line.\n snippetLines.splice(2, 0, shiftedArrow);\n step.snippet = snippetLines.join('\\n');\n }\n }\n}\n\nfunction createErrorCodeframe(message: string, location: Location) {\n let source: string;\n try {\n source = fs.readFileSync(location.file, 'utf-8') + '\\n//';\n } catch (e) {\n return;\n }\n\n return codeFrameColumns(\n source,\n {\n start: {\n line: location.line,\n column: location.column,\n },\n },\n {\n highlightCode: false,\n linesAbove: 100,\n linesBelow: 100,\n message: stripAnsiEscapes(message).split('\\n')[0] || undefined,\n }\n );\n}\n\nfunction writeLine(line: string) {\n // eslint-disable-next-line no-restricted-properties\n process.stdout.write(line + '\\n');\n}\n\nexport default HtmlReporter;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AACf,kBAAiB;AACjB,oBAA0B;AAE1B,mBAAoM;AACpM,IAAAA,gBAAuB;AACvB,yBAAqB;AACrB,IAAAC,sBAAqB;AACrB,uBAAqB;AAErB,kBAAwF;AACxF,yBAAiC;AACjC,kBAA4D;AAe5D,MAAM,oBAA4C,CAAC,UAAU,SAAS,YAAY;AAElF,MAAM,qBAAqB,CAAC,SAA+C;AACzE,SAAO,kBAAkB,SAAS,IAA4B;AAChE;AAEA,MAAM,aAAmC;AAAA,EAYvC,YAAY,SAA4D;AAFxE,SAAQ,kBAAmC,CAAC;AAG1C,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAwB;AAClC,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,QAAQ,OAAkB;AACxB,UAAM,EAAE,cAAc,MAAAC,OAAM,oBAAoB,MAAM,KAAK,IAAI,KAAK,gBAAgB;AACpF,SAAK,gBAAgB;AACrB,SAAK,QAAQA;AACb,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,sBAAsB;AAC3B,UAAM,mBAAmB,oBAAI,IAAY;AACzC,eAAW,WAAW,KAAK,OAAO,UAAU;AAC1C,UAAI,KAAK,gBAAgB,cAAc,QAAQ,SAAS,KAAK,KAAK,gBAAgB,QAAQ,WAAW,YAAY,GAAG;AAClH,cAAM,MAAM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AEA,IAAO,eAAQ;",
|
|
6
|
-
"names": ["import_utils", "import_utilsBundle", "open", "path", "fs"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/internalReporter.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\n\nimport { monotonicTime } from 'playwright-core/lib/utils';\n\nimport { internalScreen, prepareErrorStack, relativeFilePath } from './base';\nimport { Multiplexer } from './multiplexer';\nimport { Suite } from '../common/test';\nimport { codeFrameColumns } from '../transform/babelBundle';\nimport { wrapReporterAsV2 } from './reporterV2';\n\nimport type { AnyReporter, ReporterV2 } from './reporterV2';\nimport type { FullConfig, FullResult, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\n\n\nexport class InternalReporter implements ReporterV2 {\n private _reporter: ReporterV2;\n private _didBegin = false;\n private _config!: FullConfig;\n private _startTime: Date | undefined;\n private _monotonicStartTime: number | undefined;\n\n constructor(reporters: AnyReporter[]) {\n this._reporter = new Multiplexer(reporters.map(wrapReporterAsV2));\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: FullConfig) {\n this._config = config;\n this._startTime = new Date();\n this._monotonicStartTime = monotonicTime();\n this._reporter.onConfigure?.(config);\n }\n\n onBegin(suite: Suite) {\n this._didBegin = true;\n this._reporter.onBegin?.(suite);\n }\n\n onTestBegin(test: TestCase, result: TestResult) {\n this._reporter.onTestBegin?.(test, result);\n }\n\n onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n this._reporter.onStdOut?.(chunk, test, result);\n }\n\n onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n this._reporter.onStdErr?.(chunk, test, result);\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n this._addSnippetToTestErrors(test, result);\n this._reporter.onTestEnd?.(test, result);\n }\n\n async onEnd(result: { status: FullResult['status'] }) {\n if (!this._didBegin) {\n // onBegin was not reported, emit it.\n this.onBegin(new Suite('', 'root'));\n }\n return await this._reporter.onEnd?.({\n ...result,\n startTime: this._startTime!,\n duration: monotonicTime() - this._monotonicStartTime!,\n });\n }\n\n async onExit() {\n await this._reporter.onExit?.();\n }\n\n onError(error: TestError) {\n addLocationAndSnippetToError(this._config, error);\n this._reporter.onError?.(error);\n }\n\n onStepBegin(test: TestCase, result: TestResult, step: TestStep) {\n this._reporter.onStepBegin?.(test, result, step);\n }\n\n onStepEnd(test: TestCase, result: TestResult, step: TestStep) {\n this._addSnippetToStepError(test, step);\n this._reporter.onStepEnd?.(test, result, step);\n }\n\n printsToStdio() {\n return this._reporter.printsToStdio ? this._reporter.printsToStdio() : true;\n }\n\n private _addSnippetToTestErrors(test: TestCase, result: TestResult) {\n for (const error of result.errors)\n addLocationAndSnippetToError(this._config, error, test.location.file);\n }\n\n private _addSnippetToStepError(test: TestCase, step: TestStep) {\n if (step.error)\n addLocationAndSnippetToError(this._config, step.error, test.location.file);\n }\n}\n\nfunction addLocationAndSnippetToError(config: FullConfig, error: TestError, file?: string) {\n if (error.stack && !error.location)\n error.location = prepareErrorStack(error.stack).location;\n const location = error.location;\n if (!location)\n return;\n\n try {\n const tokens = [];\n const source = fs.readFileSync(location.file, 'utf8');\n const codeFrame = codeFrameColumns(source, { start: location }, { highlightCode: true });\n // Convert /var/folders to /private/var/folders on Mac.\n if (!file || fs.realpathSync(file) !== location.file) {\n tokens.push(internalScreen.colors.gray(` at `) + `${relativeFilePath(internalScreen, config, location.file)}:${location.line}`);\n tokens.push('');\n }\n tokens.push(codeFrame);\n error.snippet = tokens.join('\\n');\n } catch (e) {\n // Failed to read the source file - that's ok.\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AAEf,mBAA8B;AAE9B,kBAAoE;AACpE,yBAA4B;AAC5B,kBAAsB;AACtB,yBAAiC;AACjC,wBAAiC;AAM1B,MAAM,iBAAuC;AAAA,EAOlD,YAAY,WAA0B;AALtC,SAAQ,YAAY;AAMlB,SAAK,YAAY,IAAI,+BAAY,UAAU,IAAI,kCAAgB,CAAC;AAAA,EAClE;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAoB;AAC9B,SAAK,UAAU;AACf,SAAK,aAAa,oBAAI,KAAK;AAC3B,SAAK,0BAAsB,4BAAc;AACzC,SAAK,UAAU,cAAc,MAAM;AAAA,EACrC;AAAA,EAEA,QAAQ,OAAc;AACpB,SAAK,YAAY;AACjB,SAAK,UAAU,UAAU,KAAK;AAAA,EAChC;AAAA,EAEA,YAAY,MAAgB,QAAoB;AAC9C,SAAK,UAAU,cAAc,MAAM,MAAM;AAAA,EAC3C;AAAA,EAEA,SAAS,OAAwB,MAAiB,QAAqB;AACrE,SAAK,UAAU,WAAW,OAAO,MAAM,MAAM;AAAA,EAC/C;AAAA,EAEA,SAAS,OAAwB,MAAiB,QAAqB;AACrE,SAAK,UAAU,WAAW,OAAO,MAAM,MAAM;AAAA,EAC/C;AAAA,EAEA,UAAU,MAAgB,QAAoB;AAC5C,SAAK,wBAAwB,MAAM,MAAM;AACzC,SAAK,UAAU,YAAY,MAAM,MAAM;AAAA,EACzC;AAAA,EAEA,MAAM,MAAM,QAA0C;AACpD,QAAI,CAAC,KAAK,WAAW;AAEnB,WAAK,QAAQ,IAAI,kBAAM,IAAI,MAAM,CAAC;AAAA,IACpC;AACA,WAAO,MAAM,KAAK,U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aAAa,IAAI,MAAM,SAAS,MAAM;AACpD,aAAO,KAAK,2BAAe,OAAO,KAAK,QAAQ,IAAI,OAAG,8BAAiB,4BAAgB,QAAQ,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI,EAAE;AAChI,aAAO,KAAK,EAAE;AAAA,IAChB;AACA,WAAO,KAAK,SAAS;AACrB,UAAM,UAAU,OAAO,KAAK,IAAI;AAAA,EAClC,SAAS,GAAG;AAAA,EAEZ;AACF;",
|
|
6
|
-
"names": ["fs"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/json.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { toPosixPath, MultiMap } from 'playwright-core/lib/utils';\n\nimport { formatError, nonTerminalScreen, prepareErrorStack, resolveOutputFile, CommonReporterOptions } from './base';\nimport { getProjectId } from '../common/config';\n\nimport type { ReporterV2 } from './reporterV2';\nimport type { JsonReporterOptions } from '../../types/test';\nimport type { FullConfig, FullResult, JSONReport, JSONReportError, JSONReportSpec, JSONReportSuite, JSONReportTest, JSONReportTestResult, JSONReportTestStep, Location, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\n\nclass JSONReporter implements ReporterV2 {\n config!: FullConfig;\n suite!: Suite;\n private _errors: TestError[] = [];\n private _resolvedOutputFile: string | undefined;\n\n constructor(options: JsonReporterOptions & CommonReporterOptions) {\n this._resolvedOutputFile = resolveOutputFile('JSON', options)?.outputFile;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n printsToStdio() {\n return !this._resolvedOutputFile;\n }\n\n onConfigure(config: FullConfig) {\n this.config = config;\n }\n\n onBegin(suite: Suite) {\n this.suite = suite;\n }\n\n onError(error: TestError): void {\n this._errors.push(error);\n }\n\n async onEnd(result: FullResult) {\n await outputReport(this._serializeReport(result), this._resolvedOutputFile);\n }\n\n private _serializeReport(result: FullResult): JSONReport {\n const report: JSONReport = {\n config: {\n ...removePrivateFields(this.config),\n rootDir: toPosixPath(this.config.rootDir),\n projects: this.config.projects.map(project => {\n return {\n outputDir: toPosixPath(project.outputDir),\n repeatEach: project.repeatEach,\n retries: project.retries,\n metadata: project.metadata,\n id: getProjectId(project),\n name: project.name,\n testDir: toPosixPath(project.testDir),\n testIgnore: serializePatterns(project.testIgnore),\n testMatch: serializePatterns(project.testMatch),\n timeout: project.timeout,\n };\n })\n },\n suites: this._mergeSuites(this.suite.suites),\n errors: this._errors,\n stats: {\n startTime: result.startTime.toISOString(),\n duration: result.duration,\n expected: 0,\n skipped: 0,\n unexpected: 0,\n flaky: 0,\n },\n };\n for (const test of this.suite.allTests())\n ++report.stats[test.outcome()];\n return report;\n }\n\n private _mergeSuites(suites: Suite[]): JSONReportSuite[] {\n const fileSuites = new MultiMap<string, JSONReportSuite>();\n for (const projectSuite of suites) {\n const projectId = getProjectId(projectSuite.project()!);\n const projectName = projectSuite.project()!.name;\n for (const fileSuite of projectSuite.suites) {\n const file = fileSuite.location!.file;\n const serialized = this._serializeSuite(projectId, projectName, fileSuite);\n if (serialized)\n fileSuites.set(file, serialized);\n }\n }\n\n const results: JSONReportSuite[] = [];\n for (const [, suites] of fileSuites) {\n const result: JSONReportSuite = {\n title: suites[0].title,\n file: suites[0].file,\n column: 0,\n line: 0,\n specs: [],\n };\n for (const suite of suites)\n this._mergeTestsFromSuite(result, suite);\n results.push(result);\n }\n return results;\n }\n\n private _relativeLocation(location: Location | undefined): Location {\n if (!location)\n return { file: '', line: 0, column: 0 };\n return {\n file: toPosixPath(path.relative(this.config.rootDir, location.file)),\n line: location.line,\n column: location.column,\n };\n }\n\n private _locationMatches(s1: JSONReportSuite | JSONReportSpec, s2: JSONReportSuite | JSONReportSpec) {\n return s1.file === s2.file && s1.line === s2.line && s1.column === s2.column;\n }\n\n private _mergeTestsFromSuite(to: JSONReportSuite, from: JSONReportSuite) {\n for (const fromSuite of from.suites || []) {\n const toSuite = (to.suites || []).find(s => s.title === fromSuite.title && this._locationMatches(s, fromSuite));\n if (toSuite) {\n this._mergeTestsFromSuite(toSuite, fromSuite);\n } else {\n if (!to.suites)\n to.suites = [];\n to.suites.push(fromSuite);\n }\n }\n\n for (const spec of from.specs || []) {\n const toSpec = to.specs.find(s => s.title === spec.title && s.file === toPosixPath(path.relative(this.config.rootDir, spec.file)) && s.line === spec.line && s.column === spec.column);\n if (toSpec)\n toSpec.tests.push(...spec.tests);\n else\n to.specs.push(spec);\n }\n }\n\n private _serializeSuite(projectId: string, projectName: string, suite: Suite): null | JSONReportSuite {\n if (!suite.allTests().length)\n return null;\n const suites = suite.suites.map(suite => this._serializeSuite(projectId, projectName, suite)).filter(s => s) as JSONReportSuite[];\n return {\n title: suite.title,\n ...this._relativeLocation(suite.location),\n specs: suite.tests.map(test => this._serializeTestSpec(projectId, projectName, test)),\n suites: suites.length ? suites : undefined,\n };\n }\n\n private _serializeTestSpec(projectId: string, projectName: string, test: TestCase): JSONReportSpec {\n return {\n title: test.title,\n ok: test.ok(),\n tags: test.tags.map(tag => tag.substring(1)), // Strip '@'.\n tests: [this._serializeTest(projectId, projectName, test)],\n id: test.id,\n ...this._relativeLocation(test.location),\n };\n }\n\n private _serializeTest(projectId: string, projectName: string, test: TestCase): JSONReportTest {\n return {\n timeout: test.timeout,\n annotations: test.annotations,\n expectedStatus: test.expectedStatus,\n projectId,\n projectName,\n results: test.results.map(r => this._serializeTestResult(r, test)),\n status: test.outcome(),\n };\n }\n\n private _serializeTestResult(result: TestResult, test: TestCase): JSONReportTestResult {\n const steps = result.steps.filter(s => s.category === 'test.step');\n const jsonResult: JSONReportTestResult = {\n workerIndex: result.workerIndex,\n parallelIndex: result.parallelIndex,\n status: result.status,\n duration: result.duration,\n error: result.error,\n errors: result.errors.map(e => this._serializeError(e)),\n stdout: result.stdout.map(s => stdioEntry(s)),\n stderr: result.stderr.map(s => stdioEntry(s)),\n retry: result.retry,\n steps: steps.length ? steps.map(s => this._serializeTestStep(s)) : undefined,\n startTime: result.startTime.toISOString(),\n annotations: result.annotations,\n attachments: result.attachments.map(a => ({\n name: a.name,\n contentType: a.contentType,\n path: a.path,\n body: a.body?.toString('base64')\n })),\n };\n if (result.error?.stack)\n jsonResult.errorLocation = prepareErrorStack(result.error.stack).location;\n return jsonResult;\n }\n\n private _serializeError(error: TestError): JSONReportError {\n return formatError(nonTerminalScreen, error);\n }\n\n private _serializeTestStep(step: TestStep): JSONReportTestStep {\n const steps = step.steps.filter(s => s.category === 'test.step');\n return {\n title: step.title,\n duration: step.duration,\n error: step.error,\n steps: steps.length ? steps.map(s => this._serializeTestStep(s)) : undefined,\n };\n }\n}\n\nasync function outputReport(report: JSONReport, resolvedOutputFile: string | undefined) {\n const reportString = JSON.stringify(report, undefined, 2);\n if (resolvedOutputFile) {\n await fs.promises.mkdir(path.dirname(resolvedOutputFile), { recursive: true });\n await fs.promises.writeFile(resolvedOutputFile, reportString);\n } else {\n // eslint-disable-next-line no-console\n console.log(reportString);\n }\n}\n\nfunction stdioEntry(s: string | Buffer): any {\n if (typeof s === 'string')\n return { text: s };\n return { buffer: s.toString('base64') };\n}\n\nfunction removePrivateFields(config: FullConfig): FullConfig {\n return Object.fromEntries(Object.entries(config).filter(([name, value]) => !name.startsWith('_'))) as FullConfig;\n}\n\nexport function serializePatterns(patterns: string | RegExp | (string | RegExp)[]): string[] {\n if (!Array.isArray(patterns))\n patterns = [patterns];\n return patterns.map(s => s.toString());\n}\n\nexport default JSONReporter;\n"],
|
|
5
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AAO,QAAQ,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,WAAW,GAAG,CAAC,CAAC;AACnG;AAEO,SAAS,kBAAkB,UAA2D;AAC3F,MAAI,CAAC,MAAM,QAAQ,QAAQ;AACzB,eAAW,CAAC,QAAQ;AACtB,SAAO,SAAS,IAAI,OAAK,EAAE,SAAS,CAAC;AACvC;AAEA,IAAO,eAAQ;",
|
|
6
|
-
"names": ["suites", "path", "suite", "fs"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/reporters/junit.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { getAsBooleanFromENV } from 'playwright-core/lib/utils';\n\nimport { CommonReporterOptions, formatFailure, nonTerminalScreen, resolveOutputFile } from './base';\nimport { stripAnsiEscapes } from '../util';\n\nimport type { ReporterV2 } from './reporterV2';\nimport type { JUnitReporterOptions } from '../../types/test';\nimport type { FullConfig, FullResult, Suite, TestCase } from '../../types/testReporter';\n\nclass JUnitReporter implements ReporterV2 {\n private config!: FullConfig;\n private configDir: string;\n private suite!: Suite;\n private timestamp!: Date;\n private totalTests = 0;\n private totalFailures = 0;\n private totalSkipped = 0;\n private resolvedOutputFile: string | undefined;\n private stripANSIControlSequences = false;\n private includeProjectInTestName = false;\n\n constructor(options: JUnitReporterOptions & CommonReporterOptions) {\n this.stripANSIControlSequences = getAsBooleanFromENV('PLAYWRIGHT_JUNIT_STRIP_ANSI', !!options.stripANSIControlSequences);\n this.includeProjectInTestName = getAsBooleanFromENV('PLAYWRIGHT_JUNIT_INCLUDE_PROJECT_IN_TEST_NAME', !!options.includeProjectInTestName);\n this.configDir = options.configDir;\n this.resolvedOutputFile = resolveOutputFile('JUNIT', options)?.outputFile;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n printsToStdio() {\n return !this.resolvedOutputFile;\n }\n\n onConfigure(config: FullConfig) {\n this.config = config;\n }\n\n onBegin(suite: Suite) {\n this.suite = suite;\n this.timestamp = new Date();\n }\n\n async onEnd(result: FullResult) {\n const children: XMLEntry[] = [];\n for (const projectSuite of this.suite.suites) {\n for (const fileSuite of projectSuite.suites)\n children.push(await this._buildTestSuite(projectSuite.title, fileSuite));\n }\n const tokens: string[] = [];\n\n const self = this;\n const root: XMLEntry = {\n name: 'testsuites',\n attributes: {\n id: process.env[`PLAYWRIGHT_JUNIT_SUITE_ID`] || '',\n name: process.env[`PLAYWRIGHT_JUNIT_SUITE_NAME`] || '',\n tests: self.totalTests,\n failures: self.totalFailures,\n skipped: self.totalSkipped,\n errors: 0,\n time: result.duration / 1000\n },\n children\n };\n\n serializeXML(root, tokens, this.stripANSIControlSequences);\n const reportString = tokens.join('\\n');\n if (this.resolvedOutputFile) {\n await fs.promises.mkdir(path.dirname(this.resolvedOutputFile), { recursive: true });\n await fs.promises.writeFile(this.resolvedOutputFile, reportString);\n } else {\n // eslint-disable-next-line no-console\n console.log(reportString);\n }\n }\n\n private async _buildTestSuite(projectName: string, suite: Suite): Promise<XMLEntry> {\n let tests = 0;\n let skipped = 0;\n let failures = 0;\n let duration = 0;\n const children: XMLEntry[] = [];\n const testCaseNamePrefix = projectName && this.includeProjectInTestName ? `[${projectName}] ` : '';\n\n for (const test of suite.allTests()){\n ++tests;\n if (test.outcome() === 'skipped')\n ++skipped;\n if (!test.ok())\n ++failures;\n for (const result of test.results)\n duration += result.duration;\n await this._addTestCase(suite.title, testCaseNamePrefix, test, children);\n }\n\n this.totalTests += tests;\n this.totalSkipped += skipped;\n this.totalFailures += failures;\n\n const entry: XMLEntry = {\n name: 'testsuite',\n attributes: {\n name: suite.title,\n timestamp: this.timestamp.toISOString(),\n hostname: projectName,\n tests,\n failures,\n skipped,\n time: duration / 1000,\n errors: 0,\n },\n children\n };\n\n return entry;\n }\n\n private async _addTestCase(suiteName: string, namePrefix: string, test: TestCase, entries: XMLEntry[]) {\n const entry = {\n name: 'testcase',\n attributes: {\n // Skip root, project, file\n name: namePrefix + test.titlePath().slice(3).join(' \u203A '),\n // filename\n classname: suiteName,\n time: (test.results.reduce((acc, value) => acc + value.duration, 0)) / 1000\n\n },\n children: [] as XMLEntry[]\n };\n entries.push(entry);\n\n // Xray Test Management supports testcase level properties, where additional metadata may be provided\n // some annotations are encoded as value attributes, other as cdata content; this implementation supports\n // Xray JUnit extensions but it also agnostic, so other tools can also take advantage of this format\n const properties: XMLEntry = {\n name: 'properties',\n children: [] as XMLEntry[]\n };\n\n for (const annotation of test.annotations) {\n const property: XMLEntry = {\n name: 'property',\n attributes: {\n name: annotation.type,\n value: (annotation?.description ? annotation.description : '')\n }\n };\n properties.children?.push(property);\n }\n\n if (properties.children?.length)\n entry.children.push(properties);\n\n if (test.outcome() === 'skipped') {\n entry.children.push({ name: 'skipped' });\n return;\n }\n\n if (!test.ok()) {\n entry.children.push({\n name: 'failure',\n attributes: {\n message: `${path.basename(test.location.file)}:${test.location.line}:${test.location.column} ${test.title}`,\n type: 'FAILURE',\n },\n text: stripAnsiEscapes(formatFailure(nonTerminalScreen, this.config, test))\n });\n }\n\n const systemOut: string[] = [];\n const systemErr: string[] = [];\n for (const result of test.results) {\n for (const item of result.stdout)\n systemOut.push(item.toString());\n for (const item of result.stderr)\n systemErr.push(item.toString());\n for (const attachment of result.attachments) {\n if (!attachment.path)\n continue;\n\n let attachmentPath = path.relative(this.configDir, attachment.path);\n try {\n if (this.resolvedOutputFile)\n attachmentPath = path.relative(path.dirname(this.resolvedOutputFile), attachment.path);\n } catch {\n systemOut.push(`\\nWarning: Unable to make attachment path ${attachment.path} relative to report output file ${this.resolvedOutputFile}`);\n }\n\n try {\n await fs.promises.access(attachment.path);\n systemOut.push(`\\n[[ATTACHMENT|${attachmentPath}]]\\n`);\n } catch {\n systemErr.push(`\\nWarning: attachment ${attachmentPath} is missing`);\n }\n }\n }\n // Note: it is important to only produce a single system-out/system-err entry\n // so that parsers in the wild understand it.\n if (systemOut.length)\n entry.children.push({ name: 'system-out', text: systemOut.join('') });\n if (systemErr.length)\n entry.children.push({ name: 'system-err', text: systemErr.join('') });\n }\n}\n\ntype XMLEntry = {\n name: string;\n attributes?: { [name: string]: string | number | boolean };\n children?: XMLEntry[];\n text?: string;\n};\n\nfunction serializeXML(entry: XMLEntry, tokens: string[], stripANSIControlSequences: boolean) {\n const attrs: string[] = [];\n for (const [name, value] of Object.entries(entry.attributes || {}))\n attrs.push(`${name}=\"${escape(String(value), stripANSIControlSequences, false)}\"`);\n tokens.push(`<${entry.name}${attrs.length ? ' ' : ''}${attrs.join(' ')}>`);\n for (const child of entry.children || [])\n serializeXML(child, tokens, stripANSIControlSequences);\n if (entry.text)\n tokens.push(escape(entry.text, stripANSIControlSequences, true));\n tokens.push(`</${entry.name}>`);\n}\n\n// See https://en.wikipedia.org/wiki/Valid_characters_in_XML\nconst discouragedXMLCharacters = /[\\u0000-\\u0008\\u000b-\\u000c\\u000e-\\u001f\\u007f-\\u0084\\u0086-\\u009f]/g;\n\nfunction escape(text: string, stripANSIControlSequences: boolean, isCharacterData: boolean): string {\n if (stripANSIControlSequences)\n text = stripAnsiEscapes(text);\n\n if (isCharacterData) {\n text = '<![CDATA[' + text.replace(/]]>/g, ']]>') + ']]>';\n } else {\n const escapeRe = /[&\"'<>]/g;\n text = text.replace(escapeRe, c => ({ '&': '&', '\"': '"', \"'\": ''', '<': '<', '>': '>' }[c]!));\n }\n\n text = text.replace(discouragedXMLCharacters, '');\n return text;\n}\n\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