@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/isomorphic/teleReceiver.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 { Metadata, TestAnnotation } from '../../types/test';\nimport type * as reporterTypes from '../../types/testReporter';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\nexport type StringIntern = (s: string) => string;\nexport type JsonLocation = reporterTypes.Location;\nexport type JsonError = string;\nexport type JsonStackFrame = { file: string, line: number, column: number };\n\nexport type JsonStdIOType = 'stdout' | 'stderr';\n\nexport type JsonConfig = Pick<reporterTypes.FullConfig, 'configFile' | 'globalTimeout' | 'maxFailures' | 'metadata' | 'rootDir' | 'version' | 'workers' | 'globalSetup' | 'globalTeardown'> & {\n // optional for backwards compatibility\n tags?: reporterTypes.FullConfig['tags'],\n};\n\nexport type JsonPattern = {\n s?: string;\n r?: { source: string, flags: string };\n};\n\nexport type JsonProject = {\n grep: JsonPattern[];\n grepInvert: JsonPattern[];\n metadata: Metadata;\n name: string;\n dependencies: string[];\n // This is relative to root dir.\n snapshotDir: string;\n // This is relative to root dir.\n outputDir: string;\n repeatEach: number;\n retries: number;\n suites: JsonSuite[];\n teardown?: string;\n // This is relative to root dir.\n testDir: string;\n testIgnore: JsonPattern[];\n testMatch: JsonPattern[];\n timeout: number;\n use: { [key: string]: any };\n};\n\nexport type JsonSuite = {\n title: string;\n location?: JsonLocation;\n entries: (JsonSuite | JsonTestCase)[];\n};\n\nexport type JsonTestCase = {\n testId: string;\n title: string;\n location: JsonLocation;\n retries: number;\n tags?: string[];\n repeatEachIndex: number;\n annotations?: TestAnnotation[];\n};\n\nexport type JsonTestEnd = {\n testId: string;\n expectedStatus: reporterTypes.TestStatus;\n timeout: number;\n // Dropped in 1.52. Kept as empty array for backwards compatibility.\n annotations: [];\n};\n\nexport type JsonTestResultStart = {\n id: string;\n retry: number;\n workerIndex: number;\n parallelIndex: number;\n startTime: number;\n};\n\nexport type JsonAttachment = Omit<reporterTypes.TestResult['attachments'][0], 'body'> & { base64?: string; };\n\nexport type JsonTestResultEnd = {\n id: string;\n duration: number;\n status: reporterTypes.TestStatus;\n errors: reporterTypes.TestError[];\n /** No longer emitted, but kept for backwards compatibility */\n attachments?: JsonAttachment[];\n annotations?: TestAnnotation[];\n};\n\nexport type JsonTestStepStart = {\n id: string;\n parentStepId?: string;\n title: string;\n category: string,\n startTime: number;\n location?: reporterTypes.Location;\n};\n\nexport type JsonTestStepEnd = {\n id: string;\n duration: number;\n error?: reporterTypes.TestError;\n attachments?: number[]; // index of JsonTestResultEnd.attachments\n annotations?: TestAnnotation[];\n};\n\nexport type JsonTestResultOnAttach = {\n testId: string;\n resultId: string;\n attachments: JsonAttachment[];\n};\n\nexport type JsonFullResult = {\n status: reporterTypes.FullResult['status'];\n startTime: number;\n duration: number;\n};\n\nexport type JsonEvent = JsonOnConfigureEvent | JsonOnBlobReportMetadataEvent | JsonOnEndEvent | JsonOnExitEvent | JsonOnProjectEvent | JsonOnBeginEvent | JsonOnTestBeginEvent\n | JsonOnTestEndEvent | JsonOnStepBeginEvent | JsonOnStepEndEvent | JsonOnAttachEvent | JsonOnErrorEvent | JsonOnStdIOEvent;\n\nexport type JsonOnConfigureEvent = {\n method: 'onConfigure';\n params: {\n config: JsonConfig;\n };\n};\n\nexport type JsonOnBlobReportMetadataEvent = {\n method: 'onBlobReportMetadata';\n params: BlobReportMetadata;\n};\n\nexport type JsonOnProjectEvent = {\n method: 'onProject';\n params: {\n project: JsonProject;\n };\n};\n\nexport type JsonOnBeginEvent = {\n method: 'onBegin';\n params: undefined;\n};\n\nexport type JsonOnTestBeginEvent = {\n method: 'onTestBegin';\n params: {\n testId: string;\n result: JsonTestResultStart;\n };\n};\n\nexport type JsonOnTestEndEvent = {\n method: 'onTestEnd';\n params: {\n test: JsonTestEnd;\n testId?: string;\n result: JsonTestResultEnd;\n };\n};\n\nexport type JsonOnStepBeginEvent = {\n method: 'onStepBegin';\n params: {\n testId: string;\n resultId: string;\n step: JsonTestStepStart;\n };\n};\n\nexport type JsonOnStepEndEvent = {\n method: 'onStepEnd';\n params: {\n testId: string;\n resultId: string;\n step: JsonTestStepEnd;\n };\n};\n\nexport type JsonOnAttachEvent = {\n method: 'onAttach';\n params: JsonTestResultOnAttach;\n};\n\nexport type JsonOnErrorEvent = {\n method: 'onError';\n params: {\n error: reporterTypes.TestError;\n };\n};\n\nexport type JsonOnStdIOEvent = {\n method: 'onStdIO';\n params: {\n type: JsonStdIOType;\n testId?: string;\n resultId?: string;\n data: string;\n isBase64: boolean;\n };\n};\n\nexport type JsonOnEndEvent = {\n method: 'onEnd';\n params: {\n result: JsonFullResult;\n };\n};\n\nexport type JsonOnExitEvent = {\n method: 'onExit';\n params: undefined;\n};\n\nexport type BlobReportMetadata = {\n version: number;\n userAgent: string;\n name?: string;\n shard?: { total: number, current: number };\n pathSeparator?: string;\n};\n\ntype TeleReporterReceiverOptions = {\n mergeProjects?: boolean;\n mergeTestCases?: boolean;\n resolvePath?: (rootDir: string, relativePath: string) => string;\n configOverrides?: Pick<reporterTypes.FullConfig, 'configFile' | 'quiet' | 'reportSlowTests' | 'reporter'>;\n clearPreviousResultsWhenTestBegins?: boolean;\n};\n\nexport class TeleReporterReceiver {\n public isListing = false;\n private _rootSuite: TeleSuite;\n private _options: TeleReporterReceiverOptions;\n private _reporter: ReporterV2;\n private _tests = new Map<string, TeleTestCase>();\n private _rootDir!: string;\n private _config!: reporterTypes.FullConfig;\n\n constructor(reporter: ReporterV2, options: TeleReporterReceiverOptions = {}) {\n this._rootSuite = new TeleSuite('', 'root');\n this._options = options;\n this._reporter = reporter;\n }\n\n reset() {\n this._rootSuite._entries = [];\n this._tests.clear();\n }\n\n dispatch(message: JsonEvent): Promise<void> | void {\n const { method, params } = message;\n if (method === 'onConfigure') {\n this._onConfigure(params.config);\n return;\n }\n if (method === 'onProject') {\n this._onProject(params.project);\n return;\n }\n if (method === 'onBegin') {\n this._onBegin();\n return;\n }\n if (method === 'onTestBegin') {\n this._onTestBegin(params.testId, params.result);\n return;\n }\n if (method === 'onTestEnd') {\n this._onTestEnd(params.test, params.result);\n return;\n }\n if (method === 'onStepBegin') {\n this._onStepBegin(params.testId, params.resultId, params.step);\n return;\n }\n if (method === 'onAttach') {\n this._onAttach(params.testId, params.resultId, params.attachments);\n return;\n }\n if (method === 'onStepEnd') {\n this._onStepEnd(params.testId, params.resultId, params.step);\n return;\n }\n if (method === 'onError') {\n this._onError(params.error);\n return;\n }\n if (method === 'onStdIO') {\n this._onStdIO(params.type, params.testId, params.resultId, params.data, params.isBase64);\n return;\n }\n if (method === 'onEnd')\n return this._onEnd(params.result);\n if (method === 'onExit')\n return this._onExit();\n }\n\n private _onConfigure(config: JsonConfig) {\n this._rootDir = config.rootDir;\n this._config = this._parseConfig(config);\n this._reporter.onConfigure?.(this._config);\n }\n\n private _onProject(project: JsonProject) {\n let projectSuite = this._options.mergeProjects ? this._rootSuite.suites.find(suite => suite.project()!.name === project.name) : undefined;\n if (!projectSuite) {\n projectSuite = new TeleSuite(project.name, 'project');\n this._rootSuite._addSuite(projectSuite);\n }\n // Always update project in watch mode.\n projectSuite._project = this._parseProject(project);\n for (const suite of project.suites)\n this._mergeSuiteInto(suite, projectSuite);\n }\n\n private _onBegin() {\n this._reporter.onBegin?.(this._rootSuite);\n }\n\n private _onTestBegin(testId: string, payload: JsonTestResultStart) {\n const test = this._tests.get(testId)!;\n if (this._options.clearPreviousResultsWhenTestBegins)\n test.results = [];\n const testResult = test._createTestResult(payload.id);\n testResult.retry = payload.retry;\n testResult.workerIndex = payload.workerIndex;\n testResult.parallelIndex = payload.parallelIndex;\n testResult.setStartTimeNumber(payload.startTime);\n this._reporter.onTestBegin?.(test, testResult);\n }\n\n private _onTestEnd(testEndPayload: JsonTestEnd, payload: JsonTestResultEnd) {\n const test = this._tests.get(testEndPayload.testId)!;\n test.timeout = testEndPayload.timeout;\n test.expectedStatus = testEndPayload.expectedStatus;\n const result = test.results.find(r => r._id === payload.id)!;\n result.duration = payload.duration;\n result.status = payload.status;\n result.errors = payload.errors;\n result.error = result.errors?.[0];\n // Attachments are only present here from legacy blobs. These override all _onAttach events\n if (!!payload.attachments)\n result.attachments = this._parseAttachments(payload.attachments);\n if (payload.annotations) {\n this._absoluteAnnotationLocationsInplace(payload.annotations);\n result.annotations = payload.annotations;\n test.annotations = payload.annotations;\n }\n this._reporter.onTestEnd?.(test, result);\n // Free up the memory as won't see these step ids.\n result._stepMap = new Map();\n }\n\n private _onStepBegin(testId: string, resultId: string, payload: JsonTestStepStart) {\n const test = this._tests.get(testId)!;\n const result = test.results.find(r => r._id === resultId)!;\n const parentStep = payload.parentStepId ? result._stepMap.get(payload.parentStepId) : undefined;\n\n const location = this._absoluteLocation(payload.location);\n const step = new TeleTestStep(payload, parentStep, location, result);\n if (parentStep)\n parentStep.steps.push(step);\n else\n result.steps.push(step);\n result._stepMap.set(payload.id, step);\n this._reporter.onStepBegin?.(test, result, step);\n }\n\n private _onStepEnd(testId: string, resultId: string, payload: JsonTestStepEnd) {\n const test = this._tests.get(testId)!;\n const result = test.results.find(r => r._id === resultId)!;\n const step = result._stepMap.get(payload.id)!;\n step._endPayload = payload;\n step.duration = payload.duration;\n step.error = payload.error;\n this._reporter.onStepEnd?.(test, result, step);\n }\n\n private _onAttach(testId: string, resultId: string, attachments: JsonAttachment[]) {\n const test = this._tests.get(testId)!;\n const result = test.results.find(r => r._id === resultId)!;\n result.attachments.push(...attachments.map(a => ({\n name: a.name,\n contentType: a.contentType,\n path: a.path,\n body: a.base64 && (globalThis as any).Buffer ? Buffer.from(a.base64, 'base64') : undefined,\n })));\n }\n\n private _onError(error: reporterTypes.TestError) {\n this._reporter.onError?.(error);\n }\n\n private _onStdIO(type: JsonStdIOType, testId: string | undefined, resultId: string | undefined, data: string, isBase64: boolean) {\n const chunk = isBase64 ? ((globalThis as any).Buffer ? Buffer.from(data, 'base64') : atob(data)) : data;\n const test = testId ? this._tests.get(testId) : undefined;\n const result = test && resultId ? test.results.find(r => r._id === resultId) : undefined;\n if (type === 'stdout') {\n result?.stdout.push(chunk);\n this._reporter.onStdOut?.(chunk, test, result);\n } else {\n result?.stderr.push(chunk);\n this._reporter.onStdErr?.(chunk, test, result);\n }\n }\n\n private async _onEnd(result: JsonFullResult): Promise<void> {\n await this._reporter.onEnd?.({\n status: result.status,\n startTime: new Date(result.startTime),\n duration: result.duration,\n });\n }\n\n private _onExit(): Promise<void> | void {\n return this._reporter.onExit?.();\n }\n\n private _parseConfig(config: JsonConfig): reporterTypes.FullConfig {\n const result = { ...baseFullConfig, ...config };\n if (this._options.configOverrides) {\n result.configFile = this._options.configOverrides.configFile;\n result.reportSlowTests = this._options.configOverrides.reportSlowTests;\n result.quiet = this._options.configOverrides.quiet;\n result.reporter = [...this._options.configOverrides.reporter];\n }\n return result;\n }\n\n private _parseProject(project: JsonProject): TeleFullProject {\n return {\n metadata: project.metadata,\n name: project.name,\n outputDir: this._absolutePath(project.outputDir),\n repeatEach: project.repeatEach,\n retries: project.retries,\n testDir: this._absolutePath(project.testDir),\n testIgnore: parseRegexPatterns(project.testIgnore),\n testMatch: parseRegexPatterns(project.testMatch),\n timeout: project.timeout,\n grep: parseRegexPatterns(project.grep) as RegExp[],\n grepInvert: parseRegexPatterns(project.grepInvert) as RegExp[],\n dependencies: project.dependencies,\n teardown: project.teardown,\n snapshotDir: this._absolutePath(project.snapshotDir),\n use: project.use,\n };\n }\n\n private _parseAttachments(attachments: JsonAttachment[]): reporterTypes.TestResult['attachments'] {\n return attachments.map(a => {\n return {\n ...a,\n body: a.base64 && (globalThis as any).Buffer ? Buffer.from(a.base64, 'base64') : undefined,\n };\n });\n }\n\n private _mergeSuiteInto(jsonSuite: JsonSuite, parent: TeleSuite): void {\n let targetSuite = parent.suites.find(s => s.title === jsonSuite.title);\n if (!targetSuite) {\n targetSuite = new TeleSuite(jsonSuite.title, parent.type === 'project' ? 'file' : 'describe');\n parent._addSuite(targetSuite);\n }\n targetSuite.location = this._absoluteLocation(jsonSuite.location);\n jsonSuite.entries.forEach(e => {\n if ('testId' in e)\n this._mergeTestInto(e, targetSuite!);\n else\n this._mergeSuiteInto(e, targetSuite!);\n });\n }\n\n private _mergeTestInto(jsonTest: JsonTestCase, parent: TeleSuite) {\n let targetTest = this._options.mergeTestCases ? parent.tests.find(s => s.title === jsonTest.title && s.repeatEachIndex === jsonTest.repeatEachIndex) : undefined;\n if (!targetTest) {\n targetTest = new TeleTestCase(jsonTest.testId, jsonTest.title, this._absoluteLocation(jsonTest.location), jsonTest.repeatEachIndex);\n parent._addTest(targetTest);\n this._tests.set(targetTest.id, targetTest);\n }\n this._updateTest(jsonTest, targetTest);\n }\n\n private _updateTest(payload: JsonTestCase, test: TeleTestCase): TeleTestCase {\n test.id = payload.testId;\n test.location = this._absoluteLocation(payload.location);\n test.retries = payload.retries;\n test.tags = payload.tags ?? [];\n test.annotations = payload.annotations ?? [];\n this._absoluteAnnotationLocationsInplace(test.annotations);\n return test;\n }\n\n private _absoluteAnnotationLocationsInplace(annotations: TestAnnotation[]) {\n for (const annotation of annotations) {\n if (annotation.location)\n annotation.location = this._absoluteLocation(annotation.location);\n }\n }\n\n private _absoluteLocation(location: reporterTypes.Location): reporterTypes.Location;\n private _absoluteLocation(location?: reporterTypes.Location): reporterTypes.Location | undefined;\n private _absoluteLocation(location: reporterTypes.Location | undefined): reporterTypes.Location | undefined {\n if (!location)\n return location;\n return {\n ...location,\n file: this._absolutePath(location.file),\n };\n }\n\n private _absolutePath(relativePath: string): string;\n private _absolutePath(relativePath?: string): string | undefined;\n private _absolutePath(relativePath?: string): string | undefined {\n if (relativePath === undefined)\n return;\n return this._options.resolvePath ? this._options.resolvePath(this._rootDir, relativePath) : this._rootDir + '/' + relativePath;\n }\n}\n\nexport class TeleSuite implements reporterTypes.Suite {\n title: string;\n location?: reporterTypes.Location;\n parent?: TeleSuite;\n _entries: (TeleSuite | TeleTestCase)[] = [];\n _requireFile: string = '';\n _timeout: number | undefined;\n _retries: number | undefined;\n _project: TeleFullProject | undefined;\n _parallelMode: 'none' | 'default' | 'serial' | 'parallel' = 'none';\n private readonly _type: 'root' | 'project' | 'file' | 'describe';\n\n constructor(title: string, type: 'root' | 'project' | 'file' | 'describe') {\n this.title = title;\n this._type = type;\n }\n\n get type() {\n return this._type;\n }\n\n get suites(): TeleSuite[] {\n return this._entries.filter(e => e.type !== 'test') as TeleSuite[];\n }\n\n get tests(): TeleTestCase[] {\n return this._entries.filter(e => e.type === 'test') as TeleTestCase[];\n }\n\n entries() {\n return this._entries;\n }\n\n allTests(): reporterTypes.TestCase[] {\n const result: reporterTypes.TestCase[] = [];\n const visit = (suite: reporterTypes.Suite) => {\n for (const entry of suite.entries()) {\n if (entry.type === 'test')\n result.push(entry);\n else\n visit(entry);\n }\n };\n visit(this);\n return result;\n }\n\n titlePath(): string[] {\n const titlePath = this.parent ? this.parent.titlePath() : [];\n // Ignore anonymous describe blocks.\n if (this.title || this._type !== 'describe')\n titlePath.push(this.title);\n return titlePath;\n }\n\n project(): TeleFullProject | undefined {\n return this._project ?? this.parent?.project();\n }\n\n _addTest(test: TeleTestCase) {\n test.parent = this;\n this._entries.push(test);\n }\n\n _addSuite(suite: TeleSuite) {\n suite.parent = this;\n this._entries.push(suite);\n }\n}\n\nexport class TeleTestCase implements reporterTypes.TestCase {\n title: string;\n fn = () => {};\n results: TeleTestResult[] = [];\n location: reporterTypes.Location;\n parent!: TeleSuite;\n type: 'test' = 'test';\n\n expectedStatus: reporterTypes.TestStatus = 'passed';\n timeout = 0;\n annotations: TestAnnotation[] = [];\n retries = 0;\n tags: string[] = [];\n repeatEachIndex = 0;\n id: string;\n\n constructor(id: string, title: string, location: reporterTypes.Location, repeatEachIndex: number) {\n this.id = id;\n this.title = title;\n this.location = location;\n this.repeatEachIndex = repeatEachIndex;\n }\n\n titlePath(): string[] {\n const titlePath = this.parent ? this.parent.titlePath() : [];\n titlePath.push(this.title);\n return titlePath;\n }\n\n outcome(): 'skipped' | 'expected' | 'unexpected' | 'flaky' {\n return computeTestCaseOutcome(this);\n }\n\n ok(): boolean {\n const status = this.outcome();\n return status === 'expected' || status === 'flaky' || status === 'skipped';\n }\n\n _createTestResult(id: string): TeleTestResult {\n const result = new TeleTestResult(this.results.length, id);\n this.results.push(result);\n return result;\n }\n}\n\nclass TeleTestStep implements reporterTypes.TestStep {\n title: string;\n category: string;\n location: reporterTypes.Location | undefined;\n parent: reporterTypes.TestStep | undefined;\n duration: number = -1;\n steps: reporterTypes.TestStep[] = [];\n error: reporterTypes.TestError | undefined;\n\n private _result: TeleTestResult;\n _endPayload?: JsonTestStepEnd;\n\n private _startTime: number = 0;\n\n constructor(payload: JsonTestStepStart, parentStep: reporterTypes.TestStep | undefined, location: reporterTypes.Location | undefined, result: TeleTestResult) {\n this.title = payload.title;\n this.category = payload.category;\n this.location = location;\n this.parent = parentStep;\n this._startTime = payload.startTime;\n this._result = result;\n }\n\n titlePath() {\n const parentPath = this.parent?.titlePath() || [];\n return [...parentPath, this.title];\n }\n\n get startTime(): Date {\n return new Date(this._startTime);\n }\n\n set startTime(value: Date) {\n this._startTime = +value;\n }\n\n get attachments() {\n return this._endPayload?.attachments?.map(index => this._result.attachments[index]) ?? [];\n }\n\n get annotations() {\n return this._endPayload?.annotations ?? [];\n }\n}\n\nexport class TeleTestResult implements reporterTypes.TestResult {\n retry: reporterTypes.TestResult['retry'];\n parallelIndex: reporterTypes.TestResult['parallelIndex'] = -1;\n workerIndex: reporterTypes.TestResult['workerIndex'] = -1;\n duration: reporterTypes.TestResult['duration'] = -1;\n stdout: reporterTypes.TestResult['stdout'] = [];\n stderr: reporterTypes.TestResult['stderr'] = [];\n attachments: reporterTypes.TestResult['attachments'] = [];\n annotations: reporterTypes.TestResult['annotations'] = [];\n status: reporterTypes.TestStatus = 'skipped';\n steps: TeleTestStep[] = [];\n errors: reporterTypes.TestResult['errors'] = [];\n error: reporterTypes.TestResult['error'];\n\n _stepMap = new Map<string, TeleTestStep>();\n _id: string;\n\n private _startTime: number = 0;\n\n constructor(retry: number, id: string) {\n this.retry = retry;\n this._id = id;\n }\n\n setStartTimeNumber(startTime: number) {\n this._startTime = startTime;\n }\n\n get startTime(): Date {\n return new Date(this._startTime);\n }\n\n set startTime(value: Date) {\n this._startTime = +value;\n }\n}\n\nexport type TeleFullProject = reporterTypes.FullProject;\n\nexport const baseFullConfig: reporterTypes.FullConfig = {\n forbidOnly: false,\n fullyParallel: false,\n globalSetup: null,\n globalTeardown: null,\n globalTimeout: 0,\n grep: /.*/,\n grepInvert: null,\n maxFailures: 0,\n metadata: {},\n preserveOutput: 'always',\n projects: [],\n reporter: [[process.env.CI ? 'dot' : 'list']],\n reportSlowTests: { max: 5, threshold: 300_000 /* 5 minutes */ },\n configFile: '',\n rootDir: '',\n quiet: false,\n shard: null,\n tags: [],\n updateSnapshots: 'missing',\n updateSourceMethod: 'patch',\n version: '',\n workers: 0,\n webServer: null,\n};\n\nexport function serializeRegexPatterns(patterns: string | RegExp | (string | RegExp)[]): JsonPattern[] {\n if (!Array.isArray(patterns))\n patterns = [patterns];\n return patterns.map(s => {\n if (typeof s === 'string')\n return { s };\n return { r: { source: s.source, flags: s.flags } };\n });\n}\n\nexport function parseRegexPatterns(patterns: JsonPattern[]): (string | RegExp)[] {\n return patterns.map(p => {\n if (p.s !== undefined)\n return p.s;\n return new RegExp(p.r!.source, p.r!.flags);\n });\n}\n\nexport function computeTestCaseOutcome(test: reporterTypes.TestCase) {\n let skipped = 0;\n let didNotRun = 0;\n let expected = 0;\n let interrupted = 0;\n let unexpected = 0;\n for (const result of test.results) {\n if (result.status === 'interrupted') {\n ++interrupted; // eslint-disable-line @typescript-eslint/no-unused-vars\n } else if (result.status === 'skipped' && test.expectedStatus === 'skipped') {\n // Only tests \"expected to be skipped\" are skipped. These were specifically\n // marked with test.skip or test.fixme.\n ++skipped;\n } else if (result.status === 'skipped') {\n // Tests that were expected to run, but were skipped are \"did not run\".\n // This happens when:\n // - testing finished early;\n // - test failure prevented other tests in the serial suite to run;\n // - probably more cases!\n ++didNotRun; // eslint-disable-line @typescript-eslint/no-unused-vars\n } else if (result.status === test.expectedStatus) {\n // Either passed and expected to pass, or failed and expected to fail.\n ++expected;\n } else {\n ++unexpected;\n }\n }\n\n // Tests that were \"skipped as expected\" are considered equal to \"expected\" below,\n // because that's the expected outcome.\n //\n // However, we specifically differentiate the case of \"only skipped\"\n // and show it as \"skipped\" in all reporters.\n //\n // More exotic cases like \"failed on first run and skipped on retry\" are flaky.\n if (expected === 0 && unexpected === 0)\n return 'skipped'; // all results were skipped or interrupted\n if (unexpected === 0)\n return 'expected'; // no failures, just expected+skipped\n if (expected === 0 && skipped === 0)\n return 'unexpected'; // only failures\n return 'flaky'; // expected+unexpected or skipped+unexpected\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqPO,MAAM,qBAAqB;AAAA,EAShC,YAAY,UAAsB,UAAuC,CAAC,GAAG;AAR7E,SAAO,YAAY;AAInB,SAAQ,SAAS,oBAAI,IAA0B;AAK7C,SAAK,aAAa,IAAI,UAAU,IAAI,MAAM;AAC1C,SAAK,WAAW;AAChB,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,QAAQ;AACN,SAAK,WAAW,WAAW,CAAC;AAC5B,SAAK,OAAO,MAAM;AAAA,EACpB;AAAA,EAEA,SAAS,SAA0C;AACjD,UAAM,EAAE,QAAQ,OAAO,IAAI;AAC3B,QAAI,WAAW,eAAe;AAC5B,WAAK,aAAa,OAAO,MAAM;AAC/B;AAAA,IACF;AACA,QAAI,WAAW,aAAa;AAC1B,WAAK,WAAW,OAAO,OAAO;AAC9B;AAAA,IACF;AACA,QAAI,WAAW,WAAW;AACxB,WAAK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AAuB,MAA8B;AACnE,MAAI,UAAU;AACd,MAAI,YAAY;AAChB,MAAI,WAAW;AACf,MAAI,cAAc;AAClB,MAAI,aAAa;AACjB,aAAW,UAAU,KAAK,SAAS;AACjC,QAAI,OAAO,WAAW,eAAe;AACnC,QAAE;AAAA,IACJ,WAAW,OAAO,WAAW,aAAa,KAAK,mBAAmB,WAAW;AAG3E,QAAE;AAAA,IACJ,WAAW,OAAO,WAAW,WAAW;AAMtC,QAAE;AAAA,IACJ,WAAW,OAAO,WAAW,KAAK,gBAAgB;AAEhD,QAAE;AAAA,IACJ,OAAO;AACL,QAAE;AAAA,IACJ;AAAA,EACF;AASA,MAAI,aAAa,KAAK,eAAe;AACnC,WAAO;AACT,MAAI,eAAe;AACjB,WAAO;AACT,MAAI,aAAa,KAAK,YAAY;AAChC,WAAO;AACT,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/isomorphic/teleSuiteUpdater.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 { TeleReporterReceiver, TeleSuite } from './teleReceiver';\nimport { statusEx } from './testTree';\n\nimport type * as reporterTypes from '../../types/testReporter';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\nexport type TeleSuiteUpdaterProgress = {\n total: number;\n passed: number;\n failed: number;\n skipped: number;\n};\n\nexport type TeleSuiteUpdaterTestModel = {\n config: reporterTypes.FullConfig;\n rootSuite: reporterTypes.Suite;\n loadErrors: reporterTypes.TestError[];\n progress: TeleSuiteUpdaterProgress;\n};\n\nexport type TeleSuiteUpdaterOptions = {\n onUpdate: (force?: boolean) => void,\n onError?: (error: reporterTypes.TestError) => void;\n pathSeparator: string;\n};\n\nexport class TeleSuiteUpdater {\n rootSuite: TeleSuite | undefined;\n config: reporterTypes.FullConfig | undefined;\n readonly loadErrors: reporterTypes.TestError[] = [];\n readonly progress: TeleSuiteUpdaterProgress = {\n total: 0,\n passed: 0,\n failed: 0,\n skipped: 0,\n };\n\n private _receiver: TeleReporterReceiver;\n private _lastRunReceiver: TeleReporterReceiver | undefined;\n private _lastRunTestCount = 0;\n private _options: TeleSuiteUpdaterOptions;\n private _testResultsSnapshot: Map<string, reporterTypes.TestResult[]> | undefined;\n\n constructor(options: TeleSuiteUpdaterOptions) {\n this._receiver = new TeleReporterReceiver(this._createReporter(), {\n mergeProjects: true,\n mergeTestCases: true,\n resolvePath: (rootDir, relativePath) => rootDir + options.pathSeparator + relativePath,\n clearPreviousResultsWhenTestBegins: true,\n });\n this._options = options;\n }\n\n private _createReporter(): ReporterV2 {\n return {\n version: () => 'v2',\n\n onConfigure: (c: reporterTypes.FullConfig) => {\n this.config = c;\n // TeleReportReceiver is merging everything into a single suite, so when we\n // run one test, we still get many tests via rootSuite.allTests().length.\n // To work around that, have a dedicated per-run receiver that will only have\n // suite for a single test run, and hence will have correct total.\n this._lastRunReceiver = new TeleReporterReceiver({\n version: () => 'v2',\n onBegin: (suite: reporterTypes.Suite) => {\n this._lastRunTestCount = suite.allTests().length;\n this._lastRunReceiver = undefined;\n }\n }, {\n mergeProjects: true,\n mergeTestCases: false,\n resolvePath: (rootDir, relativePath) => rootDir + this._options.pathSeparator + relativePath,\n });\n },\n\n onBegin: (suite: reporterTypes.Suite) => {\n if (!this.rootSuite)\n this.rootSuite = suite as TeleSuite;\n // As soon as new test tree is built add previous results, before calling onUpdate\n // to avoid flashing empty results in the UI.\n if (this._testResultsSnapshot) {\n for (const test of this.rootSuite.allTests())\n test.results = this._testResultsSnapshot?.get(test.id) || test.results;\n this._testResultsSnapshot = undefined;\n }\n this.progress.total = this._lastRunTestCount;\n this.progress.passed = 0;\n this.progress.failed = 0;\n this.progress.skipped = 0;\n this._options.onUpdate(true);\n },\n\n onEnd: () => {\n this._options.onUpdate(true);\n },\n\n onTestBegin: (test: reporterTypes.TestCase, testResult: reporterTypes.TestResult) => {\n (testResult as any)[statusEx] = 'running';\n this._options.onUpdate();\n },\n\n onTestEnd: (test: reporterTypes.TestCase, testResult: reporterTypes.TestResult) => {\n if (test.outcome() === 'skipped')\n ++this.progress.skipped;\n else if (test.outcome() === 'unexpected')\n ++this.progress.failed;\n else\n ++this.progress.passed;\n (testResult as any)[statusEx] = testResult.status;\n this._options.onUpdate();\n },\n\n onError: (error: reporterTypes.TestError) => this._handleOnError(error),\n\n printsToStdio: () => false,\n };\n }\n\n processGlobalReport(report: any[]) {\n const receiver = new TeleReporterReceiver({\n version: () => 'v2',\n onConfigure: (c: reporterTypes.FullConfig) => {\n this.config = c;\n },\n onError: (error: reporterTypes.TestError) => this._handleOnError(error)\n });\n for (const message of report)\n void receiver.dispatch(message);\n }\n\n processListReport(report: any[]) {\n // Save test results and reset all projects, the results will be restored after\n // new project structure is built.\n const tests = this.rootSuite?.allTests() || [];\n this._testResultsSnapshot = new Map(tests.map(test => [test.id, test.results]));\n this._receiver.reset();\n for (const message of report)\n void this._receiver.dispatch(message);\n }\n\n processTestReportEvent(message: any) {\n // The order of receiver dispatches matters here, we want to assign `lastRunTestCount`\n // before we use it.\n this._lastRunReceiver?.dispatch(message)?.catch(() => { });\n this._receiver.dispatch(message)?.catch(() => { });\n }\n\n private _handleOnError(error: reporterTypes.TestError) {\n this.loadErrors.push(error);\n this._options.onError?.(error);\n this._options.onUpdate();\n }\n\n asModel(): TeleSuiteUpdaterTestModel {\n return {\n rootSuite: this.rootSuite || new TeleSuite('', 'root'),\n config: this.config!,\n loadErrors: this.loadErrors,\n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SAAS,OAAO,GAAG,MAAM,MAAM;AAAA,IAAE,CAAC;AACzD,SAAK,UAAU,SAAS,OAAO,GAAG,MAAM,MAAM;AAAA,IAAE,CAAC;AAAA,EACnD;AAAA,EAEQ,eAAe,OAAgC;AACrD,SAAK,WAAW,KAAK,KAAK;AAC1B,SAAK,SAAS,UAAU,KAAK;AAC7B,SAAK,SAAS,SAAS;AAAA,EACzB;AAAA,EAEA,UAAqC;AACnC,WAAO;AAAA,MACL,WAAW,KAAK,aAAa,IAAI,8BAAU,IAAI,MAAM;AAAA,MACrD,QAAQ,KAAK;AAAA,MACb,YAAY,KAAK;AAAA,MACjB,UAAU,KAAK;AAAA,IACjB;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/isomorphic/testServerConnection.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 events from './events';\n\nimport type { TestServerInterface, TestServerInterfaceEvents } from '@testIsomorphic/testServerInterface';\n\n// -- Reuse boundary -- Everything below this line is reused in the vscode extension.\n\nexport interface TestServerTransport {\n onmessage(listener: (message: string) => void): void;\n onopen(listener: () => void): void;\n onerror(listener: () => void): void;\n onclose(listener: () => void): void;\n\n send(data: string): void;\n close(): void;\n}\n\nexport class WebSocketTestServerTransport implements TestServerTransport {\n private _ws: WebSocket;\n\n constructor(url: string | URL) {\n this._ws = new WebSocket(url);\n }\n\n onmessage(listener: (message: string) => void) {\n this._ws.addEventListener('message', event => listener(event.data.toString()));\n }\n\n onopen(listener: () => void) {\n this._ws.addEventListener('open', listener);\n }\n\n onerror(listener: () => void) {\n this._ws.addEventListener('error', listener);\n }\n\n onclose(listener: () => void) {\n this._ws.addEventListener('close', listener);\n }\n\n send(data: string) {\n this._ws.send(data);\n }\n\n close() {\n this._ws.close();\n }\n}\n\nexport class TestServerConnection implements TestServerInterface, TestServerInterfaceEvents {\n readonly onClose: events.Event<void>;\n readonly onReport: events.Event<any>;\n readonly onStdio: events.Event<{ type: 'stderr' | 'stdout'; text?: string | undefined; buffer?: string | undefined; }>;\n readonly onTestFilesChanged: events.Event<{ testFiles: string[] }>;\n readonly onLoadTraceRequested: events.Event<{ traceUrl: string }>;\n\n private _onCloseEmitter = new events.EventEmitter<void>();\n private _onReportEmitter = new events.EventEmitter<any>();\n private _onStdioEmitter = new events.EventEmitter<{ type: 'stderr' | 'stdout'; text?: string | undefined; buffer?: string | undefined; }>();\n private _onTestFilesChangedEmitter = new events.EventEmitter<{ testFiles: string[] }>();\n private _onLoadTraceRequestedEmitter = new events.EventEmitter<{ traceUrl: string }>();\n\n private _lastId = 0;\n private _transport: TestServerTransport;\n private _callbacks = new Map<number, { resolve: (arg: any) => void, reject: (arg: Error) => void }>();\n private _connectedPromise: Promise<void>;\n private _isClosed = false;\n\n constructor(transport: TestServerTransport) {\n this.onClose = this._onCloseEmitter.event;\n this.onReport = this._onReportEmitter.event;\n this.onStdio = this._onStdioEmitter.event;\n this.onTestFilesChanged = this._onTestFilesChangedEmitter.event;\n this.onLoadTraceRequested = this._onLoadTraceRequestedEmitter.event;\n\n this._transport = transport;\n this._transport.onmessage(data => {\n const message = JSON.parse(data);\n const { id, result, error, method, params } = message;\n if (id) {\n const callback = this._callbacks.get(id);\n if (!callback)\n return;\n this._callbacks.delete(id);\n if (error)\n callback.reject(new Error(error));\n else\n callback.resolve(result);\n } else {\n this._dispatchEvent(method, params);\n }\n });\n const pingInterval = setInterval(() => this._sendMessage('ping').catch(() => { }), 30000);\n this._connectedPromise = new Promise<void>((f, r) => {\n this._transport.onopen(f);\n this._transport.onerror(r);\n });\n this._transport.onclose(() => {\n this._isClosed = true;\n this._onCloseEmitter.fire();\n clearInterval(pingInterval);\n });\n }\n\n isClosed(): boolean {\n return this._isClosed;\n }\n\n private async _sendMessage(method: string, params?: any): Promise<any> {\n const logForTest = (globalThis as any).__logForTest;\n logForTest?.({ method, params });\n\n await this._connectedPromise;\n const id = ++this._lastId;\n const message = { id, method, params };\n this._transport.send(JSON.stringify(message));\n return new Promise((resolve, reject) => {\n this._callbacks.set(id, { resolve, reject });\n });\n }\n\n private _sendMessageNoReply(method: string, params?: any) {\n this._sendMessage(method, params).catch(() => { });\n }\n\n private _dispatchEvent(method: string, params?: any) {\n if (method === 'report')\n this._onReportEmitter.fire(params);\n else if (method === 'stdio')\n this._onStdioEmitter.fire(params);\n else if (method === 'testFilesChanged')\n this._onTestFilesChangedEmitter.fire(params);\n else if (method === 'loadTraceRequested')\n this._onLoadTraceRequestedEmitter.fire(params);\n }\n\n async initialize(params: Parameters<TestServerInterface['initialize']>[0]): ReturnType<TestServerInterface['initialize']> {\n await this._sendMessage('initialize', params);\n }\n\n async ping(params: Parameters<TestServerInterface['ping']>[0]): ReturnType<TestServerInterface['ping']> {\n await this._sendMessage('ping', params);\n }\n\n async pingNoReply(params: Parameters<TestServerInterface['ping']>[0]) {\n this._sendMessageNoReply('ping', params);\n }\n\n async watch(params: Parameters<TestServerInterface['watch']>[0]): ReturnType<TestServerInterface['watch']> {\n await this._sendMessage('watch', params);\n }\n\n watchNoReply(params: Parameters<TestServerInterface['watch']>[0]) {\n this._sendMessageNoReply('watch', params);\n }\n\n async open(params: Parameters<TestServerInterface['open']>[0]): ReturnType<TestServerInterface['open']> {\n await this._sendMessage('open', params);\n }\n\n openNoReply(params: Parameters<TestServerInterface['open']>[0]) {\n this._sendMessageNoReply('open', params);\n }\n\n async resizeTerminal(params: Parameters<TestServerInterface['resizeTerminal']>[0]): ReturnType<TestServerInterface['resizeTerminal']> {\n await this._sendMessage('resizeTerminal', params);\n }\n\n resizeTerminalNoReply(params: Parameters<TestServerInterface['resizeTerminal']>[0]) {\n this._sendMessageNoReply('resizeTerminal', params);\n }\n\n async checkBrowsers(params: Parameters<TestServerInterface['checkBrowsers']>[0]): ReturnType<TestServerInterface['checkBrowsers']> {\n return await this._sendMessage('checkBrowsers', params);\n }\n\n async installBrowsers(params: Parameters<TestServerInterface['installBrowsers']>[0]): ReturnType<TestServerInterface['installBrowsers']> {\n await this._sendMessage('installBrowsers', params);\n }\n\n async runGlobalSetup(params: Parameters<TestServerInterface['runGlobalSetup']>[0]): ReturnType<TestServerInterface['runGlobalSetup']> {\n return await this._sendMessage('runGlobalSetup', params);\n }\n\n async runGlobalTeardown(params: Parameters<TestServerInterface['runGlobalTeardown']>[0]): ReturnType<TestServerInterface['runGlobalTeardown']> {\n return await this._sendMessage('runGlobalTeardown', params);\n }\n\n async startDevServer(params: Parameters<TestServerInterface['startDevServer']>[0]): ReturnType<TestServerInterface['startDevServer']> {\n return await this._sendMessage('startDevServer', params);\n }\n\n async stopDevServer(params: Parameters<TestServerInterface['stopDevServer']>[0]): ReturnType<TestServerInterface['stopDevServer']> {\n return await this._sendMessage('stopDevServer', params);\n }\n\n async clearCache(params: Parameters<TestServerInterface['clearCache']>[0]): ReturnType<TestServerInterface['clearCache']> {\n return await this._sendMessage('clearCache', params);\n }\n\n async listFiles(params: Parameters<TestServerInterface['listFiles']>[0]): ReturnType<TestServerInterface['listFiles']> {\n return await this._sendMessage('listFiles', params);\n }\n\n async listTests(params: Parameters<TestServerInterface['listTests']>[0]): ReturnType<TestServerInterface['listTests']> {\n return await this._sendMessage('listTests', params);\n }\n\n async runTests(params: Parameters<TestServerInterface['runTests']>[0]): ReturnType<TestServerInterface['runTests']> {\n return await this._sendMessage('runTests', params);\n }\n\n async findRelatedTestFiles(params: Parameters<TestServerInterface['findRelatedTestFiles']>[0]): ReturnType<TestServerInterface['findRelatedTestFiles']> {\n return await this._sendMessage('findRelatedTestFiles', params);\n }\n\n async stopTests(params: Parameters<TestServerInterface['stopTests']>[0]): ReturnType<TestServerInterface['stopTests']> {\n await this._sendMessage('stopTests', params);\n }\n\n stopTestsNoReply(params: Parameters<TestServerInterface['stopTests']>[0]) {\n this._sendMessageNoReply('stopTests', params);\n }\n\n async closeGracefully(params: Parameters<TestServerInterface['closeGracefully']>[0]): ReturnType<TestServerInterface['closeGracefully']> {\n await this._sendMessage('closeGracefully', params);\n }\n\n close() {\n try {\n this._transport.close();\n } catch {\n }\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,aAAwB;AAgBjB,MAAM,6BAA4D;AAAA,EAGvE,YAAY,KAAmB;AAC7B,SAAK,MAAM,IAAI,UAAU,GAAG;AAAA,EAC9B;AAAA,EAEA,UAAU,UAAqC;AAC7C,SAAK,IAAI,iBAAiB,WAAW,WAAS,SAAS,MAAM,KAAK,SAAS,CAAC,CAAC;AAAA,EAC/E;AAAA,EAEA,OAAO,UAAsB;AAC3B,SAAK,IAAI,iBAAiB,QAAQ,QAAQ;AAAA,EAC5C;AAAA,EAEA,QAAQ,UAAsB;AAC5B,SAAK,IAAI,iBAAiB,SAAS,QAAQ;AAAA,EAC7C;AAAA,EAEA,QAAQ,UAAsB;AAC5B,SAAK,IAAI,iBAAiB,SAAS,QAAQ;AAAA,EAC7C;AAAA,EAEA,KAAK,MAAc;AACjB,SAAK,IAAI,KAAK,IAAI;AAAA,EACpB;AAAA,EAEA,QAAQ;AACN,SAAK,IAAI,MAAM;AAAA,EACjB;AACF;AAEO,MAAM,qBAA+E;AAAA,EAmB1F,YAAY,WAAgC;AAZ5C,SAAQ,kBAAkB,IAAI,OAAO,aAAmB;AACxD,SAAQ,mBAAmB,IAAI,OAAO,aAAkB;AACxD,SAAQ,kBAAkB,IAAI,OAAO,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AC9C;AAAA,EAEA,MAAM,gBAAgB,QAAmH;AACvI,UAAM,KAAK,aAAa,mBAAmB,MAAM;AAAA,EACnD;AAAA,EAEA,QAAQ;AACN,QAAI;AACF,WAAK,WAAW,MAAM;AAAA,IACxB,QAAQ;AAAA,IACR;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/isomorphic/testServerInterface.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 { Event } from './events';\nimport type { JsonEvent } from './teleReceiver';\nimport type * as reporterTypes from '../../types/testReporter';\n\n// -- Reuse boundary -- Everything below this line is reused in the vscode extension.\n\nexport type ReportEntry = JsonEvent;\n\nexport interface TestServerInterface {\n initialize(params: {\n serializer?: string,\n closeOnDisconnect?: boolean,\n interceptStdio?: boolean,\n watchTestDirs?: boolean,\n populateDependenciesOnList?: boolean,\n }): Promise<void>;\n\n ping(params: {}): Promise<void>;\n\n watch(params: {\n fileNames: string[];\n }): Promise<void>;\n\n open(params: { location: reporterTypes.Location }): Promise<void>;\n\n resizeTerminal(params: { cols: number, rows: number }): Promise<void>;\n\n checkBrowsers(params: {}): Promise<{ hasBrowsers: boolean }>;\n\n installBrowsers(params: {}): Promise<void>;\n\n runGlobalSetup(params: {}): Promise<{\n report: ReportEntry[],\n status: reporterTypes.FullResult['status']\n }>;\n\n runGlobalTeardown(params: {}): Promise<{\n report: ReportEntry[],\n status: reporterTypes.FullResult['status']\n }>;\n\n startDevServer(params: {}): Promise<{\n report: ReportEntry[];\n status: reporterTypes.FullResult['status']\n }>;\n\n stopDevServer(params: {}): Promise<{\n report: ReportEntry[];\n status: reporterTypes.FullResult['status']\n }>;\n\n clearCache(params: {}): Promise<void>;\n\n listFiles(params: {\n projects?: string[];\n }): Promise<{\n report: ReportEntry[];\n status: reporterTypes.FullResult['status']\n }>;\n\n /**\n * Returns list of teleReporter events.\n */\n listTests(params: {\n projects?: string[];\n locations?: string[];\n grep?: string;\n grepInvert?: string;\n }): Promise<{\n report: ReportEntry[],\n status: reporterTypes.FullResult['status']\n }>;\n\n runTests(params: {\n locations?: string[];\n grep?: string;\n grepInvert?: string;\n testIds?: string[];\n headed?: boolean;\n workers?: number | string;\n updateSnapshots?: 'all' | 'changed' | 'missing' | 'none';\n updateSourceMethod?: 'overwrite' | 'patch' | '3way';\n reporters?: string[],\n trace?: 'on' | 'off';\n video?: 'on' | 'off';\n projects?: string[];\n reuseContext?: boolean;\n connectWsEndpoint?: string;\n timeout?: number;\n }): Promise<{\n status: reporterTypes.FullResult['status'];\n }>;\n\n findRelatedTestFiles(params: {\n files: string[];\n }): Promise<{ testFiles: string[]; errors?: reporterTypes.TestError[]; }>;\n\n stopTests(params: {}): Promise<void>;\n\n closeGracefully(params: {}): Promise<void>;\n}\n\nexport interface TestServerInterfaceEvents {\n onReport: Event<any>;\n onStdio: Event<{ type: 'stdout' | 'stderr', text?: string, buffer?: string }>;\n onTestFilesChanged: Event<{ testFiles: string[] }>;\n onLoadTraceRequested: Event<{ traceUrl: string }>;\n}\n\nexport interface TestServerInterfaceEventEmitters {\n dispatchEvent(event: 'report', params: ReportEntry): void;\n dispatchEvent(event: 'stdio', params: { type: 'stdout' | 'stderr', text?: string, buffer?: string }): void;\n dispatchEvent(event: 'testFilesChanged', params: { testFiles: string[] }): void;\n dispatchEvent(event: 'loadTraceRequested', params: { traceUrl: string }): void;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/isomorphic/testTree.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\nexport type TestItemStatus = 'none' | 'running' | 'scheduled' | 'passed' | 'failed' | 'skipped';\nimport type * as reporterTypes from '../../types/testReporter';\n\n// -- Reuse boundary -- Everything below this line is reused in the vscode extension.\n\nexport type TreeItemBase = {\n kind: 'root' | 'group' | 'case' | 'test',\n id: string;\n title: string;\n location: reporterTypes.Location,\n duration: number;\n parent: TreeItem | undefined;\n children: TreeItem[];\n status: TestItemStatus;\n};\n\nexport type GroupItem = TreeItemBase & {\n kind: 'group';\n subKind: 'folder' | 'file' | 'describe';\n hasLoadErrors: boolean;\n children: (TestCaseItem | GroupItem)[];\n};\n\nexport type TestCaseItem = TreeItemBase & {\n kind: 'case',\n tests: reporterTypes.TestCase[];\n children: TestItem[];\n test: reporterTypes.TestCase | undefined;\n project: reporterTypes.FullProject | undefined;\n tags: Array<string>;\n};\n\nexport type TestItem = TreeItemBase & {\n kind: 'test',\n test: reporterTypes.TestCase;\n project: reporterTypes.FullProject;\n};\n\nexport type TreeItem = GroupItem | TestCaseItem | TestItem;\n\nexport class TestTree {\n rootItem: GroupItem;\n private _treeItemById = new Map<string, TreeItem>();\n private _treeItemByTestId = new Map<string, TestItem | TestCaseItem>();\n readonly pathSeparator: string;\n\n constructor(rootFolder: string, rootSuite: reporterTypes.Suite | undefined, loadErrors: reporterTypes.TestError[], projectFilters: Map<string, boolean> | undefined, pathSeparator: string, hideFiles: boolean) {\n const filterProjects = projectFilters && [...projectFilters.values()].some(Boolean);\n this.pathSeparator = pathSeparator;\n this.rootItem = {\n kind: 'group',\n subKind: 'folder',\n id: rootFolder,\n title: '',\n location: { file: '', line: 0, column: 0 },\n duration: 0,\n parent: undefined,\n children: [],\n status: 'none',\n hasLoadErrors: false,\n };\n this._treeItemById.set(rootFolder, this.rootItem);\n\n const visitSuite = (project: reporterTypes.FullProject, parentSuite: reporterTypes.Suite, parentGroup: GroupItem, mode: 'tests' | 'suites' | 'all') => {\n for (const suite of mode === 'tests' ? [] : parentSuite.suites) {\n if (!suite.title) {\n // Flatten anonymous describes.\n visitSuite(project, suite, parentGroup, 'all');\n continue;\n }\n\n let group = parentGroup.children.find(item => item.kind === 'group' && item.title === suite.title) as GroupItem | undefined;\n if (!group) {\n group = {\n kind: 'group',\n subKind: 'describe',\n id: 'suite:' + parentSuite.titlePath().join('\\x1e') + '\\x1e' + suite.title, // account for anonymous suites\n title: suite.title,\n location: suite.location!,\n duration: 0,\n parent: parentGroup,\n children: [],\n status: 'none',\n hasLoadErrors: false,\n };\n this._addChild(parentGroup, group);\n }\n visitSuite(project, suite, group, 'all');\n }\n\n for (const test of mode === 'suites' ? [] : parentSuite.tests) {\n const title = test.title;\n let testCaseItem = parentGroup.children.find(t => t.kind !== 'group' && t.title === title) as TestCaseItem;\n if (!testCaseItem) {\n testCaseItem = {\n kind: 'case',\n id: 'test:' + test.titlePath().join('\\x1e'),\n title,\n parent: parentGroup,\n children: [],\n tests: [],\n location: test.location,\n duration: 0,\n status: 'none',\n project: undefined,\n test: undefined,\n tags: test.tags,\n };\n this._addChild(parentGroup, testCaseItem);\n }\n\n const result = test.results[0];\n let status: 'none' | 'running' | 'scheduled' | 'passed' | 'failed' | 'skipped' = 'none';\n if ((result as any)?.[statusEx] === 'scheduled')\n status = 'scheduled';\n else if ((result as any)?.[statusEx] === 'running')\n status = 'running';\n else if (result?.status === 'skipped')\n status = 'skipped';\n else if (result?.status === 'interrupted')\n status = 'none';\n else if (result && test.outcome() !== 'expected')\n status = 'failed';\n else if (result && test.outcome() === 'expected')\n status = 'passed';\n\n testCaseItem.tests.push(test);\n const testItem: TestItem = {\n kind: 'test',\n id: test.id,\n title: project.name,\n location: test.location!,\n test,\n parent: testCaseItem,\n children: [],\n status,\n duration: test.results.length ? Math.max(0, test.results[0].duration) : 0,\n project,\n };\n this._addChild(testCaseItem, testItem);\n this._treeItemByTestId.set(test.id, testItem);\n testCaseItem.duration = (testCaseItem.children as TestItem[]).reduce((a, b) => a + b.duration, 0);\n }\n };\n\n for (const projectSuite of rootSuite?.suites || []) {\n if (filterProjects && !projectFilters.get(projectSuite.title))\n continue;\n for (const fileSuite of projectSuite.suites) {\n if (hideFiles) {\n visitSuite(projectSuite.project()!, fileSuite, this.rootItem, 'suites');\n if (fileSuite.tests.length) {\n const defaultDescribeItem = this._defaultDescribeItem();\n visitSuite(projectSuite.project()!, fileSuite, defaultDescribeItem, 'tests');\n }\n } else {\n const fileItem = this._fileItem(fileSuite.location!.file.split(pathSeparator), true);\n visitSuite(projectSuite.project()!, fileSuite, fileItem, 'all');\n }\n }\n }\n\n for (const loadError of loadErrors) {\n if (!loadError.location)\n continue;\n const fileItem = this._fileItem(loadError.location.file.split(pathSeparator), true);\n fileItem.hasLoadErrors = true;\n }\n }\n\n private _addChild(parent: TreeItem, child: TreeItem) {\n parent.children.push(child);\n child.parent = parent;\n this._treeItemById.set(child.id, child);\n }\n\n filterTree(filterText: string, statusFilters: Map<string, boolean>, runningTestIds: Set<string> | undefined) {\n const tokens = filterText.trim().toLowerCase().split(' ');\n const filtersStatuses = [...statusFilters.values()].some(Boolean);\n\n const filter = (testCase: TestCaseItem) => {\n const titleWithTags = [...testCase.tests[0].titlePath(), ...testCase.tests[0].tags].join(' ').toLowerCase();\n if (!tokens.every(token => titleWithTags.includes(token)) && !testCase.tests.some(t => runningTestIds?.has(t.id)))\n return false;\n testCase.children = (testCase.children as TestItem[]).filter(test => {\n return !filtersStatuses || runningTestIds?.has(test.test.id) || statusFilters.get(test.status);\n });\n testCase.tests = (testCase.children as TestItem[]).map(c => c.test);\n return !!testCase.children.length;\n };\n\n const visit = (treeItem: GroupItem) => {\n const newChildren: (GroupItem | TestCaseItem)[] = [];\n for (const child of treeItem.children) {\n if (child.kind === 'case') {\n if (filter(child))\n newChildren.push(child);\n } else {\n visit(child);\n if (child.children.length || child.hasLoadErrors)\n newChildren.push(child);\n }\n }\n treeItem.children = newChildren;\n };\n visit(this.rootItem);\n }\n\n private _fileItem(filePath: string[], isFile: boolean): GroupItem {\n if (filePath.length === 0)\n return this.rootItem;\n const fileName = filePath.join(this.pathSeparator);\n const existingFileItem = this._treeItemById.get(fileName);\n if (existingFileItem)\n return existingFileItem as GroupItem;\n const parentFileItem = this._fileItem(filePath.slice(0, filePath.length - 1), false);\n const fileItem: GroupItem = {\n kind: 'group',\n subKind: isFile ? 'file' : 'folder',\n id: fileName,\n title: filePath[filePath.length - 1],\n location: { file: fileName, line: 0, column: 0 },\n duration: 0,\n parent: parentFileItem,\n children: [],\n status: 'none',\n hasLoadErrors: false,\n };\n this._addChild(parentFileItem, fileItem);\n return fileItem;\n }\n\n private _defaultDescribeItem(): GroupItem {\n let defaultDescribeItem = this._treeItemById.get('<anonymous>') as GroupItem;\n if (!defaultDescribeItem) {\n defaultDescribeItem = {\n kind: 'group',\n subKind: 'describe',\n id: '<anonymous>',\n title: '<anonymous>',\n location: { file: '', line: 0, column: 0 },\n duration: 0,\n parent: this.rootItem,\n children: [],\n status: 'none',\n hasLoadErrors: false,\n };\n this._addChild(this.rootItem, defaultDescribeItem);\n }\n return defaultDescribeItem;\n }\n\n sortAndPropagateStatus() {\n sortAndPropagateStatus(this.rootItem);\n }\n\n flattenForSingleProject() {\n const visit = (treeItem: TreeItem) => {\n if (treeItem.kind === 'case' && treeItem.children.length === 1) {\n treeItem.project = treeItem.children[0].project;\n treeItem.test = treeItem.children[0].test;\n treeItem.children = [];\n this._treeItemByTestId.set(treeItem.test.id, treeItem);\n } else {\n treeItem.children.forEach(visit);\n }\n };\n visit(this.rootItem);\n }\n\n shortenRoot() {\n let shortRoot = this.rootItem;\n while (shortRoot.children.length === 1 && shortRoot.children[0].kind === 'group' && shortRoot.children[0].subKind === 'folder')\n shortRoot = shortRoot.children[0];\n shortRoot.location = this.rootItem.location;\n this.rootItem = shortRoot;\n }\n\n testIds(): Set<string> {\n const result = new Set<string>();\n const visit = (treeItem: TreeItem) => {\n if (treeItem.kind === 'case')\n treeItem.tests.forEach(t => result.add(t.id));\n treeItem.children.forEach(visit);\n };\n visit(this.rootItem);\n return result;\n }\n\n fileNames(): string[] {\n const result = new Set<string>();\n const visit = (treeItem: TreeItem) => {\n if (treeItem.kind === 'group' && treeItem.subKind === 'file')\n result.add(treeItem.id);\n else\n treeItem.children.forEach(visit);\n };\n visit(this.rootItem);\n return [...result];\n }\n\n flatTreeItems(): TreeItem[] {\n const result: TreeItem[] = [];\n const visit = (treeItem: TreeItem) => {\n result.push(treeItem);\n treeItem.children.forEach(visit);\n };\n visit(this.rootItem);\n return result;\n }\n\n treeItemById(id: string): TreeItem | undefined {\n return this._treeItemById.get(id);\n }\n\n collectTestIds(treeItem?: TreeItem): Set<string> {\n return treeItem ? collectTestIds(treeItem) : new Set();\n }\n}\n\nexport function sortAndPropagateStatus(treeItem: TreeItem) {\n for (const child of treeItem.children)\n sortAndPropagateStatus(child);\n\n if (treeItem.kind === 'group') {\n treeItem.children.sort((a, b) => {\n const fc = a.location.file.localeCompare(b.location.file);\n return fc || a.location.line - b.location.line;\n });\n }\n\n let allPassed = treeItem.children.length > 0;\n let allSkipped = treeItem.children.length > 0;\n let hasFailed = false;\n let hasRunning = false;\n let hasScheduled = false;\n\n for (const child of treeItem.children) {\n allSkipped = allSkipped && child.status === 'skipped';\n allPassed = allPassed && (child.status === 'passed' || child.status === 'skipped');\n hasFailed = hasFailed || child.status === 'failed';\n hasRunning = hasRunning || child.status === 'running';\n hasScheduled = hasScheduled || child.status === 'scheduled';\n }\n\n if (hasRunning)\n treeItem.status = 'running';\n else if (hasScheduled)\n treeItem.status = 'scheduled';\n else if (hasFailed)\n treeItem.status = 'failed';\n else if (allSkipped)\n treeItem.status = 'skipped';\n else if (allPassed)\n treeItem.status = 'passed';\n}\n\nexport function collectTestIds(treeItem: TreeItem): Set<string> {\n const testIds = new Set<string>();\n const visit = (treeItem: TreeItem) => {\n if (treeItem.kind === 'case')\n treeItem.tests.map(t => t.id).forEach(id => testIds.add(id));\n else if (treeItem.kind === 'test')\n testIds.add(treeItem.id);\n else\n treeItem.children?.forEach(visit);\n };\n visit(treeItem);\n return testIds;\n}\n\nexport const statusEx = Symbol('statusEx');\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwDO,MAAM,SAAS;AAAA,EAMpB,YAAY,YAAoB,WAA4C,YAAuC,gBAAkD,eAAuB,WAAoB;AAJhN,SAAQ,gBAAgB,oBAAI,IAAsB;AAClD,SAAQ,oBAAoB,oBAAI,IAAqC;AAInE,UAAM,iBAAiB,kBAAkB,CAAC,GAAG,eAAe,OAAO,CAAC,EAAE,KAAK,OAAO;AAClF,SAAK,gBAAgB;AACrB,SAAK,WAAW;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,UAAU,EAAE,MAAM,IAAI,MAAM,GAAG,QAAQ,EAAE;AAAA,MACzC,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU,CAAC;AAAA,MACX,QAAQ;AAAA,MACR,eAAe;AAAA,IACjB;AACA,SAAK,cAAc,IAAI,YAAY,KAAK,QAAQ;AAEhD,UAAM,aAAa,CAAC,SAAoC,aAAkC,aAAwB,SAAqC;AACrJ,iBAAW,SAAS,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AAM,IAAI,OAAK,EAAE,EAAE,EAAE,QAAQ,QAAM,QAAQ,IAAI,EAAE,CAAC;AAAA,aACpDA,UAAS,SAAS;AACzB,cAAQ,IAAIA,UAAS,EAAE;AAAA;AAEvB,MAAAA,UAAS,UAAU,QAAQ,KAAK;AAAA,EACpC;AACA,QAAM,QAAQ;AACd,SAAO;AACT;AAEO,MAAM,WAAW,OAAO,UAAU;",
|
|
6
|
-
"names": ["treeItem"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/isomorphic/types.d.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\nexport type GitCommitInfo = {\n shortHash: string;\n hash: string;\n subject: string;\n body: string;\n author: {\n name: string;\n email: string;\n time: number;\n };\n committer: {\n name: string;\n email: string\n time: number;\n };\n branch: string;\n};\n\nexport type CIInfo = {\n commitHref: string;\n prHref?: string;\n prTitle?: string;\n prBaseHash?: string;\n buildHref?: string;\n commitHash?: string;\n branch?: string;\n};\n\nexport type MetadataWithCommitInfo = {\n ci?: CIInfo;\n gitCommit?: GitCommitInfo;\n gitDiff?: string;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/loader/loaderMain.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { deserializeConfig } from '../common/configLoader';\nimport { incorporateCompilationCache } from '../common/esmLoaderHost';\nimport { PoolBuilder } from '../common/poolBuilder';\nimport { ProcessRunner } from '../common/process';\nimport { loadTestFile } from '../common/testLoader';\nimport { serializeCompilationCache } from '../transform/compilationCache';\n\nimport type { TestError } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { SerializedConfig } from '../common/ipc';\n\nexport class LoaderMain extends ProcessRunner {\n private _serializedConfig: SerializedConfig;\n private _configPromise: Promise<FullConfigInternal> | undefined;\n private _poolBuilder = PoolBuilder.createForLoader();\n\n constructor(serializedConfig: SerializedConfig) {\n super();\n this._serializedConfig = serializedConfig;\n }\n\n private _config(): Promise<FullConfigInternal> {\n if (!this._configPromise)\n this._configPromise = deserializeConfig(this._serializedConfig);\n return this._configPromise;\n }\n\n async loadTestFile(params: { file: string }) {\n const testErrors: TestError[] = [];\n const config = await this._config();\n const fileSuite = await loadTestFile(params.file, config, testErrors);\n this._poolBuilder.buildPools(fileSuite);\n return { fileSuite: fileSuite._deepSerialize(), testErrors };\n }\n\n async getCompilationCacheFromLoader() {\n await incorporateCompilationCache();\n return serializeCompilationCache();\n }\n}\n\nexport const create = (config: SerializedConfig) => new LoaderMain(config);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,0BAAkC;AAClC,2BAA4C;AAC5C,yBAA4B;AAC5B,qBAA8B;AAC9B,wBAA6B;AAC7B,8BAA0C;AAMnC,MAAM,mBAAmB,6BAAc;AAAA,EAK5C,YAAY,kBAAoC;AAC9C,UAAM;AAHR,SAAQ,eAAe,+BAAY,gBAAgB;AAIjD,SAAK,oBAAoB;AAAA,EAC3B;AAAA,EAEQ,UAAuC;AAC7C,QAAI,CAAC,KAAK;AACR,WAAK,qBAAiB,uCAAkB,KAAK,iBAAiB;AAChE,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,aAAa,QAA0B;AAC3C,UAAM,aAA0B,CAAC;AACjC,UAAM,SAAS,MAAM,KAAK,QAAQ;AAClC,UAAM,YAAY,UAAM,gCAAa,OAAO,MAAM,QAAQ,UAAU;AACpE,SAAK,aAAa,WAAW,SAAS;AACtC,WAAO,EAAE,WAAW,UAAU,eAAe,GAAG,WAAW;AAAA,EAC7D;AAAA,EAEA,MAAM,gCAAgC;AACpC,cAAM,kDAA4B;AAClC,eAAO,mDAA0B;AAAA,EACnC;AACF;AAEO,MAAM,SAAS,CAAC,WAA6B,IAAI,WAAW,MAAM;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/matchers/expect.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 {\n captureRawStack,\n createGuid,\n currentZone,\n escapeWithQuotes,\n isString,\n pollAgainstDeadline } from 'playwright-core/lib/utils';\n\nimport { ExpectError, isJestError } from './matcherHint';\nimport {\n toBeAttached,\n toBeChecked,\n toBeDisabled,\n toBeEditable,\n toBeEmpty,\n toBeEnabled,\n toBeFocused,\n toBeHidden,\n toBeInViewport,\n toBeOK,\n toBeVisible,\n toContainClass,\n toContainText,\n toHaveAccessibleDescription,\n toHaveAccessibleErrorMessage,\n toHaveAccessibleName,\n toHaveAttribute,\n toHaveCSS,\n toHaveClass,\n toHaveCount,\n toHaveId,\n toHaveJSProperty,\n toHaveRole,\n toHaveText,\n toHaveTitle,\n toHaveURL,\n toHaveValue,\n toHaveValues,\n toPass\n} from './matchers';\nimport { toMatchAriaSnapshot } from './toMatchAriaSnapshot';\nimport { toHaveScreenshot, toHaveScreenshotStepTitle, toMatchSnapshot } from './toMatchSnapshot';\nimport {\n INVERTED_COLOR,\n RECEIVED_COLOR,\n expect as expectLibrary,\n printReceived,\n} from '../common/expectBundle';\nimport { currentTestInfo } from '../common/globals';\nimport { filteredStackTrace } from '../util';\nimport { TestInfoImpl } from '../worker/testInfo';\n\nimport type { ExpectMatcherStateInternal } from './matchers';\nimport type { Expect } from '../../types/test';\nimport type { TestStepInfoImpl } from '../worker/testInfo';\n\n\n// #region\n// Mirrored from https://github.com/facebook/jest/blob/f13abff8df9a0e1148baf3584bcde6d1b479edc7/packages/expect/src/print.ts\n/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found here\n * https://github.com/facebook/jest/blob/1547740bbc26400d69f4576bf35645163e942829/LICENSE\n */\n\n// Format substring but do not enclose in double quote marks.\n// The replacement is compatible with pretty-format package.\nconst printSubstring = (val: string): string => val.replace(/\"|\\\\/g, '\\\\$&');\n\nexport const printReceivedStringContainExpectedSubstring = (\n received: string,\n start: number,\n length: number, // not end\n): string =>\n RECEIVED_COLOR(\n '\"' +\n printSubstring(received.slice(0, start)) +\n INVERTED_COLOR(printSubstring(received.slice(start, start + length))) +\n printSubstring(received.slice(start + length)) +\n '\"',\n );\n\nexport const printReceivedStringContainExpectedResult = (\n received: string,\n result: RegExpExecArray | null,\n): string =>\n result === null\n ? printReceived(received)\n : printReceivedStringContainExpectedSubstring(\n received,\n result.index,\n result[0].length,\n );\n\n// #endregion\n\ntype ExpectMessage = string | { message?: string };\n\nfunction createMatchers(actual: unknown, info: ExpectMetaInfo, prefix: string[]): any {\n return new Proxy(expectLibrary(actual), new ExpectMetaInfoProxyHandler(info, prefix));\n}\n\nconst userMatchersSymbol = Symbol('userMatchers');\n\nfunction qualifiedMatcherName(qualifier: string[], matcherName: string) {\n return qualifier.join(':') + '$' + matcherName;\n}\n\nfunction createExpect(info: ExpectMetaInfo, prefix: string[], userMatchers: Record<string, Function>) {\n const expectInstance: Expect<{}> = new Proxy(expectLibrary, {\n apply: function(target: any, thisArg: any, argumentsList: [unknown, ExpectMessage?]) {\n const [actual, messageOrOptions] = argumentsList;\n const message = isString(messageOrOptions) ? messageOrOptions : messageOrOptions?.message || info.message;\n const newInfo = { ...info, message };\n if (newInfo.poll) {\n if (typeof actual !== 'function')\n throw new Error('`expect.poll()` accepts only function as a first argument');\n newInfo.poll.generator = actual as any;\n }\n return createMatchers(actual, newInfo, prefix);\n },\n\n get: function(target: any, property: string | typeof userMatchersSymbol) {\n if (property === 'configure')\n return configure;\n\n if (property === 'extend') {\n return (matchers: any) => {\n const qualifier = [...prefix, createGuid()];\n\n const wrappedMatchers: any = {};\n for (const [name, matcher] of Object.entries(matchers)) {\n wrappedMatchers[name] = wrapPlaywrightMatcherToPassNiceThis(matcher);\n const key = qualifiedMatcherName(qualifier, name);\n wrappedMatchers[key] = wrappedMatchers[name];\n Object.defineProperty(wrappedMatchers[key], 'name', { value: name });\n }\n expectLibrary.extend(wrappedMatchers);\n return createExpect(info, qualifier, { ...userMatchers, ...matchers });\n };\n }\n\n if (property === 'soft') {\n return (actual: unknown, messageOrOptions?: ExpectMessage) => {\n return configure({ soft: true })(actual, messageOrOptions) as any;\n };\n }\n\n if (property === userMatchersSymbol)\n return userMatchers;\n\n if (property === 'poll') {\n return (actual: unknown, messageOrOptions?: ExpectMessage & { timeout?: number, intervals?: number[] }) => {\n const poll = isString(messageOrOptions) ? {} : messageOrOptions || {};\n return configure({ _poll: poll })(actual, messageOrOptions) as any;\n };\n }\n return (expectLibrary as any)[property];\n },\n });\n\n const configure = (configuration: { message?: string, timeout?: number, soft?: boolean, _poll?: boolean | { timeout?: number, intervals?: number[] } }) => {\n const newInfo = { ...info };\n if ('message' in configuration)\n newInfo.message = configuration.message;\n if ('timeout' in configuration)\n newInfo.timeout = configuration.timeout;\n if ('soft' in configuration)\n newInfo.isSoft = configuration.soft;\n if ('_poll' in configuration) {\n newInfo.poll = configuration._poll ? { ...info.poll, generator: () => {} } : undefined;\n if (typeof configuration._poll === 'object') {\n newInfo.poll!.timeout = configuration._poll.timeout ?? newInfo.poll!.timeout;\n newInfo.poll!.intervals = configuration._poll.intervals ?? newInfo.poll!.intervals;\n }\n }\n return createExpect(newInfo, prefix, userMatchers);\n };\n\n return expectInstance;\n}\n\n// Expect wraps matchers, so there is no way to pass this information to the raw Playwright matcher.\n// Rely on sync call sequence to seed each matcher call with the context.\ntype MatcherCallContext = {\n expectInfo: ExpectMetaInfo;\n testInfo: TestInfoImpl | null;\n step?: TestStepInfoImpl;\n};\n\nlet matcherCallContext: MatcherCallContext | undefined;\n\nfunction setMatcherCallContext(context: MatcherCallContext) {\n matcherCallContext = context;\n}\n\nfunction takeMatcherCallContext(): MatcherCallContext | undefined {\n try {\n return matcherCallContext;\n } finally {\n // Any subsequent matcher following the first is assumed to be an unsupported legacy asymmetric matcher.\n // Lacking call context in these scenarios is not particularly important.\n matcherCallContext = undefined;\n }\n}\n\nconst defaultExpectTimeout = 5000;\n\nfunction wrapPlaywrightMatcherToPassNiceThis(matcher: any) {\n return function(this: any, ...args: any[]) {\n const { isNot, promise, utils } = this;\n const context = takeMatcherCallContext();\n const timeout = context?.expectInfo.timeout ?? context?.testInfo?._projectInternal?.expect?.timeout ?? defaultExpectTimeout;\n const newThis: ExpectMatcherStateInternal = {\n isNot,\n promise,\n utils,\n timeout,\n _stepInfo: context?.step,\n };\n (newThis as any).equals = throwUnsupportedExpectMatcherError;\n return matcher.call(newThis, ...args);\n };\n}\n\nfunction throwUnsupportedExpectMatcherError() {\n throw new Error('It looks like you are using custom expect matchers that are not compatible with Playwright. See https://aka.ms/playwright/expect-compatibility');\n}\n\nexpectLibrary.setState({ expand: false });\n\nconst customAsyncMatchers = {\n toBeAttached,\n toBeChecked,\n toBeDisabled,\n toBeEditable,\n toBeEmpty,\n toBeEnabled,\n toBeFocused,\n toBeHidden,\n toBeInViewport,\n toBeOK,\n toBeVisible,\n toContainText,\n toContainClass,\n toHaveAccessibleDescription,\n toHaveAccessibleName,\n toHaveAccessibleErrorMessage,\n toHaveAttribute,\n toHaveClass,\n toHaveCount,\n toHaveCSS,\n toHaveId,\n toHaveJSProperty,\n toHaveRole,\n toHaveText,\n toHaveTitle,\n toHaveURL,\n toHaveValue,\n toHaveValues,\n toHaveScreenshot,\n toMatchAriaSnapshot,\n toPass,\n};\n\nconst customMatchers = {\n ...customAsyncMatchers,\n toMatchSnapshot,\n};\n\ntype Generator = () => any;\n\ntype ExpectMetaInfo = {\n message?: string;\n isNot?: boolean;\n isSoft?: boolean;\n poll?: {\n timeout?: number;\n intervals?: number[];\n generator: Generator;\n };\n timeout?: number;\n};\n\nclass ExpectMetaInfoProxyHandler implements ProxyHandler<any> {\n private _info: ExpectMetaInfo;\n private _prefix: string[];\n\n constructor(info: ExpectMetaInfo, prefix: string[]) {\n this._info = { ...info };\n this._prefix = prefix;\n }\n\n get(target: Object, matcherName: string | symbol, receiver: any): any {\n let matcher = Reflect.get(target, matcherName, receiver);\n if (typeof matcherName !== 'string')\n return matcher;\n\n let resolvedMatcherName = matcherName;\n for (let i = this._prefix.length; i > 0; i--) {\n const qualifiedName = qualifiedMatcherName(this._prefix.slice(0, i), matcherName);\n if (Reflect.has(target, qualifiedName)) {\n matcher = Reflect.get(target, qualifiedName, receiver);\n resolvedMatcherName = qualifiedName;\n break;\n }\n }\n\n if (matcher === undefined)\n throw new Error(`expect: Property '${matcherName}' not found.`);\n if (typeof matcher !== 'function') {\n if (matcherName === 'not')\n this._info.isNot = !this._info.isNot;\n return new Proxy(matcher, this);\n }\n if (this._info.poll) {\n if ((customAsyncMatchers as any)[matcherName] || matcherName === 'resolves' || matcherName === 'rejects')\n throw new Error(`\\`expect.poll()\\` does not support \"${matcherName}\" matcher.`);\n matcher = (...args: any[]) => pollMatcher(resolvedMatcherName, this._info, this._prefix, ...args);\n }\n return (...args: any[]) => {\n const testInfo = currentTestInfo();\n setMatcherCallContext({ expectInfo: this._info, testInfo });\n if (!testInfo)\n return matcher.call(target, ...args);\n\n const customMessage = this._info.message || '';\n const argsSuffix = computeArgsSuffix(matcherName, args);\n\n const defaultTitle = `${this._info.poll ? 'poll ' : ''}${this._info.isSoft ? 'soft ' : ''}${this._info.isNot ? 'not ' : ''}${matcherName}${argsSuffix}`;\n const title = customMessage || `Expect ${escapeWithQuotes(defaultTitle, '\"')}`;\n const apiName = `expect${this._info.poll ? '.poll ' : ''}${this._info.isSoft ? '.soft ' : ''}${this._info.isNot ? '.not' : ''}.${matcherName}${argsSuffix}`;\n\n // This looks like it is unnecessary, but it isn't - we need to filter\n // out all the frames that belong to the test runner from caught runtime errors.\n const stackFrames = filteredStackTrace(captureRawStack());\n\n // toPass and poll matchers can contain other steps, expects and API calls,\n // so they behave like a retriable step.\n const stepInfo = {\n category: 'expect' as const,\n apiName,\n title,\n params: args[0] ? { expected: args[0] } : undefined,\n infectParentStepsWithError: this._info.isSoft,\n };\n\n const step = testInfo._addStep(stepInfo);\n\n const reportStepError = (e: Error | unknown) => {\n const jestError = isJestError(e) ? e : null;\n const expectError = jestError ? new ExpectError(jestError, customMessage, stackFrames) : undefined;\n if (jestError?.matcherResult.suggestedRebaseline) {\n // NOTE: this is a workaround for the fact that we can't pass the suggested rebaseline\n // for passing matchers. See toMatchAriaSnapshot for a counterpart.\n step.complete({ suggestedRebaseline: jestError?.matcherResult.suggestedRebaseline });\n return;\n }\n\n const error = expectError ?? e;\n step.complete({ error });\n\n if (this._info.isSoft)\n testInfo._failWithError(error);\n else\n throw error;\n };\n\n const finalizer = () => {\n step.complete({});\n };\n\n try {\n setMatcherCallContext({ expectInfo: this._info, testInfo, step: step.info });\n const callback = () => matcher.call(target, ...args);\n const result = currentZone().with('stepZone', step).run(callback);\n if (result instanceof Promise)\n return result.then(finalizer).catch(reportStepError);\n finalizer();\n return result;\n } catch (e) {\n void reportStepError(e);\n }\n };\n }\n}\n\nasync function pollMatcher(qualifiedMatcherName: string, info: ExpectMetaInfo, prefix: string[], ...args: any[]) {\n const testInfo = currentTestInfo();\n const poll = info.poll!;\n const timeout = poll.timeout ?? info.timeout ?? testInfo?._projectInternal?.expect?.timeout ?? defaultExpectTimeout;\n const { deadline, timeoutMessage } = testInfo ? testInfo._deadlineForMatcher(timeout) : TestInfoImpl._defaultDeadlineForMatcher(timeout);\n\n const result = await pollAgainstDeadline<Error|undefined>(async () => {\n if (testInfo && currentTestInfo() !== testInfo)\n return { continuePolling: false, result: undefined };\n\n const innerInfo: ExpectMetaInfo = {\n ...info,\n isSoft: false, // soft is outside of poll, not inside\n poll: undefined,\n };\n const value = await poll.generator();\n try {\n let matchers = createMatchers(value, innerInfo, prefix);\n if (info.isNot)\n matchers = matchers.not;\n matchers[qualifiedMatcherName](...args);\n return { continuePolling: false, result: undefined };\n } catch (error) {\n return { continuePolling: true, result: error };\n }\n }, deadline, poll.intervals ?? [100, 250, 500, 1000]);\n\n if (result.timedOut) {\n const message = result.result ? [\n result.result.message,\n '',\n `Call Log:`,\n `- ${timeoutMessage}`,\n ].join('\\n') : timeoutMessage;\n\n throw new Error(message);\n }\n}\n\nfunction computeArgsSuffix(matcherName: string, args: any[]) {\n let value = '';\n if (matcherName === 'toHaveScreenshot')\n value = toHaveScreenshotStepTitle(...args);\n return value ? `(${value})` : '';\n}\n\nexport const expect: Expect<{}> = createExpect({}, [], {}).extend(customMatchers);\n\nexport function mergeExpects(...expects: any[]) {\n let merged = expect;\n for (const e of expects) {\n const internals = e[userMatchersSymbol];\n if (!internals) // non-playwright expects mutate the global expect, so we don't need to do anything special\n continue;\n merged = merged.extend(internals);\n }\n return merged;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAM6B;AAE7B,yBAAyC;AACzC,sBA8BO;AACP,iCAAoC;AACpC,6BAA6E;AAC7E,0BAKO;AACP,qBAAgC;AAChC,kBAAmC;AACnC,sBAA6B;AAkB7B,MAAM,iBAAiB,CAAC,QAAwB,IAAI,QAAQ,SAAS,MAAM;AAEpE,MAAM,8CAA8C,CACzD,UACA,OACA,eAEA;AAAA,EACI,MACA,eAAe,SAAS,MAAM,GAAG,KAAK,CAAC,QACvC,oCAAe,eAAe,SAAS,MAAM,OAAO,QAAQ,MAAM,CAAC,CAAC,IACpE,eAAe,SAAS,MAAM,QAAQ,MAAM,CAAC,IAC7C;AACJ;AAEK,MAAM,2CAA2C,CACtD,UACA,WAEA,WAAW,WACP,mCAAc,QAAQ,IACtB;AAAA,EACE;AAAA,EACA,OAAO;AAAA,EACP,OAAO,CAAC,EAAE;AACd;AAMJ,SAAS,eAAe,QAAiB,MAAsB,QAAuB;AACpF,SAAO,IAAI,UAAM,oBAAAA,QAAc,MAAM,GAAG,IAAI,2BAA2B,MAAM,MAAM,CAAC;AACtF;AAEA,MAAM,qBAAqB,OAAO,cAAc;AAEhD,SAAS,qBAAqB,WAAqB,aAAqB;AACtE,SAAO,UAAU,KAAK,GAAG,IAAI,MAAM;AACrC;AAEA,SAAS,aAAa,MAAsB,QAAkB,cAAwC;AACpG,QAAM,iBAA6B,IAAI,MAAM,oBAAAA,QAAe;AAAA,IAC1D,OAAO,SAAS,QAAa,SAAc,eAA0C;AACnF,YAAM,CAAC,QAAQ,gBAAgB,IAAI;AACnC,YAAM,cAAU,uBAAS,gBAAgB,IAAI,m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tD,UAAI,KAAK;AACP,mBAAW,SAAS;AACtB,eAASA,qBAAoB,EAAE,GAAG,IAAI;AACtC,aAAO,EAAE,iBAAiB,OAAO,QAAQ,OAAU;AAAA,IACrD,SAAS,OAAO;AACd,aAAO,EAAE,iBAAiB,MAAM,QAAQ,MAAM;AAAA,IAChD;AAAA,EACF,GAAG,UAAU,KAAK,aAAa,CAAC,KAAK,KAAK,KAAK,GAAI,CAAC;AAEpD,MAAI,OAAO,UAAU;AACnB,UAAM,UAAU,OAAO,SAAS;AAAA,MAC9B,OAAO,OAAO;AAAA,MACd;AAAA,MACA;AAAA,MACA,KAAK,cAAc;AAAA,IACrB,EAAE,KAAK,IAAI,IAAI;AAEf,UAAM,IAAI,MAAM,OAAO;AAAA,EACzB;AACF;AAEA,SAAS,kBAAkB,aAAqB,MAAa;AAC3D,MAAI,QAAQ;AACZ,MAAI,gBAAgB;AAClB,gBAAQ,kDAA0B,GAAG,IAAI;AAC3C,SAAO,QAAQ,IAAI,KAAK,MAAM;AAChC;AAEO,MAAM,SAAqB,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,cAAc;AAEzE,SAAS,gBAAgB,SAAgB;AAC9C,MAAI,SAAS;AACb,aAAW,KAAK,SAAS;AACvB,UAAM,YAAY,EAAE,kBAAkB;AACtC,QAAI,CAAC;AACH;AACF,aAAS,OAAO,OAAO,SAAS;AAAA,EAClC;AACA,SAAO;AACT;",
|
|
6
|
-
"names": ["expectLibrary", "qualifiedMatcherName"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/matchers/matcherHint.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { stringifyStackFrames } from 'playwright-core/lib/utils';\nimport { DIM_COLOR, RECEIVED_COLOR, EXPECTED_COLOR } from '../common/expectBundle';\n\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { StackFrame } from '@protocol/channels';\nimport type { Locator } from 'playwright-core';\n\ntype MatcherMessageDetails = {\n receiver?: string; // Assuming 'locator' when locator is provided, 'page' otherwise.\n matcherName: string;\n expectation: string;\n locator?: Locator;\n printedExpected?: string;\n printedReceived?: string;\n printedDiff?: string;\n timedOut?: boolean;\n timeout?: number;\n errorMessage?: string;\n log?: string[];\n};\n\nexport function formatMatcherMessage(state: ExpectMatcherState, details: MatcherMessageDetails) {\n const receiver = details.receiver ?? (details.locator ? 'locator' : 'page');\n let message = DIM_COLOR('expect(') + RECEIVED_COLOR(receiver)\n + DIM_COLOR(')' + (state.promise ? '.' + state.promise : '') + (state.isNot ? '.not' : '') + '.')\n + details.matcherName\n + DIM_COLOR('(') + EXPECTED_COLOR(details.expectation) + DIM_COLOR(')')\n + ' failed\\n\\n';\n\n // Sometimes diff is actually expected + received. Turn it into two lines to\n // simplify alignment logic.\n const diffLines = details.printedDiff?.split('\\n');\n if (diffLines?.length === 2) {\n details.printedExpected = diffLines[0];\n details.printedReceived = diffLines[1];\n details.printedDiff = undefined;\n }\n\n const align = !details.errorMessage && details.printedExpected?.startsWith('Expected:')\n && (!details.printedReceived || details.printedReceived.startsWith('Received:'));\n if (details.locator)\n message += `Locator: ${align ? ' ' : ''}${String(details.locator)}\\n`;\n if (details.printedExpected)\n message += details.printedExpected + '\\n';\n if (details.printedReceived)\n message += details.printedReceived + '\\n';\n if (details.timedOut && details.timeout)\n message += `Timeout: ${align ? ' ' : ''}${details.timeout}ms\\n`;\n if (details.printedDiff)\n message += details.printedDiff + '\\n';\n if (details.errorMessage) {\n message += details.errorMessage;\n if (!details.errorMessage.endsWith('\\n'))\n message += '\\n';\n }\n message += callLogText(details.log);\n return message;\n}\n\nexport type MatcherResult<E, A> = {\n name: string;\n expected?: E;\n message: () => string;\n pass: boolean;\n actual?: A;\n log?: string[];\n timeout?: number;\n suggestedRebaseline?: string;\n};\n\nexport type MatcherResultProperty = Omit<MatcherResult<unknown, unknown>, 'message'> & {\n message: string;\n};\n\ntype JestError = Error & {\n matcherResult: MatcherResultProperty;\n};\n\nexport class ExpectError extends Error {\n matcherResult: MatcherResultProperty;\n\n constructor(jestError: JestError, customMessage: string, stackFrames: StackFrame[]) {\n super('');\n // Copy to erase the JestMatcherError constructor name from the console.log(error).\n this.name = jestError.name;\n this.message = jestError.message;\n this.matcherResult = jestError.matcherResult;\n\n if (customMessage)\n this.message = customMessage + '\\n\\n' + this.message;\n this.stack = this.name + ': ' + this.message + '\\n' + stringifyStackFrames(stackFrames).join('\\n');\n }\n}\n\nexport function isJestError(e: unknown): e is JestError {\n return e instanceof Error && 'matcherResult' in e;\n}\n\nexport const callLogText = (log: string[] | undefined) => {\n if (!log || !log.some(l => !!l))\n return '';\n return `\nCall log:\n${DIM_COLOR(log.join('\\n'))}\n`;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAAqC;AACrC,0BAA0D;AAoBnD,SAAS,qBAAqB,OAA2B,SAAgC;AAC9F,QAAM,WAAW,QAAQ,aAAa,QAAQ,UAAU,YAAY;AACpE,MAAI,cAAU,+BAAU,SAAS,QAAI,oCAAe,QAAQ,QACtD,+BAAU,OAAO,MAAM,UAAU,MAAM,MAAM,UAAU,OAAO,MAAM,QAAQ,SAAS,MAAM,GAAG,IAC9F,QAAQ,kBACR,+BAAU,GAAG,QAAI,oCAAe,QAAQ,WAAW,QAAI,+BAAU,GAAG,IACpE;AAIN,QAAM,Y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C,CAAC,CAAC;AAC5B,WAAO;AACT,SAAO;AAAA;AAAA,MAEP,+BAAU,IAAI,KAAK,IAAI,CAAC,CAAC;AAAA;AAE3B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/matchers/matchers.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { constructURLBasedOnBaseURL, isRegExp, isString, isTextualMimeType, pollAgainstDeadline, serializeExpectedTextValues } from 'playwright-core/lib/utils';\nimport { colors } from 'playwright-core/lib/utils';\n\nimport { expectTypes } from '../util';\nimport { toBeTruthy } from './toBeTruthy';\nimport { toEqual } from './toEqual';\nimport { toHaveURLWithPredicate } from './toHaveURL';\nimport { toMatchText } from './toMatchText';\nimport { takeFirst } from '../common/config';\nimport { currentTestInfo } from '../common/globals';\nimport { TestInfoImpl } from '../worker/testInfo';\nimport { formatMatcherMessage } from './matcherHint';\n\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { TestStepInfoImpl } from '../worker/testInfo';\nimport type { APIResponse, Locator, Frame, Page } from 'playwright-core';\nimport type { FrameExpectParams } from 'playwright-core/lib/client/types';\n\nexport type ExpectMatcherStateInternal = ExpectMatcherState & { _stepInfo?: TestStepInfoImpl };\n\nexport interface LocatorEx extends Locator {\n _expect(expression: string, options: FrameExpectParams): Promise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean, errorMessage?: string }>;\n}\n\nexport interface FrameEx extends Frame {\n _expect(expression: string, options: FrameExpectParams): Promise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean, errorMessage?: string }>;\n}\n\ninterface APIResponseEx extends APIResponse {\n _fetchLog(): Promise<string[]>;\n}\n\nexport function toBeAttached(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { attached?: boolean, timeout?: number },\n) {\n const attached = !options || options.attached === undefined || options.attached;\n const expected = attached ? 'attached' : 'detached';\n const arg = attached ? '' : '{ attached: false }';\n return toBeTruthy.call(this, 'toBeAttached', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(attached ? 'to.be.attached' : 'to.be.detached', { isNot, timeout });\n }, options);\n}\n\nexport function toBeChecked(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { checked?: boolean, indeterminate?: boolean, timeout?: number },\n) {\n const checked = options?.checked;\n const indeterminate = options?.indeterminate;\n const expectedValue = {\n checked,\n indeterminate,\n };\n let expected: string;\n let arg: string;\n if (options?.indeterminate) {\n expected = 'indeterminate';\n arg = `{ indeterminate: true }`;\n } else {\n expected = options?.checked === false ? 'unchecked' : 'checked';\n arg = options?.checked === false ? `{ checked: false }` : '';\n }\n return toBeTruthy.call(this, 'toBeChecked', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect('to.be.checked', { isNot, timeout, expectedValue });\n }, options);\n}\n\nexport function toBeDisabled(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeDisabled', locator, 'Locator', 'disabled', '', async (isNot, timeout) => {\n return await locator._expect('to.be.disabled', { isNot, timeout });\n }, options);\n}\n\nexport function toBeEditable(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { editable?: boolean, timeout?: number },\n) {\n const editable = !options || options.editable === undefined || options.editable;\n const expected = editable ? 'editable' : 'readOnly';\n const arg = editable ? '' : '{ editable: false }';\n return toBeTruthy.call(this, 'toBeEditable', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(editable ? 'to.be.editable' : 'to.be.readonly', { isNot, timeout });\n }, options);\n}\n\nexport function toBeEmpty(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeEmpty', locator, 'Locator', 'empty', '', async (isNot, timeout) => {\n return await locator._expect('to.be.empty', { isNot, timeout });\n }, options);\n}\n\nexport function toBeEnabled(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { enabled?: boolean, timeout?: number },\n) {\n const enabled = !options || options.enabled === undefined || options.enabled;\n const expected = enabled ? 'enabled' : 'disabled';\n const arg = enabled ? '' : '{ enabled: false }';\n return toBeTruthy.call(this, 'toBeEnabled', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(enabled ? 'to.be.enabled' : 'to.be.disabled', { isNot, timeout });\n }, options);\n}\n\nexport function toBeFocused(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeFocused', locator, 'Locator', 'focused', '', async (isNot, timeout) => {\n return await locator._expect('to.be.focused', { isNot, timeout });\n }, options);\n}\n\nexport function toBeHidden(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeHidden', locator, 'Locator', 'hidden', '', async (isNot, timeout) => {\n return await locator._expect('to.be.hidden', { isNot, timeout });\n }, options);\n}\n\nexport function toBeVisible(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { visible?: boolean, timeout?: number },\n) {\n const visible = !options || options.visible === undefined || options.visible;\n const expected = visible ? 'visible' : 'hidden';\n const arg = visible ? '' : '{ visible: false }';\n return toBeTruthy.call(this, 'toBeVisible', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(visible ? 'to.be.visible' : 'to.be.hidden', { isNot, timeout });\n }, options);\n}\n\nexport function toBeInViewport(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number, ratio?: number },\n) {\n return toBeTruthy.call(this, 'toBeInViewport', locator, 'Locator', 'in viewport', '', async (isNot, timeout) => {\n return await locator._expect('to.be.in.viewport', { isNot, expectedNumber: options?.ratio, timeout });\n }, options);\n}\n\nexport function toContainText(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp | (string | RegExp)[],\n options: { timeout?: number, useInnerText?: boolean, ignoreCase?: boolean } = {},\n) {\n if (Array.isArray(expected)) {\n return toEqual.call(this, 'toContainText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected, { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.contain.text.array', { expectedText, isNot, useInnerText: options.useInnerText, timeout });\n }, expected, { ...options, contains: true });\n } else {\n return toMatchText.call(this, 'toContainText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options.useInnerText, timeout });\n }, expected, { ...options, matchSubstring: true });\n }\n}\n\nexport function toHaveAccessibleDescription(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n return toMatchText.call(this, 'toHaveAccessibleDescription', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });\n return await locator._expect('to.have.accessible.description', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveAccessibleName(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n return toMatchText.call(this, 'toHaveAccessibleName', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });\n return await locator._expect('to.have.accessible.name', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveAccessibleErrorMessage(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number; ignoreCase?: boolean },\n) {\n return toMatchText.call(this, 'toHaveAccessibleErrorMessage', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });\n return await locator._expect('to.have.accessible.error.message', { expectedText: expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveAttribute(\n this: ExpectMatcherState,\n locator: LocatorEx,\n name: string,\n expected: string | RegExp | undefined | { timeout?: number },\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n if (!options) {\n // Update params for the case toHaveAttribute(name, options);\n if (typeof expected === 'object' && !isRegExp(expected)) {\n options = expected;\n expected = undefined;\n }\n }\n if (expected === undefined) {\n return toBeTruthy.call(this, 'toHaveAttribute', locator, 'Locator', 'have attribute', '', async (isNot, timeout) => {\n return await locator._expect('to.have.attribute', { expressionArg: name, isNot, timeout });\n }, options);\n }\n return toMatchText.call(this, 'toHaveAttribute', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected as (string | RegExp)], { ignoreCase: options?.ignoreCase });\n return await locator._expect('to.have.attribute.value', { expressionArg: name, expectedText, isNot, timeout });\n }, expected as (string | RegExp), options);\n}\n\nexport function toHaveClass(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp | (string | RegExp)[],\n options?: { timeout?: number },\n) {\n if (Array.isArray(expected)) {\n return toEqual.call(this, 'toHaveClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected);\n return await locator._expect('to.have.class.array', { expectedText, isNot, timeout });\n }, expected, options);\n } else {\n return toMatchText.call(this, 'toHaveClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.class', { expectedText, isNot, timeout });\n }, expected, options);\n }\n}\n\nexport function toContainClass(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | string[],\n options?: { timeout?: number },\n) {\n if (Array.isArray(expected)) {\n if (expected.some(e => isRegExp(e)))\n throw new Error(`\"expected\" argument in toContainClass cannot contain RegExp values`);\n return toEqual.call(this, 'toContainClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected);\n return await locator._expect('to.contain.class.array', { expectedText, isNot, timeout });\n }, expected, options);\n } else {\n if (isRegExp(expected))\n throw new Error(`\"expected\" argument in toContainClass cannot be a RegExp value`);\n return toMatchText.call(this, 'toContainClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.contain.class', { expectedText, isNot, timeout });\n }, expected, options);\n }\n}\n\nexport function toHaveCount(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: number,\n options?: { timeout?: number },\n) {\n return toEqual.call(this, 'toHaveCount', locator, 'Locator', async (isNot, timeout) => {\n return await locator._expect('to.have.count', { expectedNumber: expected, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveCSS(\n this: ExpectMatcherState,\n locator: LocatorEx,\n name: string,\n expected: string | RegExp,\n options?: { timeout?: number },\n) {\n return toMatchText.call(this, 'toHaveCSS', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.css', { expressionArg: name, expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveId(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number },\n) {\n return toMatchText.call(this, 'toHaveId', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.id', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveJSProperty(\n this: ExpectMatcherState,\n locator: LocatorEx,\n name: string,\n expected: any,\n options?: { timeout?: number },\n) {\n return toEqual.call(this, 'toHaveJSProperty', locator, 'Locator', async (isNot, timeout) => {\n return await locator._expect('to.have.property', { expressionArg: name, expectedValue: expected, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveRole(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string,\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n if (!isString(expected))\n throw new Error(`\"role\" argument in toHaveRole must be a string`);\n return toMatchText.call(this, 'toHaveRole', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.role', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveText(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp | (string | RegExp)[],\n options: { timeout?: number, useInnerText?: boolean, ignoreCase?: boolean } = {},\n) {\n if (Array.isArray(expected)) {\n return toEqual.call(this, 'toHaveText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected, { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.have.text.array', { expectedText, isNot, useInnerText: options?.useInnerText, timeout });\n }, expected, options);\n } else {\n return toMatchText.call(this, 'toHaveText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options?.useInnerText, timeout });\n }, expected, options);\n }\n}\n\nexport function toHaveValue(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number },\n) {\n return toMatchText.call(this, 'toHaveValue', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.value', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveValues(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: (string | RegExp)[],\n options?: { timeout?: number },\n) {\n return toEqual.call(this, 'toHaveValues', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected);\n return await locator._expect('to.have.values', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveTitle(\n this: ExpectMatcherState,\n page: Page,\n expected: string | RegExp,\n options: { timeout?: number } = {},\n) {\n return toMatchText.call(this, 'toHaveTitle', page, 'Page', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true });\n return await (page.mainFrame() as FrameEx)._expect('to.have.title', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveURL(\n this: ExpectMatcherState,\n page: Page,\n expected: string | RegExp | ((url: URL) => boolean),\n options?: { ignoreCase?: boolean; timeout?: number },\n) {\n // Ports don't support predicates. Keep separate server and client codepaths\n if (typeof expected === 'function')\n return toHaveURLWithPredicate.call(this, page, expected, options);\n\n const baseURL = (page.context() as any)._options.baseURL;\n expected = typeof expected === 'string' ? constructURLBasedOnBaseURL(baseURL, expected) : expected;\n return toMatchText.call(this, 'toHaveURL', page, 'Page', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase });\n return await (page.mainFrame() as FrameEx)._expect('to.have.url', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport async function toBeOK(\n this: ExpectMatcherState,\n response: APIResponseEx\n) {\n const matcherName = 'toBeOK';\n expectTypes(response, ['APIResponse'], matcherName);\n\n const contentType = response.headers()['content-type'];\n const isTextEncoding = contentType && isTextualMimeType(contentType);\n const [log, text] = (this.isNot === response.ok()) ? await Promise.all([\n response._fetchLog(),\n isTextEncoding ? response.text() : null\n ]) : [];\n\n const message = () => formatMatcherMessage(this, {\n matcherName,\n receiver: 'response',\n expectation: '',\n log,\n }) + (text === null ? '' : `\\nResponse text:\\n${colors.dim(text?.substring(0, 1000) || '')}`);\n\n const pass = response.ok();\n return { message, pass };\n}\n\nexport async function toPass(\n this: ExpectMatcherState,\n callback: () => any,\n options: {\n intervals?: number[];\n timeout?: number,\n } = {},\n) {\n const testInfo = currentTestInfo();\n const timeout = takeFirst(options.timeout, testInfo?._projectInternal.expect?.toPass?.timeout, 0);\n const intervals = takeFirst(options.intervals, testInfo?._projectInternal.expect?.toPass?.intervals, [100, 250, 500, 1000]);\n\n const { deadline, timeoutMessage } = testInfo ? testInfo._deadlineForMatcher(timeout) : TestInfoImpl._defaultDeadlineForMatcher(timeout);\n const result = await pollAgainstDeadline<Error|undefined>(async () => {\n if (testInfo && currentTestInfo() !== testInfo)\n return { continuePolling: false, result: undefined };\n try {\n await callback();\n return { continuePolling: !!this.isNot, result: undefined };\n } catch (e) {\n return { continuePolling: !this.isNot, result: e };\n }\n }, deadline, intervals);\n\n if (result.timedOut) {\n const message = result.result ? [\n result.result.message,\n '',\n `Call Log:`,\n `- ${timeoutMessage}`,\n ].join('\\n') : timeoutMessage;\n return { message: () => message, pass: !!this.isNot };\n }\n return { pass: !this.isNot, message: () => '' };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAAoI;AACpI,IAAAA,gBAAuB;AAEvB,kBAA4B;AAC5B,wBAA2B;AAC3B,qBAAwB;AACxB,uBAAuC;AACvC,yBAA4B;AAC5B,oBAA0B;AAC1B,qBAAgC;AAChC,sBAA6B;AAC7B,yBAAqC;AAqB9B,SAAS,aAEd,SACA,SACA;AACA,QAAM,WAAW,CAAC,WAAW,QAAQ,aAAa,UAAa,QAAQ;AACvE,QAAM,WAAW,WAAW,aAAa;AACzC,QAAM,MAAM,WAAW,KAAK;AAC5B,SAAO,6BAAW,KAAK,MAAM,gBAAgB,SAAS,WAAW,UAA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6
|
-
"names": ["import_utils"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/matchers/toBeTruthy.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { expectTypes } from '../util';\nimport { formatMatcherMessage } from './matcherHint';\n\nimport type { MatcherResult } from './matcherHint';\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { Locator } from 'playwright-core';\n\nexport async function toBeTruthy(\n this: ExpectMatcherState,\n matcherName: string,\n locator: Locator,\n receiverType: string,\n expected: string,\n arg: string,\n query: (isNot: boolean, timeout: number) => Promise<{ matches: boolean, log?: string[], received?: any, timedOut?: boolean, errorMessage?: string }>,\n options: { timeout?: number } = {},\n): Promise<MatcherResult<any, any>> {\n expectTypes(locator, [receiverType], matcherName);\n\n const timeout = options.timeout ?? this.timeout;\n\n const { matches: pass, log, timedOut, received, errorMessage } = await query(!!this.isNot, timeout);\n\n if (pass === !this.isNot) {\n return {\n name: matcherName,\n message: () => '',\n pass,\n expected\n };\n }\n\n let printedReceived: string | undefined;\n let printedExpected: string | undefined;\n if (pass) {\n printedExpected = `Expected: not ${expected}`;\n printedReceived = errorMessage ? '' : `Received: ${expected}`;\n } else {\n printedExpected = `Expected: ${expected}`;\n printedReceived = errorMessage ? '' : `Received: ${received}`;\n }\n const message = () => {\n return formatMatcherMessage(this, {\n matcherName,\n expectation: arg,\n locator,\n timeout,\n timedOut,\n printedExpected,\n printedReceived,\n errorMessage,\n log,\n });\n };\n\n return {\n message,\n pass,\n actual: received,\n name: matcherName,\n expected,\n log,\n timeout: timedOut ? timeout : undefined,\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAA4B;AAC5B,yBAAqC;AAMrC,eAAsB,WAEpB,aACA,SACA,cACA,UACA,KACA,OACA,UAAgC,CAAC,GACC;AAClC,+BAAY,SAAS,CAAC,YAAY,GAAG,WAAW;AAEhD,QAAM,UAAU,QAAQ,WAAW,KAAK;AAExC,QAAM,EAAE,SAAS,MAAM,KAAK,UAAU,UAAU,aAAa,IAAI,MAAM,MAAM,CAAC,CAAC,KAAK,OAAO,OAAO;AAElG,MAAI,SAAS,CAAC,KAAK,OAAO;AACxB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,MAAM;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACJ,MAAI,MAAM;AACR,sBAAkB,iBAAiB,QAAQ;AAC3C,sBAAkB,eAAe,KAAK,aAAa,QAAQ;AAAA,EAC7D,OAAO;AACL,sBAAkB,aAAa,QAAQ;AACvC,sBAAkB,eAAe,KAAK,aAAa,QAAQ;AAAA,EAC7D;AACA,QAAM,UAAU,MAAM;AACpB,eAAO,yCAAqB,MAAM;AAAA,MAChC;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,SAAS,WAAW,UAAU;AAAA,EAChC;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/matchers/toEqual.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { isRegExp } from 'playwright-core/lib/utils';\n\nimport { expectTypes } from '../util';\nimport { formatMatcherMessage } from './matcherHint';\n\nimport type { MatcherResult } from './matcherHint';\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { Locator } from 'playwright-core';\n\n// Omit colon and one or more spaces, so can call getLabelPrinter.\nconst EXPECTED_LABEL = 'Expected';\nconst RECEIVED_LABEL = 'Received';\n\nexport async function toEqual<T>(\n this: ExpectMatcherState,\n matcherName: string,\n locator: Locator,\n receiverType: string,\n query: (isNot: boolean, timeout: number) => Promise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean, errorMessage?: string }>,\n expected: T,\n options: { timeout?: number, contains?: boolean } = {},\n): Promise<MatcherResult<any, any>> {\n expectTypes(locator, [receiverType], matcherName);\n\n const timeout = options.timeout ?? this.timeout;\n\n const { matches: pass, received, log, timedOut, errorMessage } = await query(!!this.isNot, timeout);\n\n if (pass === !this.isNot) {\n return {\n name: matcherName,\n message: () => '',\n pass,\n expected\n };\n }\n\n let printedReceived: string | undefined;\n let printedExpected: string | undefined;\n let printedDiff: string | undefined;\n if (pass) {\n printedExpected = `Expected: not ${this.utils.printExpected(expected)}`;\n printedReceived = errorMessage ? '' : `Received: ${this.utils.printReceived(received)}`;\n } else if (errorMessage) {\n printedExpected = `Expected: ${this.utils.printExpected(expected)}`;\n } else if (Array.isArray(expected) && Array.isArray(received)) {\n const normalizedExpected = expected.map((exp, index) => {\n const rec = received[index];\n if (isRegExp(exp))\n return exp.test(rec) ? rec : exp;\n\n return exp;\n });\n printedDiff = this.utils.printDiffOrStringify(\n normalizedExpected,\n received,\n EXPECTED_LABEL,\n RECEIVED_LABEL,\n false,\n );\n } else {\n printedDiff = this.utils.printDiffOrStringify(\n expected,\n received,\n EXPECTED_LABEL,\n RECEIVED_LABEL,\n false,\n );\n }\n const message = () => {\n return formatMatcherMessage(this, {\n matcherName,\n expectation: 'expected',\n locator,\n timeout,\n timedOut,\n printedExpected,\n printedReceived,\n printedDiff,\n errorMessage,\n log,\n });\n };\n\n // Passing the actual and expected objects so that a custom reporter\n // could access them, for example in order to display a custom visual diff,\n // or create a different error message\n return {\n actual: received,\n expected, message,\n name: matcherName,\n pass,\n log,\n timeout: timedOut ? timeout : undefined,\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAAyB;AAEzB,kBAA4B;AAC5B,yBAAqC;AAOrC,MAAM,iBAAiB;AACvB,MAAM,iBAAiB;AAEvB,eAAsB,QAEpB,aACA,SACA,cACA,OACA,UACA,UAAoD,CAAC,GACnB;AAClC,+BAAY,SAAS,CAAC,YAAY,GAAG,WAAW;AAEhD,QAAM,UAAU,QAAQ,WAAW,KAAK;AAExC,QAAM,EAAE,SAAS,MAAM,UAAU,KAAK,UAAU,aAAa,IAAI,MAAM,MAAM,CAAC,CAAC,KAAK,OAAO,OAAO;AAElG,MAAI,SAAS,CAAC,KAAK,OAAO;AACxB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,MAAM;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI,MAAM;AACR,sBAAkB,iBAAiB,KAAK,MAAM,cAAc,QAAQ,CAAC;AACrE,sBAAkB,eAAe,KAAK,aAAa,KAAK,MAAM,cAAc,QAAQ,CAAC;AAAA,EACvF,WAAW,cAAc;AACvB,sBAAkB,aAAa,KAAK,MAAM,cAAc,QAAQ,CAAC;AAAA,EACnE,WAAW,MAAM,QAAQ,QAAQ,KAAK,MAAM,QAAQ,QAAQ,GAAG;AAC7D,UAAM,qBAAqB,SAAS,IAAI,CAAC,KAAK,UAAU;AACtD,YAAM,MAAM,SAAS,KAAK;AAC1B,cAAI,uBAAS,GAAG;AACd,eAAO,IAAI,KAAK,GAAG,IAAI,MAAM;AAE/B,aAAO;AAAA,IACT,CAAC;AACD,kBAAc,KAAK,MAAM;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACF,OAAO;AACL,kBAAc,KAAK,MAAM;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACF;AACA,QAAM,UAAU,MAAM;AACpB,eAAO,yCAAqB,MAAM;AAAA,MAChC;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAKA,SAAO;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IAAU;AAAA,IACV,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,SAAS,WAAW,UAAU;AAAA,EAChC;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/matchers/toHaveURL.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 { urlMatches } from 'playwright-core/lib/utils';\n\nimport { printReceivedStringContainExpectedResult } from './expect';\nimport { formatMatcherMessage } from './matcherHint';\nimport { printReceived } from '../common/expectBundle';\n\nimport type { MatcherResult } from './matcherHint';\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { Page } from 'playwright-core';\n\nexport async function toHaveURLWithPredicate(\n this: ExpectMatcherState,\n page: Page,\n expected: (url: URL) => boolean,\n options?: { ignoreCase?: boolean; timeout?: number },\n): Promise<MatcherResult<string | RegExp, string>> {\n const matcherName = 'toHaveURL';\n const timeout = options?.timeout ?? this.timeout;\n const baseURL: string | undefined = (page.context() as any)._options.baseURL;\n let conditionSucceeded = false;\n let lastCheckedURLString: string | undefined = undefined;\n try {\n await page.mainFrame().waitForURL(\n url => {\n lastCheckedURLString = url.toString();\n\n if (options?.ignoreCase) {\n return (\n !this.isNot ===\n urlMatches(\n baseURL?.toLocaleLowerCase(),\n lastCheckedURLString.toLocaleLowerCase(),\n expected,\n )\n );\n }\n\n return (\n !this.isNot === urlMatches(baseURL, lastCheckedURLString, expected)\n );\n },\n { timeout },\n );\n\n conditionSucceeded = true;\n } catch (e) {\n conditionSucceeded = false;\n }\n\n if (conditionSucceeded)\n return { name: matcherName, pass: !this.isNot, message: () => '' };\n\n return {\n name: matcherName,\n pass: this.isNot,\n message: () =>\n toHaveURLMessage(\n this,\n matcherName,\n expected,\n lastCheckedURLString,\n this.isNot,\n true,\n timeout,\n ),\n actual: lastCheckedURLString,\n timeout,\n };\n}\n\nfunction toHaveURLMessage(\n state: ExpectMatcherState,\n matcherName: string,\n expected: Function,\n received: string | undefined,\n pass: boolean,\n timedOut: boolean,\n timeout: number,\n): string {\n const receivedString = received || '';\n\n let printedReceived: string | undefined;\n let printedExpected: string | undefined;\n let printedDiff: string | undefined;\n if (typeof expected === 'function') {\n printedExpected = `Expected: predicate to ${!state.isNot ? 'succeed' : 'fail'}`;\n printedReceived = `Received: ${printReceived(receivedString)}`;\n } else {\n if (pass) {\n printedExpected = `Expected pattern: not ${state.utils.printExpected(expected)}`;\n const formattedReceived = printReceivedStringContainExpectedResult(receivedString, null);\n printedReceived = `Received string: ${formattedReceived}`;\n } else {\n const labelExpected = `Expected ${typeof expected === 'string' ? 'string' : 'pattern'}`;\n printedDiff = state.utils.printDiffOrStringify(expected, receivedString, labelExpected, 'Received string', false);\n }\n }\n\n return formatMatcherMessage(state, {\n matcherName,\n expectation: 'expected',\n timeout,\n timedOut,\n printedExpected,\n printedReceived,\n printedDiff,\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAA2B;AAE3B,oBAAyD;AACzD,yBAAqC;AACrC,0BAA8B;AAM9B,eAAsB,uBAEpB,MACA,UACA,SACiD;AACjD,QAAM,cAAc;AACpB,QAAM,UAAU,SAAS,WAAW,KAAK;AACzC,QAAM,UAA+B,KAAK,QAAQ,EAAU,SAAS;AACrE,MAAI,qBAAqB;AACzB,MAAI,uBAA2C;AAC/C,MAAI;AACF,UAAM,KAAK,UAAU,EAAE;AAAA,MACnB,SAAO;AACL,+BAAuB,IAAI,SAAS;AAEpC,YAAI,SAAS,YAAY;AACvB,iBACE,CAAC,KAAK,cACN;AAAA,YACI,SAAS,kBAAkB;AAAA,YAC3B,qBAAqB,kBAAkB;AAAA,YACvC;AAAA,UACJ;AAAA,QAEJ;AAEA,eACE,CAAC,KAAK,cAAU,yBAAW,SAAS,sBAAsB,QAAQ;AAAA,MAEtE;AAAA,MACA,EAAE,QAAQ;AAAA,IACd;AAEA,yBAAqB;AAAA,EACvB,SAAS,GAAG;AACV,yBAAqB;AAAA,EACvB;AAEA,MAAI;AACF,WAAO,EAAE,MAAM,aAAa,MAAM,CAAC,KAAK,OAAO,SAAS,MAAM,GAAG;AAEnE,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,KAAK;AAAA,IACX,SAAS,MACP;AAAA,MACI;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA;AAAA,IACJ;AAAA,IACF,QAAQ;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,iBACP,OACA,aACA,UACA,UACA,MACA,UACA,SACQ;AACR,QAAM,iBAAiB,YAAY;AAEnC,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI,OAAO,aAAa,YAAY;AAClC,sBAAkB,0BAA0B,CAAC,MAAM,QAAQ,YAAY,MAAM;AAC7E,sBAAkB,iBAAa,mCAAc,cAAc,CAAC;AAAA,EAC9D,OAAO;AACL,QAAI,MAAM;AACR,wBAAkB,yBAAyB,MAAM,MAAM,cAAc,QAAQ,CAAC;AAC9E,YAAM,wBAAoB,wDAAyC,gBAAgB,IAAI;AACvF,wBAAkB,oBAAoB,iBAAiB;AAAA,IACzD,OAAO;AACL,YAAM,gBAAgB,YAAY,OAAO,aAAa,WAAW,WAAW,SAAS;AACrF,oBAAc,MAAM,MAAM,qBAAqB,UAAU,gBAAgB,eAAe,mBAAmB,KAAK;AAAA,IAClH;AAAA,EACF;AAEA,aAAO,yCAAqB,OAAO;AAAA,IACjC;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/matchers/toMatchAriaSnapshot.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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\nimport fs from 'fs';\nimport path from 'path';\n\nimport { escapeTemplateString, isString } from 'playwright-core/lib/utils';\n\nimport { formatMatcherMessage } from './matcherHint';\nimport { fileExistsAsync } from '../util';\nimport { printReceivedStringContainExpectedSubstring } from './expect';\nimport { currentTestInfo } from '../common/globals';\n\nimport type { MatcherResult } from './matcherHint';\nimport type { LocatorEx } from './matchers';\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { MatcherReceived } from '@injected/ariaSnapshot';\n\n\ntype ToMatchAriaSnapshotExpected = {\n name?: string;\n path?: string;\n timeout?: number;\n} | string;\n\nexport async function toMatchAriaSnapshot(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expectedParam?: ToMatchAriaSnapshotExpected,\n options: { timeout?: number } = {},\n): Promise<MatcherResult<string | RegExp, string>> {\n const matcherName = 'toMatchAriaSnapshot';\n\n const testInfo = currentTestInfo();\n if (!testInfo)\n throw new Error(`toMatchAriaSnapshot() must be called during the test`);\n\n if (testInfo._projectInternal.ignoreSnapshots)\n return { pass: !this.isNot, message: () => '', name: 'toMatchAriaSnapshot', expected: '' };\n\n const updateSnapshots = testInfo.config.updateSnapshots;\n\n let expected: string;\n let timeout: number;\n let expectedPath: string | undefined;\n if (isString(expectedParam)) {\n expected = expectedParam;\n timeout = options.timeout ?? this.timeout;\n } else {\n const legacyPath = testInfo._resolveSnapshotPaths('aria', expectedParam?.name, 'dontUpdateSnapshotIndex', '.yml').absoluteSnapshotPath;\n expectedPath = testInfo._resolveSnapshotPaths('aria', expectedParam?.name, 'updateSnapshotIndex').absoluteSnapshotPath;\n // in 1.51, we changed the default template to use .aria.yml extension\n // for backwards compatibility, we check for the legacy .yml extension\n if (!(await fileExistsAsync(expectedPath)) && await fileExistsAsync(legacyPath))\n expectedPath = legacyPath;\n expected = await fs.promises.readFile(expectedPath, 'utf8').catch(() => '');\n timeout = expectedParam?.timeout ?? this.timeout;\n }\n\n const generateMissingBaseline = updateSnapshots === 'missing' && !expected;\n if (generateMissingBaseline) {\n if (this.isNot) {\n const message = `Matchers using \".not\" can't generate new baselines`;\n return { pass: this.isNot, message: () => message, name: 'toMatchAriaSnapshot' };\n } else {\n // When generating new baseline, run entire pipeline against impossible match.\n expected = `- none \"Generating new baseline\"`;\n }\n }\n\n expected = unshift(expected);\n const { matches: pass, received, log, timedOut, errorMessage } = await locator._expect('to.match.aria', { expectedValue: expected, isNot: this.isNot, timeout });\n const typedReceived = received as MatcherReceived;\n\n const message = () => {\n let printedExpected: string | undefined;\n let printedReceived: string | undefined;\n let printedDiff: string | undefined;\n if (errorMessage) {\n printedExpected = `Expected: ${this.isNot ? 'not ' : ''}${this.utils.printExpected(expected)}`;\n } else if (pass) {\n const receivedString = printReceivedStringContainExpectedSubstring(typedReceived.raw, typedReceived.raw.indexOf(expected), expected.length);\n printedExpected = `Expected: not ${this.utils.printExpected(expected)}`;\n printedReceived = `Received: ${receivedString}`;\n } else {\n printedDiff = this.utils.printDiffOrStringify(expected, typedReceived.raw, 'Expected', 'Received', false);\n }\n return formatMatcherMessage(this, {\n matcherName,\n expectation: 'expected',\n locator,\n timeout,\n timedOut,\n printedExpected,\n printedReceived,\n printedDiff,\n errorMessage,\n log,\n });\n };\n\n if (errorMessage)\n return { pass: this.isNot, message, name: 'toMatchAriaSnapshot', expected };\n\n if (!this.isNot) {\n if ((updateSnapshots === 'all') ||\n (updateSnapshots === 'changed' && pass === this.isNot) ||\n generateMissingBaseline) {\n if (expectedPath) {\n await fs.promises.mkdir(path.dirname(expectedPath), { recursive: true });\n await fs.promises.writeFile(expectedPath, typedReceived.regex, 'utf8');\n const relativePath = path.relative(process.cwd(), expectedPath);\n if (updateSnapshots === 'missing') {\n const message = `A snapshot doesn't exist at ${relativePath}, writing actual.`;\n testInfo._hasNonRetriableError = true;\n testInfo._failWithError(new Error(message));\n } else {\n const message = `A snapshot is generated at ${relativePath}.`;\n /* eslint-disable no-console */\n console.log(message);\n }\n return { pass: true, message: () => '', name: 'toMatchAriaSnapshot' };\n } else {\n const suggestedRebaseline = `\\`\\n${escapeTemplateString(indent(typedReceived.regex, '{indent} '))}\\n{indent}\\``;\n if (updateSnapshots === 'missing') {\n const message = 'A snapshot is not provided, generating new baseline.';\n testInfo._hasNonRetriableError = true;\n testInfo._failWithError(new Error(message));\n }\n // TODO: ideally, we should return \"pass: true\" here because this matcher passes\n // when regenerating baselines. However, we can only access suggestedRebaseline in case\n // of an error, so we fail here and workaround it in the expect implementation.\n return { pass: false, message: () => '', name: 'toMatchAriaSnapshot', suggestedRebaseline };\n }\n }\n }\n\n return {\n name: matcherName,\n expected,\n message,\n pass,\n actual: received,\n log,\n timeout: timedOut ? timeout : undefined,\n };\n}\n\nfunction unshift(snapshot: string): string {\n const lines = snapshot.split('\\n');\n let whitespacePrefixLength = 100;\n for (const line of lines) {\n if (!line.trim())\n continue;\n const match = line.match(/^(\\s*)/);\n if (match && match[1].length < whitespacePrefixLength)\n whitespacePrefixLength = match[1].length;\n }\n return lines.filter(t => t.trim()).map(line => line.substring(whitespacePrefixLength)).join('\\n');\n}\n\nfunction indent(snapshot: string, indent: string): string {\n return snapshot.split('\\n').map(line => indent + line).join('\\n');\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA,gBAAe;AACf,kBAAiB;AAEjB,mBAA+C;AAE/C,yBAAqC;AACrC,kBAAgC;AAChC,oBAA4D;AAC5D,qBAAgC;AAchC,eAAsB,oBAEpB,SACA,eACA,UAAgC,CAAC,GACgB;AACjD,QAAM,cAAc;AAEpB,QAAM,eAAW,gCAAgB;AACjC,MAAI,CAAC;AACH,UAAM,IAAI,MAAM,sDAAsD;AAExE,MAAI,SAAS,iBAAiB;AAC5B,WAAO,EAAE,MAAM,CAAC,KAAK,OAAO,SAAS,MAAM,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