@appsurify-testmap/rrweb-cypress-plugin 2.1.1-alpha.6 → 2.1.1-alpha.7

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/browser/runtime.ts","../src/browser/utils.ts","../src/recorder/RRWebRecorder.ts","../src/recorder/index.ts","../src/browser/events/cypress.ts","../src/browser/events/mocha.ts","../src/browser/events/index.ts","../src/browser/index.ts"],"sourcesContent":["import type { TestRunContext } from '../types';\n\n\nexport const testContexts = new Map<string, TestRunContext>();\n\nexport function setCurrentTestContext(key: string, ctx: TestRunContext): void {\n testContexts.set(key, ctx);\n}\n\nexport function getCurrentTestContext(key: string): TestRunContext | undefined {\n return testContexts.get(key);\n}\n\nexport function clearTestContext(key: string): void {\n testContexts.delete(key);\n}\n\n\n","/// <reference types=\"cypress\" />\nimport type {\n TestSuiteInfo,\n TestInfo,\n TestInfoInvocationDetails,\n TestRunResult,\n TestRunContext, SpecInfo, BrowserInfo,\n} from '../types';\n\n\nexport function safeSerializeArray(arr: unknown[]): (string | number | boolean | null)[] {\n return arr\n .filter((value): value is string | number | boolean | null => {\n // Удаляем { log: false }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (typeof value === 'object' && value !== null && 'log' in value && (value as any).log === false) {\n return false;\n }\n\n // Пропускаем только примитивы\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n value === null\n );\n });\n}\n\nexport function buildSelector(subject: JQuery<HTMLElement> | undefined): string | null {\n const el = subject?.[0];\n if (!el) return null;\n\n const tag = el.tagName.toLowerCase();\n const id = el.id ? `#${el.id}` : '';\n const classSelector = Array.from(el.classList)\n .map(cls => `.${cls}`)\n .join('');\n\n return `${tag}${id}${classSelector}`;\n}\n\nexport function getTestKey(test: Mocha.Test | { titlePath: () => string[] }): string {\n return test.titlePath().join(' > ');\n}\n\nexport function getSizeInBytes(data: unknown): number {\n let str: string;\n\n if (typeof data === 'string') {\n str = data;\n } else {\n try {\n str = JSON.stringify(data);\n } catch {\n return 0;\n }\n }\n\n return new TextEncoder().encode(str).length;\n}\n\nexport function formatBytes(bytes: number): string {\n const kb = bytes / 1024;\n const mb = kb / 1024;\n\n if (mb >= 1) return `${mb.toFixed(2)} MB`;\n if (kb >= 1) return `${kb.toFixed(2)} KB`;\n return `${bytes} B`;\n}\n\nexport async function createHash(data: object): Promise<string> {\n const json = JSON.stringify(data);\n const buffer = new TextEncoder().encode(json);\n const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');\n}\n\n\nexport function prepareTestSuite(suite: Mocha.Suite & {id: string, type: string} | undefined): TestSuiteInfo | undefined {\n if (!suite) return undefined;\n\n\n return {\n id: suite.id,\n file: suite.file,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n invocationDetails: safeInvocationDetails(suite.invocationDetails),\n pending: suite.pending,\n root: suite.root,\n title: suite.title,\n type: suite.type,\n }\n}\n\nexport function prepareTest(test: Mocha.Test & {id: string, type: string, parent: Mocha.Suite | undefined}): TestInfo {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const suite = prepareTestSuite(test.parent);\n console.log(\"Suite\", suite);\n return {\n suite: suite,\n file: test.file,\n duration: test.duration,\n id: test.id,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n invocationDetails: safeInvocationDetails(test.invocationDetails),\n pending: test.pending,\n state: test.state,\n sync: test.sync,\n timedOut: test.timedOut,\n title: test.title,\n titlePath: test.titlePath(),\n fullTitle: test.fullTitle(),\n type: test.type,\n }\n}\n\nexport function safeInvocationDetails(details?: Partial<TestInfoInvocationDetails>): TestInfoInvocationDetails {\n return {\n absoluteFile: details?.absoluteFile ?? '',\n column: details?.column ?? 0,\n fileUrl: details?.fileUrl ?? '',\n function: details?.function ?? '',\n line: details?.line ?? 0,\n originalFile: details?.originalFile ?? '',\n relativeFile: details?.relativeFile ?? '',\n };\n}\n\n\nexport function mapTestRunContextToResult(ctx: TestRunContext): TestRunResult {\n\n return {\n spec: mapSpec(ctx.spec),\n browser: mapBrowser(ctx.browser),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n test: mapTest(ctx.test),\n recorderEvents: Array.isArray(ctx.recorderEvents) ? ctx.recorderEvents : [],\n };\n}\n\nexport function mapSpec(spec: Cypress.Spec): SpecInfo {\n return {\n name: spec.name ?? '',\n absolute: spec.absolute ?? '',\n relative: spec.relative ?? '',\n specFilter: spec.specFilter ?? '',\n specType: spec.specType ?? 'integration',\n baseName: spec.baseName ?? '',\n fileExtension: spec.fileExtension ?? '',\n fileName: spec.fileName ?? '',\n id: spec.id ?? '',\n };\n}\n\nexport function mapBrowser(browser: Cypress.Browser): BrowserInfo {\n return {\n name: browser.name ?? '',\n version: browser.version ?? '',\n displayName: browser.displayName ?? '',\n family: browser.family ?? '',\n majorVersion: browser.majorVersion ?? '',\n channel: browser.channel ?? '',\n path: browser.path ?? '',\n };\n}\n\nexport function mapTest(test: Mocha.Test & {id: string}): TestInfo {\n\n\n return {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n suite: prepareTestSuite(test.parent),\n file: test.file ?? '',\n duration: test.duration ?? 0,\n id: test.id ?? '',\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n invocationDetails: safeInvocationDetails(test.invocationDetails),\n pending: test.pending ?? false,\n state: test.state ?? 'unknown',\n sync: test.sync ?? false,\n timedOut: test.timedOut ?? false,\n title: test.title ?? '',\n titlePath: typeof test.titlePath === 'function' ? test.titlePath() : [],\n fullTitle: typeof test.fullTitle === 'function' ? test.fullTitle() : '',\n type: test.type ?? 'test',\n };\n}\n","import type { record } from '@appsurify-testmap/rrweb';\nimport type { Mirror } from '@appsurify-testmap/rrweb-snapshot';\nimport { getRecordSequentialIdPlugin } from '@appsurify-testmap/rrweb-plugin-sequential-id-record';\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport rrSrc from './releases/rrweb-record.umd.cjs.src';\n\nimport type { RecorderContext, Recorder, RecorderEvent } from './types';\n\ninterface WindowWithRRWeb extends Window {\n rrweb?: {\n record: typeof record | null;\n };\n}\n\nexport class RRWebRecorder implements Recorder {\n private recordFn: typeof record | null = null;\n private stopFn: (() => void) | undefined | null = null;\n private targetWindow: Window | null = null;\n private context: RecorderContext;\n private eventCounter = 0;\n private events: RecorderEvent[] = [];\n\n private pendingEvents: {\n tag: string;\n payload: Record<string, unknown>;\n }[] = [];\n\n constructor() {\n this.context = {\n pushEvent: (event) => this.events.push(event),\n };\n }\n\n private handleEmit(event: RecorderEvent) {\n if (event.type === 0 || event.type === 1) {\n return;\n }\n const rrEvent: RecorderEvent = {\n ...event,\n };\n this.context.pushEvent(rrEvent);\n }\n\n public inject(win: Window) {\n const w = win as WindowWithRRWeb;\n\n this.targetWindow = win;\n\n if (w.rrweb) {\n this.recordFn = w.rrweb.record ?? null;\n return;\n }\n\n const script = win.document.createElement('script');\n script.type = 'text/javascript';\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n script.innerHTML = rrSrc;\n win.document.head.appendChild(script);\n\n const recheck = (win as WindowWithRRWeb).rrweb;\n if (!recheck || !recheck.record) {\n console.error(`🟡 [rrweb] Failed to load rrweb.record`);\n return;\n }\n\n this.recordFn = recheck.record;\n }\n\n public start() {\n if (!this.targetWindow || !this.recordFn) {\n console.warn(`🟡 [rrweb] Not ready to start`);\n return;\n }\n\n if (this.stopFn) {\n console.warn(`🟡 [rrweb] Already recording`);\n return;\n }\n\n this.stopFn = this.recordFn({\n emit: (event: RecorderEvent) => this.handleEmit(event),\n checkoutEveryNvm: 10,\n plugins: [\n getRecordSequentialIdPlugin({\n key: 'id',\n getId: () => ++this.eventCounter,\n }),\n ],\n // includeAttribute: /data-(cy|test(id)?|cypress|highlight-el|cypress-el)/i,\n maskInputOptions: { password: true },\n slimDOMOptions: 'all',\n inlineStylesheet: true,\n sampling: {\n mousemove: false,\n mouseInteraction: {\n MouseUp: false,\n MouseDown: false,\n Click: true,\n ContextMenu: true,\n DblClick: true,\n Focus: true,\n Blur: true,\n TouchStart: false,\n TouchEnd: false,\n },\n scroll: 100,\n media: 100,\n input: 'last',\n canvas: 'all',\n visibility: {\n mode: 'debounce',\n debounce: 50,\n threshold: 0.5,\n sensitivity: 0.05,\n rafThrottle: 50\n }\n },\n recordDOM: true,\n recordCanvas: true,\n collectFonts: true,\n inlineImages: true,\n flushCustomEvent: 'after',\n // recordAfter: 'DOMContentStabilized',\n recordAfter: 'DOMContentLoaded',\n });\n\n this.flush();\n }\n\n public stop() {\n this.flush();\n this.stopFn?.();\n this.stopFn = null;\n }\n\n public reset() {\n this.eventCounter = 0;\n this.events = [];\n this.stop();\n this.context = {\n pushEvent: (event) => this.events.push(event),\n };\n }\n\n public flush() {\n if (!this.recordFn) return;\n\n const stillPending: typeof this.pendingEvents = [];\n\n for (const evt of this.pendingEvents) {\n try {\n this.recordFn.addCustomEvent(evt.tag, evt.payload);\n } catch (err) {\n console.warn(`[rrweb] flush failed for custom event: ${evt.tag}`);\n stillPending.push(evt);\n }\n }\n\n this.pendingEvents = stillPending;\n }\n\n public addCustomEvent(tag: string, payload: Record<string, unknown>) {\n const event = { tag, payload };\n\n if (!this.recordFn || !this.stopFn) {\n console.warn(`[rrweb] queued custom event (recorder not ready): ${tag}`);\n this.pendingEvents.push(event);\n return;\n }\n\n try {\n this.recordFn.addCustomEvent(tag, payload);\n } catch (error) {\n console.warn(`[rrweb] error adding custom event: ${tag}`, error);\n this.pendingEvents.push(event);\n }\n }\n\n public isRecordingReady(): boolean {\n return !!this.recordFn && !!this.stopFn;\n }\n\n public getEvents(): readonly RecorderEvent[] {\n return this.events;\n }\n\n public getMirror(): Mirror | undefined {\n return (this.recordFn as unknown as { mirror?: Mirror })?.mirror;\n }\n\n public bind(ctx: RecorderContext) {\n this.context = ctx;\n }\n\n public setEventCounter(value: number) {\n this.eventCounter = value;\n }\n}\n","import { RRWebRecorder } from './RRWebRecorder';\n\n\nexport default RRWebRecorder;\n","/// <reference types=\"cypress\" />\n\nimport {getCurrentTestContext, setCurrentTestContext} from '../runtime';\nimport {safeSerializeArray, buildSelector, getTestKey, mapTestRunContextToResult} from '../utils';\nimport RRWebRecorder from '../../recorder';\nimport type {RecorderEvent} from '../../recorder/types';\nimport type {TestRunContext} from '../../types';\n\nconst recorder = new RRWebRecorder();\n\nexport const registerCypressEventListeners = () => {\n\n Cypress\n .on('test:before:run', onTestBeforeRun)\n .on('log:added', onLogAdded)\n .on('log:changed', onLogChanged)\n .on('window:before:load', onWindowBeforeLoad)\n .on('window:before:unload', onWindowBeforeUnload)\n .on('window:unload', onWindowUnload)\n .on('window:load', onWindowLoad)\n .on('command:enqueued', onCommandEnqueued)\n .on('command:start', onCommandStart)\n .on('command:end', onCommandEnd)\n .on('command:retry', onCommandRetry)\n .on('skipped:command:end', onSkippedCommandEnd)\n .on('test:after:run', onTestAfterRun)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .on('command:failed', onCommandFailed)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .on('command:queue:end', onCommandQueueEnd)\n .on('fail', onFail);\n\n\n afterEach(() => {\n // console.debug(`🟡 [${Date.now()}] [cypress] afterEach:`);\n const currentTest = Cypress.currentTest;\n if (!currentTest) return;\n\n const testKey = getTestKey({ titlePath: () => currentTest.titlePath });\n const ctx = getCurrentTestContext(testKey);\n if (!ctx) return;\n\n ctx.recorderEvents.map((event) => {\n if (event.type !== 5 ) return event;\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n const liveCommand = ctx.commandLiveRefs.get(event.data.payload.id);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // event.data.payload.element = element;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n event.data.payload.state = liveCommand?.state ?? 'unknown';\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // event.data.payload.args = liveCommand?.get('args');\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n event.data.payload.args = safeSerializeArray(liveCommand?.get('args'));\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n event.data.payload.query = liveCommand?.get('query');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n event.data.payload.timeout = liveCommand?.get('timeout');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n event.data.payload.name = liveCommand?.get('name');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n event.data.payload.type = liveCommand?.get('type');\n\n\n if (liveCommand?.get('prev')) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n event.data.payload.prev = {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access\n state: liveCommand?.get('prev').state,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call\n name: liveCommand?.get('prev').get('name'),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n args: safeSerializeArray(liveCommand?.get('prev').get('args')),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n type: liveCommand?.get('prev').get('type'),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n query: liveCommand?.get('prev').get('query'),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n id: liveCommand?.get('prev').get('id'),\n };\n }\n\n if (liveCommand?.get('next')) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n event.data.payload.next = {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n state: liveCommand?.get('next').state,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n name: liveCommand?.get('next').get('name'),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n args: safeSerializeArray(liveCommand?.get('next').get('args')),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n type: liveCommand?.get('next').get('type'),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n query: liveCommand?.get('next').get('query'),\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument\n id: liveCommand?.get('next').get('id'),\n };\n }\n return event;\n })\n console.debug(`🟡 [${Date.now()}] [cypress] afterEach:`, ctx.recorderEvents);\n\n // const testRunResult: TestRunResult = {\n // spec: ctx.spec as unknown as SpecInfo,\n // test: prepareTest(ctx.test),\n // browser: ctx.browser as BrowserInfo,\n // recorderEvents: ctx.recorderEvents,\n // }\n\n const testRunResult = mapTestRunContextToResult(ctx);\n\n\n // const testRunResultSize = getSizeInBytes(testRunResult);\n // console.debug(`🟡 [${Date.now()}] [cypress] afterEach:testResult:`, testRunResult);\n // console.debug(`🟡 [${Date.now()}] [cypress] afterEach:testResult:size:`, formatBytes(testRunResultSize));\n // const debugReport = new UICoverageReport(testRunResult);\n // console.debug(`🟡 [${Date.now()}] [cypress] afterEach:testResult:debugReport:`, debugReport.toJSON());\n\n try {\n cy.task('saveRRWebReport', testRunResult, { log: false });\n } catch (e) {\n console.error(`🟡 [${Date.now()}] [cypress] afterEach:saveRRWebReport`, e);\n }\n\n\n });\n\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // Cypress.Commands.overwrite('type', (originalFn, subject, text, options) => {\n // // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // // @ts-expect-error\n // return originalFn(subject, text, options).then(() => {\n // if (Cypress.dom.isElement(subject[0])) {\n // const el = subject[0];\n // if (el) {\n // // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // // @ts-expect-error\n // // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n // el.dispatchEvent(new Event('input', { bubbles: true }));\n // // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // // @ts-expect-error\n // // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n // el.dispatchEvent(new Event('change', { bubbles: true }));\n // }\n // }\n // });\n // });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onTestBeforeRun = (attributes: Cypress.ObjectLike, test: Mocha.Test) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onTestBeforeRun`, attributes, test);\n const testKey = getTestKey(test);\n const testRunContext: TestRunContext = {\n spec: Cypress.spec,\n test: test,\n browser: Cypress.browser,\n autWindow: null,\n waitForPaint: () => Promise.resolve(undefined),\n paintComplete: false,\n recorderEvents: [] as RecorderEvent[],\n commandLiveRefs: new Map<string, Cypress.CommandQueue>()\n };\n\n setCurrentTestContext(testKey, testRunContext);\n\n recorder.bind({\n pushEvent: (event) => {\n console.debug(`🟡 [${Date.now()}] [cypress] pushEvent`, event);\n testRunContext.recorderEvents.push(event)\n if (event.type === 5) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n const liveCommand = testRunContext.commandLiveRefs.get(event.data.payload.id);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const subject = liveCommand?.get('subject')\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument\n const selector = subject?.selector ?? buildSelector(subject);\n\n const mirror = recorder.getMirror();\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access\n const element = mirror?.getMeta(subject?.[0]);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n event.data.payload.element = {\n ...element,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n selector,\n childNodes: []\n };\n }\n },\n });\n\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onLogAdded = (attributes: Cypress.ObjectLike, log: Cypress.Log) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onLogAdded`, attributes, log);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onLogChanged = (attributes: Cypress.ObjectLike, log: Cypress.Log) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onLogChanged`, attributes, log);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onWindowBeforeUnload = (event: BeforeUnloadEvent) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onWindowBeforeUnload`, event);\n // try {\n // recorder.stop();\n // // eslint-disable-next-line @typescript-eslint/no-unused-vars\n // } catch (e) { /* empty */ }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onWindowUnload = (event: BeforeUnloadEvent) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onWindowUnload`, event);\n try {\n recorder.stop();\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) { /* empty */ }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst onWindowBeforeLoad = (win: Cypress.AUTWindow) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onWindowBeforeLoad`, win);\n recorder.inject(win);\n // recorder.start();\n\n const currentTest = Cypress.currentTest;\n if (!currentTest) return;\n\n const testKey = getTestKey({ titlePath: () => currentTest.titlePath });\n const ctx = getCurrentTestContext(testKey);\n if (!ctx) return;\n\n ctx.autWindow = win;\n ctx.paintComplete = false;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst onWindowLoad = (win: Cypress.AUTWindow) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onWindowLoad`, win);\n recorder.inject(win);\n recorder.start();\n\n const currentTest = Cypress.currentTest;\n if (!currentTest) return;\n\n const testKey = getTestKey({ titlePath: () => currentTest.titlePath });\n const ctx = getCurrentTestContext(testKey);\n if (!ctx) return;\n\n if (!ctx.autWindow) {\n ctx.autWindow = win;\n ctx.paintComplete = false;\n }\n\n ctx.waitForPaint = (value?: unknown): Promise<unknown> => {\n return new Promise<unknown>((resolve) => {\n const maxWaitMs = 5000;\n\n const captureAfterPaint = () => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n resolve(value);\n });\n });\n };\n\n const safeResolve = (() => {\n let called = false;\n return () => {\n if (!called) {\n called = true;\n captureAfterPaint();\n }\n };\n })();\n\n if (['interactive', 'complete'].includes(win.document.readyState)) {\n safeResolve();\n } else {\n win.addEventListener('DOMContentLoaded', safeResolve, { once: true });\n win.addEventListener('load', safeResolve, { once: true });\n setTimeout(() => {\n console.warn('⏳ Timeout: forcing resolution');\n safeResolve();\n }, maxWaitMs);\n }\n });\n };\n\n // eslint-disable-next-line @typescript-eslint/require-await\n void ctx.waitForPaint().then(async () => {\n ctx.paintComplete = true;\n // recorder.inject(win);\n // recorder.start();\n });\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onCommandEnqueued = (command: Cypress.EnqueuedCommandAttributes) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onCommandEnqueued`, command);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onCommandRetry = (command: Cypress.CommandQueue) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onCommandRetry`, command);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst onCommandStart = (command: Cypress.CommandQueue) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onCommandStart`, command);\n const currentTest = Cypress.currentTest;\n if (!currentTest) return;\n\n const testKey = getTestKey({ titlePath: () => currentTest.titlePath });\n const ctx = getCurrentTestContext(testKey);\n if (!ctx) return;\n\n // Control and store live object\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access\n ctx.commandLiveRefs.set(command.attributes.id, command);\n\n // If need before state\n // recorder.addCustomEvent(`${command.attributes.name}`, {\n // id: command.attributes.id,\n // });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst onCommandEnd = (command: Cypress.CommandQueue) => {\n console.debug(`🟡 [${Date.now()}] [cypress] onCommandEnd`, command);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-template-expressions\n recorder.addCustomEvent(`${command.attributes.name}`, {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n id: command.attributes.id,\n });\n\n\n // const currentTest = Cypress.currentTest;\n // if (!currentTest) return;\n //\n // const testKey = getTestKey({ titlePath: () => currentTest.titlePath });\n // const ctx = getCurrentTestContext(testKey);\n // if (!ctx) return;\n //\n // const waitAndSnapshot = async () => {\n // if (typeof ctx.waitForPaint === 'function' && !ctx.paintComplete) {\n // console.log(`${Date.now()} [cypress] command:end:waiting for paint...`);\n // await ctx.waitForPaint();\n // ctx.paintComplete = true;\n // // recorder.addCustomEvent(`${command.attributes.name}`, {\n // // id: command.attributes.id,\n // // });\n // console.log(`${Date.now()} [cypress] command:end:paint complete`);\n // }\n // }\n // void waitAndSnapshot();\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onCommandFailed = (command: Cypress.CommandQueue, err: unknown) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onCommandFailed`, command);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-template-expressions\n recorder.addCustomEvent(`${command.attributes.name}`, {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n id: command.attributes.id,\n });\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onSkippedCommandEnd = (command: Cypress.CommandQueue) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onSkippedCommandEnd`, command);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst onCommandQueueEnd = () => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onCommandQueueEnd`);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst onFail = (error: Cypress.CypressError, mocha: Mocha.Runnable) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onFail`, {error, mocha});\n throw error;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/require-await\nconst onTestAfterRun = async (attributes: Cypress.ObjectLike, test: Mocha.Test) => {\n // console.debug(`🟡 [${Date.now()}] [cypress] onTestAfterRun`, attributes, test);\n recorder.stop();\n\n // const testKey = getTestKey(test);\n // const ctx = getCurrentTestContext(testKey);\n // if (!ctx) return;\n //\n // console.debug(`🟡 [${Date.now()}] [cypress] onTestAfterRun`, ctx.recorderEvents);\n};\n\n\n","/// <reference types=\"cypress\" />\n\n\nexport const registerMochaEventListeners = () => {\n // ⚠️ Плохой стиль, отключает всю типизацию\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((Cypress as any).mocha.getRunner() as Mocha.Runner)\n .on('hook', onHook);\n};\n\nconst onHook = () => {\n // console.debug(`🟡 [${Date.now()}] [mocha] onHook:`);\n};\n\nexport const injectMochaHookFunctions = () => {\n\n beforeEach('', ()=> {\n // console.debug(`🟡 [${Date.now()}] [mocha] beforeEach:`);\n });\n\n afterEach('', ()=> {\n // console.debug(`🟡 [${Date.now()}] [mocha] afterEach:`);\n // const currentTest = Cypress.currentTest;\n // const testKey = getTestKey({ titlePath: () => currentTest.titlePath });\n //\n // const ctx = getCurrentTestContext(testKey);\n // if (!ctx) return;\n // const serializedReport = serializeTestRunContextToJson(ctx);\n // console.log(`${Date.now()} [afterEach]`, currentTest, serializedReport);\n // cy.task('saveSnapshotReport', serializedReport)\n });\n\n};\n","import { registerCypressEventListeners } from \"./cypress\";\nimport { registerMochaEventListeners, injectMochaHookFunctions } from \"./mocha\";\n\nexport const enableTestmap = () => {\n registerCypressEventListeners();\n registerMochaEventListeners();\n injectMochaHookFunctions();\n};\n","import { enableTestmap } from './events';\n\nexport const initializeTestmap = () => {\n // if (isTestmap().Initialized) {\n // return;\n // }\n enableTestmap();\n}\n"],"mappings":"AAGO,IAAMA,EAAe,IAAI,IAEzB,SAASC,EAAsBC,EAAaC,EAA2B,CAC5EH,EAAa,IAAIE,EAAKC,CAAG,CAC3B,CAEO,SAASC,EAAsBF,EAAyC,CAC7E,OAAOF,EAAa,IAAIE,CAAG,CAC7B,CCDO,SAASG,EAAmBC,EAAsD,CACvF,OAAOA,EACJ,OAAQC,GAGH,OAAOA,GAAU,UAAYA,IAAU,MAAQ,QAASA,GAAUA,EAAc,MAAQ,GACnF,GAKP,OAAOA,GAAU,UACjB,OAAOA,GAAU,UACjB,OAAOA,GAAU,WACjBA,IAAU,IAEb,CACL,CAEO,SAASC,EAAcC,EAAyD,CACrF,IAAMC,EAAKD,IAAU,CAAC,EACtB,GAAI,CAACC,EAAI,OAAO,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,EAAoB,IAAM,CAEhC,EAIMC,EAAS,CAAC6B,EAA6BC,IAA0B,CAEnE,MAAMD,CACV,EAKMhC,EAAiB,MAAOe,EAAgCC,IAAqB,CAE/E/B,EAAS,KAAK,CAOlB,ECxcO,IAAMiD,EAA8B,IAAM,CAG7C,QAAgB,MAAM,UAAU,EAC7B,GAAG,OAAQC,CAAM,CACxB,EAEMA,EAAS,IAAM,CAErB,EAEaC,EAA2B,IAAM,CAE5C,WAAW,GAAI,IAAK,CAEpB,CAAC,EAED,UAAU,GAAI,IAAK,CAUnB,CAAC,CAEH,EC7BO,IAAMC,EAAgB,IAAM,CACjCC,EAA8B,EAC9BC,EAA4B,EAC5BC,EAAyB,CAC3B,ECLO,IAAMC,EAAoB,IAAM,CAInCC,EAAc,CAClB","names":["testContexts","setCurrentTestContext","key","ctx","getCurrentTestContext","safeSerializeArray","arr","value","buildSelector","subject","el","tag","id","classSelector","cls","getTestKey","test","prepareTestSuite","suite","safeInvocationDetails","safeInvocationDetails","details","mapTestRunContextToResult","ctx","mapSpec","mapBrowser","mapTest","spec","browser","test","prepareTestSuite","getRecordSequentialIdPlugin","RRWebRecorder","event","rrEvent","win","w","script","rrweb_record_umd_cjs_default","recheck","getRecordSequentialIdPlugin","stillPending","evt","tag","payload","error","ctx","value","recorder_default","RRWebRecorder","recorder","recorder_default","registerCypressEventListeners","onTestBeforeRun","onLogAdded","onLogChanged","onWindowBeforeLoad","onWindowBeforeUnload","onWindowUnload","onWindowLoad","onCommandEnqueued","onCommandStart","onCommandEnd","onCommandRetry","onSkippedCommandEnd","onTestAfterRun","onCommandFailed","onCommandQueueEnd","onFail","currentTest","testKey","getTestKey","ctx","getCurrentTestContext","event","liveCommand","safeSerializeArray","testRunResult","mapTestRunContextToResult","e","attributes","test","testRunContext","setCurrentTestContext","subject","selector","buildSelector","element","log","win","value","resolve","captureAfterPaint","safeResolve","called","command","err","error","mocha","registerMochaEventListeners","onHook","injectMochaHookFunctions","enableTestmap","registerCypressEventListeners","registerMochaEventListeners","injectMochaHookFunctions","initializeTestmap","enableTestmap"]}
@@ -1,16 +1,12 @@
1
- /// <reference types="cypress" />
2
-
3
- declare let pluginConfig: {
4
- outputUIReportDir: string;
5
- includeHtml: boolean;
6
- compress: boolean;
7
- upload: boolean;
8
- uploadUrl: string;
9
- projectId: string;
10
- apiKey: string;
11
- };
12
-
13
- declare function registerRRWebReportTasks(on: Cypress.PluginEvents, config?: Partial<typeof pluginConfig>): void;
14
- export default registerRRWebReportTasks;
15
-
16
- export { }
1
+ declare let pluginConfig: {
2
+ outputUIReportDir: string;
3
+ includeHtml: boolean;
4
+ compress: boolean;
5
+ upload: boolean;
6
+ uploadUrl: string;
7
+ projectId: string;
8
+ apiKey: string;
9
+ };
10
+ declare function registerRRWebReportTasks(on: Cypress.PluginEvents, config?: Partial<typeof pluginConfig>): void;
11
+
12
+ export { registerRRWebReportTasks as default };
@@ -0,0 +1,2 @@
1
+ "use strict";var I=Object.create;var p=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of b(t))!F.call(e,o)&&o!==r&&p(e,o,{get:()=>t[o],enumerable:!(a=U(t,o))||a.enumerable});return e};var u=(e,t,r)=>(r=e!=null?I(h(e)):{},d(t||!e||!e.__esModule?p(r,"default",{value:e,enumerable:!0}):r,e)),k=e=>d(p({},"__esModule",{value:!0}),e);var D={};$(D,{default:()=>v});module.exports=k(D);var n=u(require("path")),i=u(require("fs")),g=u(require("@appsurify-testmap/rrweb-ui-report")),s={outputUIReportDir:"results/ui",includeHtml:!1,compress:!1,upload:!1,uploadUrl:"",projectId:"",apiKey:""};function f(e){return(e??"").trim().replace(/[\s:/\\<>|"'?*]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function v(e,t){s={...s,...t},e("task",{saveRRWebReport(r){let a=f(r.spec.name),o=f(r.test.suite?.title),m=f(r.test.title),y=`${o?o+"-":""}${m}.json`,l=n.join(s.outputUIReportDir,a,y),j=(0,g.default)({events:r.recorderEvents});i.mkdirSync(s.outputUIReportDir,{recursive:!0}),i.mkdirSync(n.dirname(l),{recursive:!0}),i.writeFileSync(l,JSON.stringify(j,null,2),"utf-8"),console.log(`[ui-coverage] Saved report to ${l}`);let S=`${o?o+"-":""}${m}.raw.json`,c=n.join(s.outputUIReportDir,a,S),w={events:r.recorderEvents,metadata:{spec:r.spec,test:r.test,browser:r.browser}};return i.mkdirSync(s.outputUIReportDir,{recursive:!0}),i.mkdirSync(n.dirname(c),{recursive:!0}),i.writeFileSync(c,JSON.stringify(w,null,2),"utf-8"),console.log(`[ui-coverage] Saved raw report to ${c}`),null}})}
2
+ //# sourceMappingURL=reporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/reporter.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport type { TestRunResult } from './types';\nimport generateReport from '@appsurify-testmap/rrweb-ui-report';\n\n\nlet pluginConfig: {\n outputUIReportDir: string;\n includeHtml: boolean;\n compress: boolean;\n upload: boolean;\n uploadUrl: string;\n projectId: string;\n apiKey: string;\n} = {\n outputUIReportDir: 'results/ui',\n includeHtml: false,\n compress: false,\n upload: false,\n uploadUrl: '',\n projectId: '',\n apiKey: ''\n};\n\nfunction sanitizeFileNamePart(name: string | undefined): string {\n return (name ?? '')\n .trim()\n .replace(/[\\s:/\\\\<>|\"'?*]+/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '');\n}\n\nexport default function registerRRWebReportTasks(on: Cypress.PluginEvents, config?: Partial<typeof pluginConfig>) {\n pluginConfig = { ...pluginConfig, ...config };\n\n on('task', {\n saveRRWebReport(testRunResult: TestRunResult) {\n const specName = sanitizeFileNamePart(testRunResult.spec.name);\n const suiteTitle = sanitizeFileNamePart(testRunResult.test.suite?.title);\n const testTitle = sanitizeFileNamePart(testRunResult.test.title);\n const jsonFileName = `${suiteTitle ? suiteTitle + '-' : ''}${testTitle}.json`;\n const jsonFilePath = path.join(pluginConfig.outputUIReportDir, specName, jsonFileName);\n const report = generateReport({ events: testRunResult.recorderEvents });\n fs.mkdirSync(pluginConfig.outputUIReportDir, { recursive: true });\n fs.mkdirSync(path.dirname(jsonFilePath), { recursive: true });\n fs.writeFileSync(jsonFilePath, JSON.stringify(report, null, 2), 'utf-8');\n console.log(`[ui-coverage] Saved report to ${jsonFilePath}`);\n\n const jsonFileNameRaw = `${suiteTitle ? suiteTitle + '-' : ''}${testTitle}.raw.json`;\n const jsonFilePathRaw = path.join(pluginConfig.outputUIReportDir, specName, jsonFileNameRaw);\n const reportRaw = {\n events: testRunResult.recorderEvents,\n metadata: {\n spec: testRunResult.spec,\n test: testRunResult.test,\n browser: testRunResult.browser,\n }\n };\n fs.mkdirSync(pluginConfig.outputUIReportDir, { recursive: true });\n fs.mkdirSync(path.dirname(jsonFilePathRaw), { recursive: true });\n fs.writeFileSync(jsonFilePathRaw, JSON.stringify(reportRaw, null, 2), 'utf-8');\n console.log(`[ui-coverage] Saved raw report to ${jsonFilePathRaw}`);\n return null;\n }\n });\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAAsB,mBACtBC,EAAoB,iBAEpBC,EAA2B,iDAGvBC,EAQA,CACF,kBAAmB,aACnB,YAAa,GACb,SAAU,GACV,OAAQ,GACR,UAAW,GACX,UAAW,GACX,OAAQ,EACV,EAEA,SAASC,EAAqBC,EAAkC,CAC9D,OAAQA,GAAQ,IACb,KAAK,EACL,QAAQ,oBAAqB,GAAG,EAChC,QAAQ,MAAO,GAAG,EAClB,QAAQ,SAAU,EAAE,CACzB,CAEe,SAARP,EAA0CQ,EAA0BC,EAAuC,CAChHJ,EAAe,CAAE,GAAGA,EAAc,GAAGI,CAAO,EAE5CD,EAAG,OAAQ,CACT,gBAAgBE,EAA8B,CAC5C,IAAMC,EAAWL,EAAqBI,EAAc,KAAK,IAAI,EACvDE,EAAaN,EAAqBI,EAAc,KAAK,OAAO,KAAK,EACjEG,EAAYP,EAAqBI,EAAc,KAAK,KAAK,EACzDI,EAAe,GAAGF,EAAaA,EAAa,IAAM,KAAKC,SACvDE,EAAoB,OAAKV,EAAa,kBAAmBM,EAAUG,CAAY,EAC/EE,KAAS,EAAAC,SAAe,CAAE,OAAQP,EAAc,cAAe,CAAC,EACnE,YAAUL,EAAa,kBAAmB,CAAE,UAAW,EAAK,CAAC,EAC7D,YAAe,UAAQU,CAAY,EAAG,CAAE,UAAW,EAAK,CAAC,EACzD,gBAAcA,EAAc,KAAK,UAAUC,EAAQ,KAAM,CAAC,EAAG,OAAO,EACvE,QAAQ,IAAI,iCAAiCD,GAAc,EAE3D,IAAMG,EAAkB,GAAGN,EAAaA,EAAa,IAAM,KAAKC,aAC1DM,EAAuB,OAAKd,EAAa,kBAAmBM,EAAUO,CAAe,EACrFE,EAAY,CAChB,OAAQV,EAAc,eACtB,SAAU,CACR,KAAMA,EAAc,KACpB,KAAMA,EAAc,KACpB,QAASA,EAAc,OACzB,CACF,EACA,OAAG,YAAUL,EAAa,kBAAmB,CAAE,UAAW,EAAK,CAAC,EAC7D,YAAe,UAAQc,CAAe,EAAG,CAAE,UAAW,EAAK,CAAC,EAC5D,gBAAcA,EAAiB,KAAK,UAAUC,EAAW,KAAM,CAAC,EAAG,OAAO,EAC7E,QAAQ,IAAI,qCAAqCD,GAAiB,EAC3D,IACT,CACF,CAAC,CACH","names":["reporter_exports","__export","registerRRWebReportTasks","__toCommonJS","path","fs","import_rrweb_ui_report","pluginConfig","sanitizeFileNamePart","name","on","config","testRunResult","specName","suiteTitle","testTitle","jsonFileName","jsonFilePath","report","generateReport","jsonFileNameRaw","jsonFilePathRaw","reportRaw"]}
@@ -0,0 +1,2 @@
1
+ import*as o from"path";import*as r from"fs";import v from"@appsurify-testmap/rrweb-ui-report";var t={outputUIReportDir:"results/ui",includeHtml:!1,compress:!1,upload:!1,uploadUrl:"",projectId:"",apiKey:""};function p(s){return(s??"").trim().replace(/[\s:/\\<>|"'?*]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function y(s,u){t={...t,...u},s("task",{saveRRWebReport(e){let l=p(e.spec.name),i=p(e.test.suite?.title),c=p(e.test.title),f=`${i?i+"-":""}${c}.json`,n=o.join(t.outputUIReportDir,l,f),m=v({events:e.recorderEvents});r.mkdirSync(t.outputUIReportDir,{recursive:!0}),r.mkdirSync(o.dirname(n),{recursive:!0}),r.writeFileSync(n,JSON.stringify(m,null,2),"utf-8"),console.log(`[ui-coverage] Saved report to ${n}`);let d=`${i?i+"-":""}${c}.raw.json`,a=o.join(t.outputUIReportDir,l,d),g={events:e.recorderEvents,metadata:{spec:e.spec,test:e.test,browser:e.browser}};return r.mkdirSync(t.outputUIReportDir,{recursive:!0}),r.mkdirSync(o.dirname(a),{recursive:!0}),r.writeFileSync(a,JSON.stringify(g,null,2),"utf-8"),console.log(`[ui-coverage] Saved raw report to ${a}`),null}})}export{y as default};
2
+ //# sourceMappingURL=reporter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/reporter.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport type { TestRunResult } from './types';\nimport generateReport from '@appsurify-testmap/rrweb-ui-report';\n\n\nlet pluginConfig: {\n outputUIReportDir: string;\n includeHtml: boolean;\n compress: boolean;\n upload: boolean;\n uploadUrl: string;\n projectId: string;\n apiKey: string;\n} = {\n outputUIReportDir: 'results/ui',\n includeHtml: false,\n compress: false,\n upload: false,\n uploadUrl: '',\n projectId: '',\n apiKey: ''\n};\n\nfunction sanitizeFileNamePart(name: string | undefined): string {\n return (name ?? '')\n .trim()\n .replace(/[\\s:/\\\\<>|\"'?*]+/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '');\n}\n\nexport default function registerRRWebReportTasks(on: Cypress.PluginEvents, config?: Partial<typeof pluginConfig>) {\n pluginConfig = { ...pluginConfig, ...config };\n\n on('task', {\n saveRRWebReport(testRunResult: TestRunResult) {\n const specName = sanitizeFileNamePart(testRunResult.spec.name);\n const suiteTitle = sanitizeFileNamePart(testRunResult.test.suite?.title);\n const testTitle = sanitizeFileNamePart(testRunResult.test.title);\n const jsonFileName = `${suiteTitle ? suiteTitle + '-' : ''}${testTitle}.json`;\n const jsonFilePath = path.join(pluginConfig.outputUIReportDir, specName, jsonFileName);\n const report = generateReport({ events: testRunResult.recorderEvents });\n fs.mkdirSync(pluginConfig.outputUIReportDir, { recursive: true });\n fs.mkdirSync(path.dirname(jsonFilePath), { recursive: true });\n fs.writeFileSync(jsonFilePath, JSON.stringify(report, null, 2), 'utf-8');\n console.log(`[ui-coverage] Saved report to ${jsonFilePath}`);\n\n const jsonFileNameRaw = `${suiteTitle ? suiteTitle + '-' : ''}${testTitle}.raw.json`;\n const jsonFilePathRaw = path.join(pluginConfig.outputUIReportDir, specName, jsonFileNameRaw);\n const reportRaw = {\n events: testRunResult.recorderEvents,\n metadata: {\n spec: testRunResult.spec,\n test: testRunResult.test,\n browser: testRunResult.browser,\n }\n };\n fs.mkdirSync(pluginConfig.outputUIReportDir, { recursive: true });\n fs.mkdirSync(path.dirname(jsonFilePathRaw), { recursive: true });\n fs.writeFileSync(jsonFilePathRaw, JSON.stringify(reportRaw, null, 2), 'utf-8');\n console.log(`[ui-coverage] Saved raw report to ${jsonFilePathRaw}`);\n return null;\n }\n });\n}\n"],"mappings":"AACA,UAAYA,MAAU,OACtB,UAAYC,MAAQ,KAEpB,OAAOC,MAAoB,qCAG3B,IAAIC,EAQA,CACF,kBAAmB,aACnB,YAAa,GACb,SAAU,GACV,OAAQ,GACR,UAAW,GACX,UAAW,GACX,OAAQ,EACV,EAEA,SAASC,EAAqBC,EAAkC,CAC9D,OAA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ReportTasks","on","config","testRunResult","specName","suiteTitle","testTitle","jsonFileName","jsonFilePath","report","jsonFileNameRaw","jsonFilePathRaw","reportRaw"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsurify-testmap/rrweb-cypress-plugin",
3
- "version": "2.1.1-alpha.6",
3
+ "version": "2.1.1-alpha.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,9 +8,9 @@
8
8
  "rrweb"
9
9
  ],
10
10
  "scripts": {
11
- "dev": "vite build --watch",
12
- "build": "tsc -noEmit && vite build",
13
- "check-types": "tsc -noEmit",
11
+ "predev": "cp /Users/whenessel/Development/WebstormProjects/appsurify-rrweb/packages/record/dist/rrweb-record.umd.cjs /Users/whenessel/Development/WebstormProjects/appsurify-rrweb/packages/rrweb-cypress-plugin/src/recorder/releases/rrweb-record.umd.cjs.src",
12
+ "dev": "tsup --watch",
13
+ "build": "yarn predev && tsup-node",
14
14
  "prepublish": "yarn run build"
15
15
  },
16
16
  "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/utils#readme",
@@ -22,48 +22,37 @@
22
22
  "url": "git+https://github.com/rrweb-io/rrweb.git"
23
23
  },
24
24
  "license": "MIT",
25
- "type": "module",
26
- "main": "./dist/rrweb-cypress-plugin.umd.cjs",
27
- "module": "./dist/rrweb-cypress-plugin.js",
28
- "browser": "./dist/rrweb-cypress-plugin.umd.cjs",
29
- "unpkg": "./dist/rrweb-cypress-plugin.umd.cjs",
30
- "typings": "./dist/rrweb-cypress-plugin.d.ts",
25
+ "main": "./dist/index.js",
26
+ "types": "./src/index.ts",
31
27
  "exports": {
32
28
  ".": {
33
- "types": "./dist/rrweb-cypress-plugin.d.ts",
34
- "import": {
35
- "types": "./dist/rrweb-cypress-plugin.d.ts",
36
- "default": "./dist/rrweb-cypress-plugin.js"
37
- },
38
- "require": {
39
- "types": "./dist/rrweb-cypress-plugin.d.cts",
40
- "default": "./dist/rrweb-cypress-plugin.umd.cjs"
41
- }
29
+ "import": "./dist/index.mjs",
30
+ "require": "./dist/index.js",
31
+ "types": "./dist/index.d.ts"
42
32
  },
43
33
  "./reporter": {
44
- "require": "./dist/rrweb-cypress-plugin-reporter.umd.cjs",
45
- "import": "./dist/rrweb-cypress-plugin-reporter.js",
46
- "types": "./dist/rrweb-cypress-plugin-reporter.d.ts"
34
+ "import": "./dist/reporter.mjs",
35
+ "require": "./dist/reporter.js",
36
+ "types": "./dist/reporter.d.ts"
47
37
  }
48
38
  },
49
39
  "files": [
50
40
  "dist",
51
- "package.json"
41
+ "Readme.md"
52
42
  ],
53
43
  "devDependencies": {
54
44
  "@types/debug": "^4.1.7",
55
45
  "@types/lodash": "^4.17.16",
56
46
  "@types/node": "^22.15.21",
57
47
  "cypress": "^14.3.2",
58
- "typescript": "^5.8.3",
59
- "vite": "^5.2.8",
60
- "vite-plugin-dts": "^3.8.1"
48
+ "tsup": "^6.6.3",
49
+ "typescript": "^5.8.3"
61
50
  },
62
51
  "dependencies": {
63
- "@appsurify-testmap/rrweb": "^2.1.1-alpha.6",
64
- "@appsurify-testmap/rrweb-plugin-sequential-id-record": "^2.1.1-alpha.6",
65
- "@appsurify-testmap/rrweb-snapshot": "^2.1.1-alpha.6",
66
- "@appsurify-testmap/rrweb-types": "^2.1.1-alpha.6",
67
- "@appsurify-testmap/rrweb-ui-report": "^2.1.1-alpha.6"
52
+ "@appsurify-testmap/rrweb": "^2.1.1-alpha.7",
53
+ "@appsurify-testmap/rrweb-plugin-sequential-id-record": "^2.1.1-alpha.7",
54
+ "@appsurify-testmap/rrweb-snapshot": "^2.1.1-alpha.7",
55
+ "@appsurify-testmap/rrweb-types": "^2.1.1-alpha.7",
56
+ "@appsurify-testmap/rrweb-ui-report": "^2.1.1-alpha.7"
68
57
  }
69
58
  }