Add SPA session validation and buglist, update migration docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-03 21:28:08 +00:00
parent 9be3dfc14e
commit cff287e870
24169 changed files with 10223 additions and 7120 deletions

0
node_modules/playwright/lib/worker/fixtureRunner.js generated vendored Normal file → Executable file
View File

45
node_modules/playwright/lib/worker/testInfo.js generated vendored Normal file → Executable file
View File

@@ -43,14 +43,13 @@ var import_testTracing = require("./testTracing");
var import_util2 = require("./util");
var import_transform = require("../transform/transform");
class TestInfoImpl {
constructor(configInternal, projectInternal, workerParams, test, retry, onStepBegin, onStepEnd, onAttach) {
constructor(configInternal, projectInternal, workerParams, test, retry, onStepBegin, onStepEnd, onAttach, onTestPaused) {
this._snapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
this._ariaSnapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
this._wasInterrupted = false;
this._interruptedPromise = new import_utils.ManualPromise();
this._lastStepId = 0;
this._steps = [];
this._stepMap = /* @__PURE__ */ new Map();
this._onDidFinishTestFunctions = [];
this._hasNonRetriableError = false;
this._hasUnhandledError = false;
this._allowSkips = false;
@@ -64,6 +63,7 @@ class TestInfoImpl {
this._onStepBegin = onStepBegin;
this._onStepEnd = onStepEnd;
this._onAttach = onAttach;
this._onTestPaused = onTestPaused;
this._startTime = (0, import_utils.monotonicTime)();
this._startWallTime = Date.now();
this._requireFile = test?._requireFile ?? "";
@@ -107,11 +107,17 @@ class TestInfoImpl {
return import_path.default.join(this.project.snapshotDir, relativeTestFilePath + "-snapshots");
})();
this._attachmentsPush = this.attachments.push.bind(this.attachments);
this.attachments.push = (...attachments) => {
const attachmentsPush = (...attachments) => {
for (const a of attachments)
this._attach(a, this._parentStep()?.stepId);
return this.attachments.length;
};
Object.defineProperty(this.attachments, "push", {
value: attachmentsPush,
writable: true,
enumerable: false,
configurable: true
});
this._tracing = new import_testTracing.TestTracing(this, workerParams.artifactsDir);
this.skip = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("skip", location, args));
this.fixme = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("fixme", location, args));
@@ -262,7 +268,7 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
this._tracing.appendBeforeActionForStep({
stepId,
parentId: parentStep?.stepId,
title: step.title,
title: step.shortTitle ?? step.title,
category: step.category,
params: step.params,
stack: step.location ? [step.location] : [],
@@ -272,7 +278,7 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
return step;
}
_interrupt() {
this._wasInterrupted = true;
this._interruptedPromise.resolve();
this._timeoutManager.interrupt();
if (this.status === "passed")
this.status = "interrupted";
@@ -314,7 +320,7 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
}
});
} catch (error) {
if (!this._wasInterrupted && error instanceof import_timeoutManager.TimeoutManagerError)
if (!this._interruptedPromise.isDone() && error instanceof import_timeoutManager.TimeoutManagerError)
this._failWithError(error);
throw error;
}
@@ -329,6 +335,14 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
_setDebugMode() {
this._timeoutManager.setIgnoreTimeouts();
}
async _didFinishTestFunction() {
const shouldPause = this._workerParams.pauseAtEnd && !this._isFailure() || this._workerParams.pauseOnError && this._isFailure();
if (shouldPause) {
this._onTestPaused({ testId: this.testId, errors: this._isFailure() ? this.errors : [] });
await this._interruptedPromise;
}
await this._onDidFinishTestFunctionCallback?.();
}
// ------------ TestInfo methods ------------
async attach(name, options = {}) {
const step = this._addStep({
@@ -337,14 +351,17 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
});
this._attach(
await (0, import_util.normalizeAndSaveAttachment)(this.outputPath(), name, options),
step.group ? void 0 : step.stepId
step.stepId
);
step.complete({});
}
_attach(attachment, stepId) {
const index = this._attachmentsPush(attachment) - 1;
if (stepId) {
this._stepMap.get(stepId).attachmentIndices.push(index);
let step = stepId ? this._stepMap.get(stepId) : void 0;
if (!!step?.group)
step = void 0;
if (step) {
step.attachmentIndices.push(index);
} else {
const stepId2 = `attach@${(0, import_utils.createGuid)()}`;
this._tracing.appendBeforeActionForStep({ stepId: stepId2, title: `Attach ${(0, import_utils.escapeWithQuotes)(attachment.name, '"')}`, category: "test.attach", stack: [] });
@@ -356,7 +373,7 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
contentType: attachment.contentType,
path: attachment.path,
body: attachment.body?.toString("base64"),
stepId
stepId: step?.stepId
});
}
outputPath(...pathSegments) {
@@ -445,12 +462,6 @@ ${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
setTimeout(timeout) {
this._timeoutManager.setTimeout(timeout);
}
_pauseOnError() {
return this._workerParams.pauseOnError;
}
_pauseAtEnd() {
return this._workerParams.pauseAtEnd;
}
}
class TestStepInfoImpl {
constructor(testInfo, stepId, title, parentStep) {

1
node_modules/playwright/lib/worker/testTracing.js generated vendored Normal file → Executable file
View File

@@ -53,6 +53,7 @@ class TestTracing {
type: "context-options",
origin: "testRunner",
browserName: "",
playwrightVersion: (0, import_utils.getPlaywrightVersion)(),
options: {},
platform: process.platform,
wallTime: Date.now(),

0
node_modules/playwright/lib/worker/timeoutManager.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright/lib/worker/util.js generated vendored Normal file → Executable file
View File

21
node_modules/playwright/lib/worker/workerMain.js generated vendored Normal file → Executable file
View File

@@ -98,6 +98,7 @@ class WorkerMain extends import_process.ProcessRunner {
const fakeTestInfo = new import_testInfo.TestInfoImpl(this._config, this._project, this._params, void 0, 0, () => {
}, () => {
}, () => {
}, () => {
});
const runnable = { type: "teardown" };
await fakeTestInfo._runWithTimeout(runnable, () => this._loadIfNeeded()).catch(() => {
@@ -179,7 +180,7 @@ class WorkerMain extends import_process.ProcessRunner {
let fatalUnknownTestIds;
try {
await this._loadIfNeeded();
const fileSuite = await (0, import_testLoader.loadTestFile)(runPayload.file, this._config.config.rootDir);
const fileSuite = await (0, import_testLoader.loadTestFile)(runPayload.file, this._config);
const suite = (0, import_suiteUtils.bindFileSuiteToProject)(this._project, fileSuite);
if (this._params.repeatEachIndex)
(0, import_suiteUtils.applyRepeatEachIndex)(this._project, suite, this._params.repeatEachIndex);
@@ -222,6 +223,16 @@ class WorkerMain extends import_process.ProcessRunner {
this._runFinished.resolve();
}
}
async customMessage(payload) {
try {
if (this._currentTest?.testId !== payload.testId)
throw new Error("Test has already stopped");
const response = await this._currentTest._onCustomMessageCallback?.(payload.request);
return { response };
} catch (error) {
return { response: {}, error: (0, import_util2.testInfoError)(error) };
}
}
async _runTest(test, retry, nextTest) {
const testInfo = new import_testInfo.TestInfoImpl(
this._config,
@@ -231,7 +242,8 @@ class WorkerMain extends import_process.ProcessRunner {
retry,
(stepBeginPayload) => this.dispatchEvent("stepBegin", stepBeginPayload),
(stepEndPayload) => this.dispatchEvent("stepEnd", stepEndPayload),
(attachment) => this.dispatchEvent("attach", attachment)
(attachment) => this.dispatchEvent("attach", attachment),
(testPausedPayload) => this.dispatchEvent("testPaused", testPausedPayload)
);
const processAnnotation = (annotation) => {
testInfo.annotations.push(annotation);
@@ -318,10 +330,7 @@ class WorkerMain extends import_process.ProcessRunner {
await testInfo._runAsStep({ title: "After Hooks", category: "hook" }, async () => {
let firstAfterHooksError;
try {
await testInfo._runWithTimeout({ type: "test", slot: afterHooksSlot }, async () => {
for (const fn of testInfo._onDidFinishTestFunctions)
await fn();
});
await testInfo._runWithTimeout({ type: "test", slot: afterHooksSlot }, () => testInfo._didFinishTestFunction());
} catch (error) {
firstAfterHooksError = firstAfterHooksError ?? error;
}