@smoothdeploy/playwright 1.60.1 → 1.62.0
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/agents/copilot-setup-steps.yml +2 -2
- package/lib/agents/generateAgents.js +48 -0
- package/lib/cli/reportActions.js +2 -2
- package/lib/cli/testActions.js +2 -0
- package/lib/common/index.js +246 -187
- package/lib/common/index.js.txt +13 -14
- package/lib/errorContext.js +2 -3
- package/lib/index.js +48 -21
- package/lib/loader/loaderProcessEntry.js +1 -1
- package/lib/matchers/expect.js +4830 -4394
- package/lib/matchers/expect.js.LICENSE +87 -140
- package/lib/matchers/expect.js.txt +30 -35
- package/lib/mcp/test/testContext.js +5 -1
- package/lib/program.js +28 -3
- package/lib/runner/index.js +400 -194
- package/lib/runner/index.js.txt +19 -18
- package/lib/transform/babelBundle.js +12899 -11654
- package/lib/transform/babelBundle.js.LICENSE +379 -354
- package/lib/transform/babelBundle.js.txt +39 -39
- package/lib/transform/esmLoader.js +3275 -1154
- package/lib/transform/esmLoader.js.LICENSE +81 -61
- package/lib/transform/esmLoader.js.txt +23 -18
- package/lib/util.js +14 -44
- package/lib/worker/workerProcessEntry.js +60 -1461
- package/lib/worker/workerProcessEntry.js.txt +8 -13
- package/package.json +3 -6
- package/types/test.d.ts +458 -21
- package/types/testReporter.d.ts +79 -4
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var generateAgents_exports = {};
|
|
30
30
|
__export(generateAgents_exports, {
|
|
31
31
|
ClaudeGenerator: () => ClaudeGenerator,
|
|
32
|
+
CodexGenerator: () => CodexGenerator,
|
|
32
33
|
CopilotGenerator: () => CopilotGenerator,
|
|
33
34
|
OpencodeGenerator: () => OpencodeGenerator,
|
|
34
35
|
VSCodeGenerator: () => VSCodeGenerator
|
|
@@ -40,6 +41,7 @@ var import_seed = require("../mcp/test/seed");
|
|
|
40
41
|
var import_agentParser = require("./agentParser");
|
|
41
42
|
const colors = require("playwright-core/lib/utilsBundle").colors;
|
|
42
43
|
const yaml = require("playwright-core/lib/utilsBundle").yaml;
|
|
44
|
+
const { tomlArray, tomlBasicString, tomlMultilineBasicString } = require("playwright-core/lib/coreBundle").iso;
|
|
43
45
|
const { mkdirIfNeeded } = require("playwright-core/lib/coreBundle").utils;
|
|
44
46
|
async function loadAgentSpecs() {
|
|
45
47
|
const files = await import_fs.default.promises.readdir(__dirname);
|
|
@@ -89,6 +91,51 @@ class ClaudeGenerator {
|
|
|
89
91
|
return lines.join("\n");
|
|
90
92
|
}
|
|
91
93
|
}
|
|
94
|
+
class CodexGenerator {
|
|
95
|
+
static async init(fullConfig, projectName, prompts) {
|
|
96
|
+
await initRepo(fullConfig, projectName, {
|
|
97
|
+
promptsFolder: prompts ? ".codex/prompts" : void 0
|
|
98
|
+
});
|
|
99
|
+
const agents = await loadAgentSpecs();
|
|
100
|
+
await import_fs.default.promises.mkdir(".codex/agents", { recursive: true });
|
|
101
|
+
for (const agent of agents)
|
|
102
|
+
await writeFile(`.codex/agents/${CodexGenerator.codexName(agent)}.toml`, CodexGenerator.agentSpec(agent), "\u{1F916}", "agent definition");
|
|
103
|
+
initRepoDone();
|
|
104
|
+
}
|
|
105
|
+
// Codex's subagent registry rejects hyphenated identifiers at spawn time with
|
|
106
|
+
// `error=unknown agent_type '<name>'`. Codex's own documentation only shows
|
|
107
|
+
// snake_case names (`pr_explorer`, `reviewer`, `docs_researcher`, ...), see
|
|
108
|
+
// https://developers.openai.com/codex/subagents. Translate the shared agent
|
|
109
|
+
// name into snake_case so the filename and the `name` field stay in sync.
|
|
110
|
+
static codexName(agent) {
|
|
111
|
+
return agent.name.replace(/-/g, "_");
|
|
112
|
+
}
|
|
113
|
+
static agentSpec(agent) {
|
|
114
|
+
const mcpName = "playwright-test";
|
|
115
|
+
const enabledTools = [];
|
|
116
|
+
for (const tool of agent.tools) {
|
|
117
|
+
const [first, second] = tool.split("/");
|
|
118
|
+
if (second && first === mcpName)
|
|
119
|
+
enabledTools.push(second);
|
|
120
|
+
}
|
|
121
|
+
const sandboxMode = agent.tools.includes("edit") ? "workspace-write" : "read-only";
|
|
122
|
+
const mcpServer = process.platform === "win32" ? { command: "cmd", args: ["/c", "npx", "playwright", "run-test-mcp-server"] } : { command: "npx", args: ["playwright", "run-test-mcp-server"] };
|
|
123
|
+
const examples = agent.examples.length ? ` Examples: ${agent.examples.map((example) => `<example>${example}</example>`).join("")}` : "";
|
|
124
|
+
const lines = [];
|
|
125
|
+
lines.push(`name = ${tomlBasicString(CodexGenerator.codexName(agent))}`);
|
|
126
|
+
lines.push(`description = ${tomlBasicString(agent.description + examples)}`);
|
|
127
|
+
lines.push(`sandbox_mode = ${tomlBasicString(sandboxMode)}`);
|
|
128
|
+
lines.push(`developer_instructions = ${tomlMultilineBasicString(agent.instructions)}`);
|
|
129
|
+
lines.push("");
|
|
130
|
+
lines.push(`[mcp_servers.${mcpName}]`);
|
|
131
|
+
lines.push(`command = ${tomlBasicString(mcpServer.command)}`);
|
|
132
|
+
lines.push(`args = ${tomlArray(mcpServer.args)}`);
|
|
133
|
+
if (enabledTools.length)
|
|
134
|
+
lines.push(`enabled_tools = ${tomlArray(enabledTools)}`);
|
|
135
|
+
lines.push("");
|
|
136
|
+
return lines.join("\n");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
92
139
|
class OpencodeGenerator {
|
|
93
140
|
static async init(fullConfig, projectName, prompts) {
|
|
94
141
|
await initRepo(fullConfig, projectName, {
|
|
@@ -341,6 +388,7 @@ async function loadPrompt(file, params) {
|
|
|
341
388
|
// Annotate the CommonJS export names for ESM import in node:
|
|
342
389
|
0 && (module.exports = {
|
|
343
390
|
ClaudeGenerator,
|
|
391
|
+
CodexGenerator,
|
|
344
392
|
CopilotGenerator,
|
|
345
393
|
OpencodeGenerator,
|
|
346
394
|
VSCodeGenerator
|
package/lib/cli/reportActions.js
CHANGED
|
@@ -55,8 +55,8 @@ async function mergeReports(reportDir, opts) {
|
|
|
55
55
|
if (!reporterDescriptions)
|
|
56
56
|
reporterDescriptions = [[import_common.config.defaultReporter]];
|
|
57
57
|
const rootDirOverride = configFile ? config.config.rootDir : void 0;
|
|
58
|
-
await import_runner.merge.createMergedReport(config, dir, reporterDescriptions, rootDirOverride);
|
|
59
|
-
gracefullyProcessExitDoNotHang(0);
|
|
58
|
+
const result = await import_runner.merge.createMergedReport(config, dir, reporterDescriptions, rootDirOverride);
|
|
59
|
+
gracefullyProcessExitDoNotHang(result === "failed" ? 1 : 0);
|
|
60
60
|
}
|
|
61
61
|
function resolveReporterOption(reporter) {
|
|
62
62
|
if (!reporter || !reporter.length)
|
package/lib/cli/testActions.js
CHANGED
|
@@ -42,6 +42,7 @@ const { startProfiling, stopProfiling } = require("playwright-core/lib/coreBundl
|
|
|
42
42
|
async function runTests(args, opts) {
|
|
43
43
|
await startProfiling();
|
|
44
44
|
const cliOverrides = overridesFromOptions(opts);
|
|
45
|
+
cliOverrides.argv = process.argv;
|
|
45
46
|
const config = await import_common.configLoader.loadConfigFromFile(opts.config, cliOverrides, opts.deps === false);
|
|
46
47
|
const options = {
|
|
47
48
|
locations: args.length ? args : void 0,
|
|
@@ -52,6 +53,7 @@ async function runTests(args, opts) {
|
|
|
52
53
|
projectFilter: opts.project || void 0,
|
|
53
54
|
passWithNoTests: !!opts.passWithNoTests,
|
|
54
55
|
lastFailed: !!opts.lastFailed,
|
|
56
|
+
lastFailedFile: opts.lastFailedFile,
|
|
55
57
|
testList: opts.testList ? import_path.default.resolve(process.cwd(), opts.testList) : void 0,
|
|
56
58
|
testListInvert: opts.testListInvert ? import_path.default.resolve(process.cwd(), opts.testListInvert) : void 0,
|
|
57
59
|
shardWeights: resolveShardWeightsOption()
|