Enhance refactor commands with controller-aware Route() updates and fix code quality violations
Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
32
node_modules/playwright/lib/runner/dispatcher.js
generated
vendored
Executable file → Normal file
32
node_modules/playwright/lib/runner/dispatcher.js
generated
vendored
Executable file → Normal file
@@ -158,8 +158,14 @@ class Dispatcher {
|
||||
_createWorker(testGroup, parallelIndex, loaderData) {
|
||||
const projectConfig = this._config.projects.find((p) => p.id === testGroup.projectId);
|
||||
const outputDir = projectConfig.project.outputDir;
|
||||
const recoverFromStepErrors = this._failureTracker.canRecoverFromStepError();
|
||||
const worker = new import_workerHost.WorkerHost(testGroup, parallelIndex, loaderData, recoverFromStepErrors, this._extraEnvByProjectId.get(testGroup.projectId) || {}, outputDir);
|
||||
const worker = new import_workerHost.WorkerHost(testGroup, {
|
||||
parallelIndex,
|
||||
config: loaderData,
|
||||
extraEnv: this._extraEnvByProjectId.get(testGroup.projectId) || {},
|
||||
outputDir,
|
||||
pauseOnError: this._failureTracker.pauseOnError(),
|
||||
pauseAtEnd: this._failureTracker.pauseAtEnd(projectConfig)
|
||||
});
|
||||
const handleOutput = (params) => {
|
||||
const chunk = chunkFromParams(params);
|
||||
if (worker.didFail()) {
|
||||
@@ -312,24 +318,6 @@ class JobDispatcher {
|
||||
steps.delete(params.stepId);
|
||||
this._reporter.onStepEnd?.(test, result, step);
|
||||
}
|
||||
_onStepRecoverFromError(resumeAfterStepError, params) {
|
||||
const data = this._dataByTestId.get(params.testId);
|
||||
if (!data) {
|
||||
resumeAfterStepError({ stepId: params.stepId, status: "failed" });
|
||||
return;
|
||||
}
|
||||
const { steps } = data;
|
||||
const step = steps.get(params.stepId);
|
||||
if (!step) {
|
||||
resumeAfterStepError({ stepId: params.stepId, status: "failed" });
|
||||
return;
|
||||
}
|
||||
const testError = {
|
||||
...params.error,
|
||||
location: step.location
|
||||
};
|
||||
this._failureTracker.recoverFromStepError(params.stepId, testError, resumeAfterStepError);
|
||||
}
|
||||
_onAttach(params) {
|
||||
const data = this._dataByTestId.get(params.testId);
|
||||
if (!data) {
|
||||
@@ -382,7 +370,7 @@ class JobDispatcher {
|
||||
}
|
||||
}
|
||||
_onDone(params) {
|
||||
if (!this._remainingByTestId.size && !this._failedTests.size && !params.fatalErrors.length && !params.skipTestsDueToSetupFailure.length && !params.fatalUnknownTestIds && !params.unexpectedExitError) {
|
||||
if (!this._remainingByTestId.size && !this._failedTests.size && !params.fatalErrors.length && !params.skipTestsDueToSetupFailure.length && !params.fatalUnknownTestIds && !params.unexpectedExitError && !params.stoppedDueToUnhandledErrorInTestFail) {
|
||||
this._finished({ didFail: false });
|
||||
return;
|
||||
}
|
||||
@@ -455,13 +443,11 @@ class JobDispatcher {
|
||||
})
|
||||
};
|
||||
worker.runTestGroup(runPayload);
|
||||
const resumeAfterStepError = worker.resumeAfterStepError.bind(worker);
|
||||
this._listeners = [
|
||||
import_utils.eventsHelper.addEventListener(worker, "testBegin", this._onTestBegin.bind(this)),
|
||||
import_utils.eventsHelper.addEventListener(worker, "testEnd", this._onTestEnd.bind(this)),
|
||||
import_utils.eventsHelper.addEventListener(worker, "stepBegin", this._onStepBegin.bind(this)),
|
||||
import_utils.eventsHelper.addEventListener(worker, "stepEnd", this._onStepEnd.bind(this)),
|
||||
import_utils.eventsHelper.addEventListener(worker, "stepRecoverFromError", this._onStepRecoverFromError.bind(this, resumeAfterStepError)),
|
||||
import_utils.eventsHelper.addEventListener(worker, "attach", this._onAttach.bind(this)),
|
||||
import_utils.eventsHelper.addEventListener(worker, "done", this._onDone.bind(this)),
|
||||
import_utils.eventsHelper.addEventListener(worker, "exit", this.onExit.bind(this))
|
||||
|
||||
28
node_modules/playwright/lib/runner/failureTracker.js
generated
vendored
Executable file → Normal file
28
node_modules/playwright/lib/runner/failureTracker.js
generated
vendored
Executable file → Normal file
@@ -22,35 +22,31 @@ __export(failureTracker_exports, {
|
||||
});
|
||||
module.exports = __toCommonJS(failureTracker_exports);
|
||||
class FailureTracker {
|
||||
constructor(_config) {
|
||||
constructor(_config, options) {
|
||||
this._config = _config;
|
||||
this._failureCount = 0;
|
||||
this._hasWorkerErrors = false;
|
||||
this._topLevelProjects = [];
|
||||
this._pauseOnError = options?.pauseOnError ?? false;
|
||||
this._pauseAtEnd = options?.pauseAtEnd ?? false;
|
||||
}
|
||||
canRecoverFromStepError() {
|
||||
return !!this._recoverFromStepErrorHandler;
|
||||
}
|
||||
setRecoverFromStepErrorHandler(recoverFromStepErrorHandler) {
|
||||
this._recoverFromStepErrorHandler = recoverFromStepErrorHandler;
|
||||
}
|
||||
onRootSuite(rootSuite) {
|
||||
onRootSuite(rootSuite, topLevelProjects) {
|
||||
this._rootSuite = rootSuite;
|
||||
this._topLevelProjects = topLevelProjects;
|
||||
}
|
||||
onTestEnd(test, result) {
|
||||
if (test.outcome() === "unexpected" && test.results.length > test.retries)
|
||||
++this._failureCount;
|
||||
}
|
||||
recoverFromStepError(stepId, error, resumeAfterStepError) {
|
||||
if (!this._recoverFromStepErrorHandler) {
|
||||
resumeAfterStepError({ stepId, status: "failed" });
|
||||
return;
|
||||
}
|
||||
void this._recoverFromStepErrorHandler(stepId, error).then(resumeAfterStepError).catch(() => {
|
||||
});
|
||||
}
|
||||
onWorkerError() {
|
||||
this._hasWorkerErrors = true;
|
||||
}
|
||||
pauseOnError() {
|
||||
return this._pauseOnError;
|
||||
}
|
||||
pauseAtEnd(inProject) {
|
||||
return this._pauseAtEnd && this._topLevelProjects.includes(inProject);
|
||||
}
|
||||
hasReachedMaxFailures() {
|
||||
return this.maxFailures() > 0 && this._failureCount >= this.maxFailures();
|
||||
}
|
||||
|
||||
0
node_modules/playwright/lib/runner/lastRun.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/lastRun.js
generated
vendored
Executable file → Normal file
42
node_modules/playwright/lib/runner/loadUtils.js
generated
vendored
Executable file → Normal file
42
node_modules/playwright/lib/runner/loadUtils.js
generated
vendored
Executable file → Normal file
@@ -32,10 +32,13 @@ __export(loadUtils_exports, {
|
||||
createRootSuite: () => createRootSuite,
|
||||
loadFileSuites: () => loadFileSuites,
|
||||
loadGlobalHook: () => loadGlobalHook,
|
||||
loadReporter: () => loadReporter
|
||||
loadReporter: () => loadReporter,
|
||||
loadTestList: () => loadTestList
|
||||
});
|
||||
module.exports = __toCommonJS(loadUtils_exports);
|
||||
var import_path = __toESM(require("path"));
|
||||
var import_fs = __toESM(require("fs"));
|
||||
var import_utils = require("playwright-core/lib/utils");
|
||||
var import_loaderHost = require("./loaderHost");
|
||||
var import_util = require("../util");
|
||||
var import_projectUtils = require("./projectUtils");
|
||||
@@ -168,14 +171,17 @@ async function createRootSuite(testRun, errors, shouldFilterOnly) {
|
||||
}
|
||||
if (config.postShardTestFilters.length)
|
||||
(0, import_suiteUtils.filterTestsRemoveEmptySuites)(rootSuite, (test) => config.postShardTestFilters.every((filter) => filter(test)));
|
||||
const topLevelProjects = [];
|
||||
{
|
||||
const projectClosure2 = new Map((0, import_projectUtils.buildProjectsClosure)(rootSuite.suites.map((suite) => suite._fullProject)));
|
||||
for (const [project, level] of projectClosure2.entries()) {
|
||||
if (level === "dependency")
|
||||
rootSuite._prependSuite(buildProjectSuite(project, projectSuites.get(project)));
|
||||
else
|
||||
topLevelProjects.push(project);
|
||||
}
|
||||
}
|
||||
return rootSuite;
|
||||
return { rootSuite, topLevelProjects };
|
||||
}
|
||||
function createProjectSuite(project, fileSuites) {
|
||||
const projectSuite = new import_test.Suite(project.project.name, "project");
|
||||
@@ -287,11 +293,41 @@ function sourceMapSources(file, cache) {
|
||||
return sources;
|
||||
}
|
||||
}
|
||||
async function loadTestList(config, filePath) {
|
||||
try {
|
||||
const content = await import_fs.default.promises.readFile(filePath, "utf-8");
|
||||
const lines = content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
||||
const descriptions = lines.map((line) => {
|
||||
const delimiter = line.includes("\u203A") ? "\u203A" : ">";
|
||||
const tokens = line.split(delimiter).map((token) => token.trim());
|
||||
let project;
|
||||
if (tokens[0].startsWith("[")) {
|
||||
if (!tokens[0].endsWith("]"))
|
||||
throw new Error(`Malformed test description: ${line}`);
|
||||
project = tokens[0].substring(1, tokens[0].length - 1);
|
||||
tokens.shift();
|
||||
}
|
||||
return { project, file: (0, import_utils.toPosixPath)((0, import_util.parseLocationArg)(tokens[0]).file), titlePath: tokens.slice(1) };
|
||||
});
|
||||
return (test) => descriptions.some((d) => {
|
||||
const [projectName, , ...titles] = test.titlePath();
|
||||
if (d.project !== void 0 && d.project !== projectName)
|
||||
return false;
|
||||
const relativeFile = (0, import_utils.toPosixPath)(import_path.default.relative(config.config.rootDir, test.location.file));
|
||||
if (relativeFile !== d.file)
|
||||
return false;
|
||||
return d.titlePath.length === titles.length && d.titlePath.every((_, index) => titles[index] === d.titlePath[index]);
|
||||
});
|
||||
} catch (e) {
|
||||
throw (0, import_util.errorWithFile)(filePath, "Cannot read test list file: " + e.message);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
collectProjectsAndTestFiles,
|
||||
createRootSuite,
|
||||
loadFileSuites,
|
||||
loadGlobalHook,
|
||||
loadReporter
|
||||
loadReporter,
|
||||
loadTestList
|
||||
});
|
||||
|
||||
0
node_modules/playwright/lib/runner/loaderHost.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/loaderHost.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/processHost.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/processHost.js
generated
vendored
Executable file → Normal file
10
node_modules/playwright/lib/runner/projectUtils.js
generated
vendored
Executable file → Normal file
10
node_modules/playwright/lib/runner/projectUtils.js
generated
vendored
Executable file → Normal file
@@ -32,7 +32,8 @@ __export(projectUtils_exports, {
|
||||
buildProjectsClosure: () => buildProjectsClosure,
|
||||
buildTeardownToSetupsMap: () => buildTeardownToSetupsMap,
|
||||
collectFilesForProject: () => collectFilesForProject,
|
||||
filterProjects: () => filterProjects
|
||||
filterProjects: () => filterProjects,
|
||||
findTopLevelProjects: () => findTopLevelProjects
|
||||
});
|
||||
module.exports = __toCommonJS(projectUtils_exports);
|
||||
var import_fs = __toESM(require("fs"));
|
||||
@@ -116,6 +117,10 @@ function buildProjectsClosure(projects, hasTests) {
|
||||
visit(0, p);
|
||||
return result;
|
||||
}
|
||||
function findTopLevelProjects(config) {
|
||||
const closure = buildProjectsClosure(config.projects);
|
||||
return [...closure].filter((entry) => entry[1] === "top-level").map((entry) => entry[0]);
|
||||
}
|
||||
function buildDependentProjects(forProjects, projects) {
|
||||
const reverseDeps = new Map(projects.map((p) => [p, []]));
|
||||
for (const project of projects) {
|
||||
@@ -231,5 +236,6 @@ async function collectFiles(testDir, respectGitIgnore) {
|
||||
buildProjectsClosure,
|
||||
buildTeardownToSetupsMap,
|
||||
collectFilesForProject,
|
||||
filterProjects
|
||||
filterProjects,
|
||||
findTopLevelProjects
|
||||
});
|
||||
|
||||
0
node_modules/playwright/lib/runner/rebase.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/rebase.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/reporters.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/reporters.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/sigIntWatcher.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/sigIntWatcher.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/taskRunner.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/taskRunner.js
generated
vendored
Executable file → Normal file
25
node_modules/playwright/lib/runner/tasks.js
generated
vendored
Executable file → Normal file
25
node_modules/playwright/lib/runner/tasks.js
generated
vendored
Executable file → Normal file
@@ -60,14 +60,15 @@ var import_compilationCache = require("../transform/compilationCache");
|
||||
var import_util2 = require("../util");
|
||||
const readDirAsync = (0, import_util.promisify)(import_fs.default.readdir);
|
||||
class TestRun {
|
||||
constructor(config, reporter) {
|
||||
constructor(config, reporter, options) {
|
||||
this.rootSuite = void 0;
|
||||
this.phases = [];
|
||||
this.projectFiles = /* @__PURE__ */ new Map();
|
||||
this.projectSuites = /* @__PURE__ */ new Map();
|
||||
this.topLevelProjects = [];
|
||||
this.config = config;
|
||||
this.reporter = reporter;
|
||||
this.failureTracker = new import_failureTracker.FailureTracker(config);
|
||||
this.failureTracker = new import_failureTracker.FailureTracker(config, options);
|
||||
}
|
||||
}
|
||||
async function runTasks(testRun, tasks, globalTimeout, cancelPromise) {
|
||||
@@ -214,8 +215,9 @@ function createListFilesTask() {
|
||||
return {
|
||||
title: "load tests",
|
||||
setup: async (testRun, errors) => {
|
||||
testRun.rootSuite = await (0, import_loadUtils.createRootSuite)(testRun, errors, false);
|
||||
testRun.failureTracker.onRootSuite(testRun.rootSuite);
|
||||
const { rootSuite, topLevelProjects } = await (0, import_loadUtils.createRootSuite)(testRun, errors, false);
|
||||
testRun.rootSuite = rootSuite;
|
||||
testRun.failureTracker.onRootSuite(rootSuite, topLevelProjects);
|
||||
await (0, import_loadUtils.collectProjectsAndTestFiles)(testRun, false);
|
||||
for (const [project, files] of testRun.projectFiles) {
|
||||
const projectSuite = new import_test.Suite(project.project.name, "project");
|
||||
@@ -247,9 +249,18 @@ function createLoadTask(mode, options) {
|
||||
const changedFiles = await (0, import_vcs.detectChangedTestFiles)(testRun.config.cliOnlyChanged, testRun.config.configDir);
|
||||
testRun.config.preOnlyTestFilters.push((test) => changedFiles.has(test.location.file));
|
||||
}
|
||||
testRun.rootSuite = await (0, import_loadUtils.createRootSuite)(testRun, options.failOnLoadErrors ? errors : softErrors, !!options.filterOnly);
|
||||
testRun.failureTracker.onRootSuite(testRun.rootSuite);
|
||||
if (options.failOnLoadErrors && !testRun.rootSuite.allTests().length && !testRun.config.cliPassWithNoTests && !testRun.config.config.shard && !testRun.config.cliOnlyChanged) {
|
||||
if (testRun.config.cliTestList) {
|
||||
const testListFilter = await (0, import_loadUtils.loadTestList)(testRun.config, testRun.config.cliTestList);
|
||||
testRun.config.preOnlyTestFilters.push(testListFilter);
|
||||
}
|
||||
if (testRun.config.cliTestListInvert) {
|
||||
const testListInvertFilter = await (0, import_loadUtils.loadTestList)(testRun.config, testRun.config.cliTestListInvert);
|
||||
testRun.config.preOnlyTestFilters.push((test) => !testListInvertFilter(test));
|
||||
}
|
||||
const { rootSuite, topLevelProjects } = await (0, import_loadUtils.createRootSuite)(testRun, options.failOnLoadErrors ? errors : softErrors, !!options.filterOnly);
|
||||
testRun.rootSuite = rootSuite;
|
||||
testRun.failureTracker.onRootSuite(rootSuite, topLevelProjects);
|
||||
if (options.failOnLoadErrors && !testRun.rootSuite.allTests().length && !testRun.config.cliPassWithNoTests && !testRun.config.config.shard && !testRun.config.cliOnlyChanged && !testRun.config.cliTestList && !testRun.config.cliTestListInvert) {
|
||||
if (testRun.config.cliArgs.length) {
|
||||
throw new Error([
|
||||
`No tests found.`,
|
||||
|
||||
0
node_modules/playwright/lib/runner/testGroups.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/testGroups.js
generated
vendored
Executable file → Normal file
44
node_modules/playwright/lib/runner/testRunner.js
generated
vendored
Executable file → Normal file
44
node_modules/playwright/lib/runner/testRunner.js
generated
vendored
Executable file → Normal file
@@ -51,8 +51,7 @@ var import_reporters = require("./reporters");
|
||||
var import_tasks = require("./tasks");
|
||||
var import_lastRun = require("./lastRun");
|
||||
const TestRunnerEvent = {
|
||||
TestFilesChanged: "testFilesChanged",
|
||||
RecoverFromStepError: "recoverFromStepError"
|
||||
TestFilesChanged: "testFilesChanged"
|
||||
};
|
||||
class TestRunner extends import_events.default {
|
||||
constructor(configLocation, configCLIOverrides) {
|
||||
@@ -63,8 +62,6 @@ class TestRunner extends import_events.default {
|
||||
this._queue = Promise.resolve();
|
||||
this._watchTestDirs = false;
|
||||
this._populateDependenciesOnList = false;
|
||||
this._recoverFromStepErrors = false;
|
||||
this._resumeAfterStepErrors = /* @__PURE__ */ new Map();
|
||||
this.configLocation = configLocation;
|
||||
this._configCLIOverrides = configCLIOverrides;
|
||||
this._watcher = new import_fsWatcher.Watcher((events) => {
|
||||
@@ -74,9 +71,9 @@ class TestRunner extends import_events.default {
|
||||
});
|
||||
}
|
||||
async initialize(params) {
|
||||
(0, import_utils.setPlaywrightTestProcessEnv)();
|
||||
this._watchTestDirs = !!params.watchTestDirs;
|
||||
this._populateDependenciesOnList = !!params.populateDependenciesOnList;
|
||||
this._recoverFromStepErrors = !!params.recoverFromStepErrors;
|
||||
}
|
||||
resizeTerminal(params) {
|
||||
process.stdout.columns = params.cols;
|
||||
@@ -98,6 +95,12 @@ class TestRunner extends import_events.default {
|
||||
const executables = import_server.registry.defaultExecutables();
|
||||
await import_server.registry.install(executables, false);
|
||||
}
|
||||
async loadConfig() {
|
||||
const { config, error } = await this._loadConfig(this._configCLIOverrides);
|
||||
if (config)
|
||||
return config;
|
||||
throw new Error("Failed to load config: " + (error ? error.message : "Unknown error"));
|
||||
}
|
||||
async runGlobalSetup(userReporters) {
|
||||
await this.runGlobalTeardown();
|
||||
const reporter = new import_internalReporter.InternalReporter(userReporters);
|
||||
@@ -232,6 +235,7 @@ class TestRunner extends import_events.default {
|
||||
...this._configCLIOverrides,
|
||||
repeatEach: 1,
|
||||
retries: 0,
|
||||
timeout: params.timeout,
|
||||
preserveOutputDir: true,
|
||||
reporter: params.reporters ? params.reporters.map((r) => [r]) : void 0,
|
||||
use: {
|
||||
@@ -265,16 +269,15 @@ class TestRunner extends import_events.default {
|
||||
const testIdSet = new Set(params.testIds);
|
||||
config.preOnlyTestFilters.push((test) => testIdSet.has(test.id));
|
||||
}
|
||||
const configReporters = await (0, import_reporters.createReporters)(config, "test", true);
|
||||
const configReporters = params.disableConfigReporters ? [] : await (0, import_reporters.createReporters)(config, "test", true);
|
||||
const reporter = new import_internalReporter.InternalReporter([...configReporters, userReporter]);
|
||||
const stop = new import_utils.ManualPromise();
|
||||
const tasks = [
|
||||
(0, import_tasks.createApplyRebaselinesTask)(),
|
||||
(0, import_tasks.createLoadTask)("out-of-process", { filterOnly: true, failOnLoadErrors: false, doNotRunDepsOutsideProjectFilter: true }),
|
||||
(0, import_tasks.createLoadTask)("out-of-process", { filterOnly: true, failOnLoadErrors: !!params.failOnLoadErrors, doNotRunDepsOutsideProjectFilter: params.doNotRunDepsOutsideProjectFilter }),
|
||||
...(0, import_tasks.createRunTestsTasks)(config)
|
||||
];
|
||||
const testRun = new import_tasks.TestRun(config, reporter);
|
||||
testRun.failureTracker.setRecoverFromStepErrorHandler(this._recoverFromStepError.bind(this));
|
||||
const testRun = new import_tasks.TestRun(config, reporter, { pauseOnError: params.pauseOnError, pauseAtEnd: params.pauseAtEnd });
|
||||
const run = (0, import_tasks.runTasks)(testRun, tasks, 0, stop).then(async (status) => {
|
||||
this._testRun = void 0;
|
||||
return status;
|
||||
@@ -282,24 +285,6 @@ class TestRunner extends import_events.default {
|
||||
this._testRun = { run, stop };
|
||||
return { status: await run };
|
||||
}
|
||||
async _recoverFromStepError(stepId, error) {
|
||||
if (!this._recoverFromStepErrors)
|
||||
return { stepId, status: "failed" };
|
||||
const recoveryPromise = new import_utils.ManualPromise();
|
||||
this._resumeAfterStepErrors.set(stepId, recoveryPromise);
|
||||
if (!error?.message || !error?.location)
|
||||
return { stepId, status: "failed" };
|
||||
this.emit(TestRunnerEvent.RecoverFromStepError, stepId, error.message, error.location);
|
||||
const recoveredResult = await recoveryPromise;
|
||||
if (recoveredResult.stepId !== stepId)
|
||||
return { stepId, status: "failed" };
|
||||
return recoveredResult;
|
||||
}
|
||||
async resumeAfterStepError(params) {
|
||||
const recoveryPromise = this._resumeAfterStepErrors.get(params.stepId);
|
||||
if (recoveryPromise)
|
||||
recoveryPromise.resolve(params);
|
||||
}
|
||||
async watch(fileNames) {
|
||||
this._watchedTestDependencies = /* @__PURE__ */ new Set();
|
||||
for (const fileName of fileNames) {
|
||||
@@ -325,11 +310,13 @@ class TestRunner extends import_events.default {
|
||||
async stopTests() {
|
||||
this._testRun?.stop?.resolve();
|
||||
await this._testRun?.run;
|
||||
this._resumeAfterStepErrors.clear();
|
||||
}
|
||||
async closeGracefully() {
|
||||
(0, import_utils.gracefullyProcessExitDoNotHang)(0);
|
||||
}
|
||||
async stop() {
|
||||
await this.runGlobalTeardown();
|
||||
}
|
||||
async _loadConfig(overrides) {
|
||||
try {
|
||||
const config = await (0, import_configLoader.loadConfig)(this.configLocation, overrides);
|
||||
@@ -372,6 +359,7 @@ async function resolveCtDirs(config) {
|
||||
};
|
||||
}
|
||||
async function runAllTestsWithConfig(config) {
|
||||
(0, import_utils.setPlaywrightTestProcessEnv)();
|
||||
const listOnly = config.cliListOnly;
|
||||
(0, import_gitCommitInfoPlugin.addGitCommitInfoPlugin)(config);
|
||||
(0, import_webServerPlugin.webServerPluginsForConfig)(config).forEach((p) => config.plugins.push({ factory: p }));
|
||||
|
||||
40
node_modules/playwright/lib/runner/testServer.js
generated
vendored
Executable file → Normal file
40
node_modules/playwright/lib/runner/testServer.js
generated
vendored
Executable file → Normal file
@@ -28,7 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var testServer_exports = {};
|
||||
__export(testServer_exports, {
|
||||
TestRunnerEvent: () => TestRunnerEvent,
|
||||
TestServerDispatcher: () => TestServerDispatcher,
|
||||
runTestServer: () => runTestServer,
|
||||
runUIMode: () => runUIMode
|
||||
@@ -56,14 +55,9 @@ class TestServer {
|
||||
return await (0, import_server.startTraceViewerServer)({ ...options, transport: this._dispatcher.transport });
|
||||
}
|
||||
async stop() {
|
||||
await this._dispatcher?._setInterceptStdio(false);
|
||||
await this._dispatcher?.runGlobalTeardown();
|
||||
await this._dispatcher?.stop();
|
||||
}
|
||||
}
|
||||
const TestRunnerEvent = {
|
||||
TestFilesChanged: "testFilesChanged",
|
||||
RecoverFromStepError: "recoverFromStepError"
|
||||
};
|
||||
class TestServerDispatcher {
|
||||
constructor(configLocation, configCLIOverrides) {
|
||||
this._serializer = require.resolve("./uiModeReporter");
|
||||
@@ -79,8 +73,7 @@ class TestServerDispatcher {
|
||||
}
|
||||
};
|
||||
this._dispatchEvent = (method, params) => this.transport.sendEvent?.(method, params);
|
||||
this._testRunner.on(TestRunnerEvent.TestFilesChanged, (testFiles) => this._dispatchEvent("testFilesChanged", { testFiles }));
|
||||
this._testRunner.on(TestRunnerEvent.RecoverFromStepError, (stepId, message, location) => this._dispatchEvent("recoverFromStepError", { stepId, message, location }));
|
||||
this._testRunner.on(import_testRunner.TestRunnerEvent.TestFilesChanged, (testFiles) => this._dispatchEvent("testFilesChanged", { testFiles }));
|
||||
}
|
||||
async _wireReporter(messageSink) {
|
||||
return await (0, import_reporters.createReporterForTestServer)(this._serializer, messageSink);
|
||||
@@ -95,12 +88,10 @@ class TestServerDispatcher {
|
||||
async initialize(params) {
|
||||
this._serializer = params.serializer || require.resolve("./uiModeReporter");
|
||||
this._closeOnDisconnect = !!params.closeOnDisconnect;
|
||||
await this._setInterceptStdio(!!params.interceptStdio);
|
||||
await this._testRunner.initialize({
|
||||
watchTestDirs: !!params.watchTestDirs,
|
||||
populateDependenciesOnList: !!params.populateDependenciesOnList,
|
||||
recoverFromStepErrors: !!params.recoverFromStepErrors
|
||||
...params
|
||||
});
|
||||
this._setInterceptStdio(!!params.interceptStdio);
|
||||
}
|
||||
async ping() {
|
||||
}
|
||||
@@ -158,12 +149,12 @@ class TestServerDispatcher {
|
||||
}
|
||||
async runTests(params) {
|
||||
const wireReporter = await this._wireReporter((e) => this._dispatchEvent("report", e));
|
||||
const { status } = await this._testRunner.runTests(wireReporter, params);
|
||||
const { status } = await this._testRunner.runTests(wireReporter, {
|
||||
...params,
|
||||
doNotRunDepsOutsideProjectFilter: true
|
||||
});
|
||||
return { status };
|
||||
}
|
||||
async resumeAfterStepError(params) {
|
||||
await this._testRunner.resumeAfterStepError(params);
|
||||
}
|
||||
async watch(params) {
|
||||
await this._testRunner.watch(params.fileNames);
|
||||
}
|
||||
@@ -173,10 +164,17 @@ class TestServerDispatcher {
|
||||
async stopTests() {
|
||||
await this._testRunner.stopTests();
|
||||
}
|
||||
async _setInterceptStdio(intercept) {
|
||||
async stop() {
|
||||
this._setInterceptStdio(false);
|
||||
await this._testRunner.stop();
|
||||
}
|
||||
async closeGracefully() {
|
||||
await this._testRunner.closeGracefully();
|
||||
}
|
||||
_setInterceptStdio(interceptStdio) {
|
||||
if (process.env.PWTEST_DEBUG)
|
||||
return;
|
||||
if (intercept) {
|
||||
if (interceptStdio) {
|
||||
if (import_utilsBundle.debug.log === originalDebugLog) {
|
||||
import_utilsBundle.debug.log = (...args) => {
|
||||
const string = import_util.default.format(...args) + "\n";
|
||||
@@ -199,9 +197,6 @@ class TestServerDispatcher {
|
||||
process.stderr.write = originalStderrWrite;
|
||||
}
|
||||
}
|
||||
async closeGracefully() {
|
||||
await this._testRunner.closeGracefully();
|
||||
}
|
||||
}
|
||||
async function runUIMode(configFile, configCLIOverrides, options) {
|
||||
const configLocation = (0, import_configLoader.resolveConfigLocation)(configFile);
|
||||
@@ -263,7 +258,6 @@ function chunkToPayload(type, chunk) {
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
TestRunnerEvent,
|
||||
TestServerDispatcher,
|
||||
runTestServer,
|
||||
runUIMode
|
||||
|
||||
0
node_modules/playwright/lib/runner/uiModeReporter.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/uiModeReporter.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/vcs.js
generated
vendored
Executable file → Normal file
0
node_modules/playwright/lib/runner/vcs.js
generated
vendored
Executable file → Normal file
54
node_modules/playwright/lib/runner/watchMode.js
generated
vendored
Executable file → Normal file
54
node_modules/playwright/lib/runner/watchMode.js
generated
vendored
Executable file → Normal file
@@ -31,7 +31,6 @@ __export(watchMode_exports, {
|
||||
runWatchModeLoop: () => runWatchModeLoop
|
||||
});
|
||||
module.exports = __toCommonJS(watchMode_exports);
|
||||
var import_fs = __toESM(require("fs"));
|
||||
var import_path = __toESM(require("path"));
|
||||
var import_readline = __toESM(require("readline"));
|
||||
var import_stream = require("stream");
|
||||
@@ -43,8 +42,6 @@ var import_utilsBundle = require("../utilsBundle");
|
||||
var import_testServer = require("./testServer");
|
||||
var import_teleSuiteUpdater = require("../isomorphic/teleSuiteUpdater");
|
||||
var import_testServerConnection = require("../isomorphic/testServerConnection");
|
||||
var import_util = require("../util");
|
||||
var import_babelBundle = require("../transform/babelBundle");
|
||||
class InMemoryTransport extends import_stream.EventEmitter {
|
||||
constructor(send) {
|
||||
super();
|
||||
@@ -116,36 +113,10 @@ async function runWatchModeLoop(configLocation, initialOptions) {
|
||||
});
|
||||
});
|
||||
testServerConnection.onReport((report2) => teleSuiteUpdater.processTestReportEvent(report2));
|
||||
testServerConnection.onRecoverFromStepError(({ stepId, message, location }) => {
|
||||
process.stdout.write(`
|
||||
Test error occurred.
|
||||
`);
|
||||
process.stdout.write("\n" + createErrorCodeframe(message, location) + "\n");
|
||||
process.stdout.write(`
|
||||
${import_utils2.colors.dim("Try recovering from the error. Press")} ${import_utils2.colors.bold("c")} ${import_utils2.colors.dim("to continue or")} ${import_utils2.colors.bold("t")} ${import_utils2.colors.dim("to throw the error")}
|
||||
`);
|
||||
readKeyPress((text) => {
|
||||
if (text === "c") {
|
||||
process.stdout.write(`
|
||||
${import_utils2.colors.dim("Continuing after recovery...")}
|
||||
`);
|
||||
testServerConnection.resumeAfterStepError({ stepId, status: "recovered", value: void 0 }).catch(() => {
|
||||
});
|
||||
} else if (text === "t") {
|
||||
process.stdout.write(`
|
||||
${import_utils2.colors.dim("Throwing error...")}
|
||||
`);
|
||||
testServerConnection.resumeAfterStepError({ stepId, status: "failed" }).catch(() => {
|
||||
});
|
||||
}
|
||||
return text;
|
||||
});
|
||||
});
|
||||
await testServerConnection.initialize({
|
||||
interceptStdio: false,
|
||||
watchTestDirs: true,
|
||||
populateDependenciesOnList: true,
|
||||
recoverFromStepErrors: !process.env.PWTEST_RECOVERY_DISABLED
|
||||
populateDependenciesOnList: true
|
||||
});
|
||||
await testServerConnection.runGlobalSetup({});
|
||||
const { report } = await testServerConnection.listTests({});
|
||||
@@ -418,29 +389,6 @@ async function toggleShowBrowser() {
|
||||
`);
|
||||
}
|
||||
}
|
||||
function createErrorCodeframe(message, location) {
|
||||
let source;
|
||||
try {
|
||||
source = import_fs.default.readFileSync(location.file, "utf-8") + "\n//";
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
return (0, import_babelBundle.codeFrameColumns)(
|
||||
source,
|
||||
{
|
||||
start: {
|
||||
line: location.line,
|
||||
column: location.column
|
||||
}
|
||||
},
|
||||
{
|
||||
highlightCode: true,
|
||||
linesAbove: 5,
|
||||
linesBelow: 5,
|
||||
message: (0, import_util.stripAnsiEscapes)(message).split("\n")[0] || void 0
|
||||
}
|
||||
);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
runWatchModeLoop
|
||||
|
||||
18
node_modules/playwright/lib/runner/workerHost.js
generated
vendored
Executable file → Normal file
18
node_modules/playwright/lib/runner/workerHost.js
generated
vendored
Executable file → Normal file
@@ -39,25 +39,26 @@ var import_ipc = require("../common/ipc");
|
||||
var import_folders = require("../isomorphic/folders");
|
||||
let lastWorkerIndex = 0;
|
||||
class WorkerHost extends import_processHost.ProcessHost {
|
||||
constructor(testGroup, parallelIndex, config, recoverFromStepErrors, extraEnv, outputDir) {
|
||||
constructor(testGroup, options) {
|
||||
const workerIndex = lastWorkerIndex++;
|
||||
super(require.resolve("../worker/workerMain.js"), `worker-${workerIndex}`, {
|
||||
...extraEnv,
|
||||
...options.extraEnv,
|
||||
FORCE_COLOR: "1",
|
||||
DEBUG_COLORS: process.env.DEBUG_COLORS === void 0 ? "1" : process.env.DEBUG_COLORS
|
||||
});
|
||||
this._didFail = false;
|
||||
this.workerIndex = workerIndex;
|
||||
this.parallelIndex = parallelIndex;
|
||||
this.parallelIndex = options.parallelIndex;
|
||||
this._hash = testGroup.workerHash;
|
||||
this._params = {
|
||||
workerIndex: this.workerIndex,
|
||||
parallelIndex,
|
||||
parallelIndex: options.parallelIndex,
|
||||
repeatEachIndex: testGroup.repeatEachIndex,
|
||||
projectId: testGroup.projectId,
|
||||
config,
|
||||
artifactsDir: import_path.default.join(outputDir, (0, import_folders.artifactsFolderName)(workerIndex)),
|
||||
recoverFromStepErrors
|
||||
config: options.config,
|
||||
artifactsDir: import_path.default.join(options.outputDir, (0, import_folders.artifactsFolderName)(workerIndex)),
|
||||
pauseOnError: options.pauseOnError,
|
||||
pauseAtEnd: options.pauseAtEnd
|
||||
};
|
||||
}
|
||||
async start() {
|
||||
@@ -78,9 +79,6 @@ class WorkerHost extends import_processHost.ProcessHost {
|
||||
runTestGroup(runPayload) {
|
||||
this.sendMessageNoReply({ method: "runTestGroup", params: runPayload });
|
||||
}
|
||||
resumeAfterStepError(result) {
|
||||
this.sendMessageNoReply({ method: "resumeAfterStepError", params: result });
|
||||
}
|
||||
hash() {
|
||||
return this._hash;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user