playwright 1.57.0-alpha-2025-10-21 → 1.57.0-alpha-2025-10-22
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.
|
@@ -207,7 +207,7 @@ class AgentGenerator {
|
|
|
207
207
|
const agents = await AgentParser.loadAgents();
|
|
208
208
|
await import_fs.default.promises.mkdir(agentsFolder, { recursive: true });
|
|
209
209
|
for (const agent of agents)
|
|
210
|
-
await writeFile(`${agentsFolder}/${agent.header.name}.md`, agent.source, "\u{1F916}", "agent definition");
|
|
210
|
+
await writeFile(`${agentsFolder}/agents/${agent.header.name}.md`, agent.source, "\u{1F916}", "agent definition");
|
|
211
211
|
console.log("\u{1F527} MCP configuration");
|
|
212
212
|
console.log(JSON.stringify({
|
|
213
213
|
mcpServers: {
|
package/lib/common/testType.js
CHANGED
|
@@ -29,6 +29,7 @@ var import_globals = require("./globals");
|
|
|
29
29
|
var import_test = require("./test");
|
|
30
30
|
var import_expect = require("../matchers/expect");
|
|
31
31
|
var import_transform = require("../transform/transform");
|
|
32
|
+
var import_validators = require("./validators");
|
|
32
33
|
const testTypeSymbol = Symbol("testType");
|
|
33
34
|
class TestTypeImpl {
|
|
34
35
|
constructor(fixtures) {
|
|
@@ -96,7 +97,7 @@ class TestTypeImpl {
|
|
|
96
97
|
body = fn;
|
|
97
98
|
details = fnOrDetails;
|
|
98
99
|
}
|
|
99
|
-
const validatedDetails = validateTestDetails(details, location);
|
|
100
|
+
const validatedDetails = (0, import_validators.validateTestDetails)(details, location);
|
|
100
101
|
const test = new import_test.TestCase(title, body, this, location);
|
|
101
102
|
test._requireFile = suite._requireFile;
|
|
102
103
|
test.annotations.push(...validatedDetails.annotations);
|
|
@@ -130,7 +131,7 @@ class TestTypeImpl {
|
|
|
130
131
|
details = fnOrDetails;
|
|
131
132
|
body = fn;
|
|
132
133
|
}
|
|
133
|
-
const validatedDetails = validateTestDetails(details, location);
|
|
134
|
+
const validatedDetails = (0, import_validators.validateTestDetails)(details, location);
|
|
134
135
|
const child = new import_test.Suite(title, "describe");
|
|
135
136
|
child._requireFile = suite._requireFile;
|
|
136
137
|
child.location = location;
|
|
@@ -276,16 +277,6 @@ See https://playwright.dev/docs/intro for more information about Playwright Test
|
|
|
276
277
|
);
|
|
277
278
|
}
|
|
278
279
|
}
|
|
279
|
-
function validateTestDetails(details, location) {
|
|
280
|
-
const originalAnnotations = Array.isArray(details.annotation) ? details.annotation : details.annotation ? [details.annotation] : [];
|
|
281
|
-
const annotations = originalAnnotations.map((annotation) => ({ ...annotation, location }));
|
|
282
|
-
const tags = Array.isArray(details.tag) ? details.tag : details.tag ? [details.tag] : [];
|
|
283
|
-
for (const tag of tags) {
|
|
284
|
-
if (tag[0] !== "@")
|
|
285
|
-
throw new Error(`Tag must start with "@" symbol, got "${tag}" instead.`);
|
|
286
|
-
}
|
|
287
|
-
return { annotations, tags };
|
|
288
|
-
}
|
|
289
280
|
const rootTestType = new TestTypeImpl([]);
|
|
290
281
|
function mergeTests(...tests) {
|
|
291
282
|
let result = rootTestType;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var validators_exports = {};
|
|
20
|
+
__export(validators_exports, {
|
|
21
|
+
validateTestAnnotation: () => validateTestAnnotation,
|
|
22
|
+
validateTestDetails: () => validateTestDetails
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(validators_exports);
|
|
25
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
26
|
+
const testAnnotationSchema = import_utilsBundle.zod.object({
|
|
27
|
+
type: import_utilsBundle.zod.string(),
|
|
28
|
+
description: import_utilsBundle.zod.string().optional()
|
|
29
|
+
});
|
|
30
|
+
const testDetailsSchema = import_utilsBundle.zod.object({
|
|
31
|
+
tag: import_utilsBundle.zod.union([
|
|
32
|
+
import_utilsBundle.zod.string().optional(),
|
|
33
|
+
import_utilsBundle.zod.array(import_utilsBundle.zod.string())
|
|
34
|
+
]).transform((val) => Array.isArray(val) ? val : val !== void 0 ? [val] : []).refine((val) => val.every((v) => v.startsWith("@")), {
|
|
35
|
+
message: "Tag must start with '@'"
|
|
36
|
+
}),
|
|
37
|
+
annotation: import_utilsBundle.zod.union([
|
|
38
|
+
testAnnotationSchema,
|
|
39
|
+
import_utilsBundle.zod.array(testAnnotationSchema).optional()
|
|
40
|
+
]).transform((val) => Array.isArray(val) ? val : val !== void 0 ? [val] : [])
|
|
41
|
+
});
|
|
42
|
+
function validateTestAnnotation(annotation) {
|
|
43
|
+
try {
|
|
44
|
+
return testAnnotationSchema.parse(annotation);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
throwZodError(error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function validateTestDetails(details, location) {
|
|
50
|
+
try {
|
|
51
|
+
const parsedDetails = testDetailsSchema.parse(details);
|
|
52
|
+
return {
|
|
53
|
+
annotations: parsedDetails.annotation.map((a) => ({ ...a, location })),
|
|
54
|
+
tags: parsedDetails.tag,
|
|
55
|
+
location
|
|
56
|
+
};
|
|
57
|
+
} catch (error) {
|
|
58
|
+
throwZodError(error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function throwZodError(error) {
|
|
62
|
+
throw new Error(error.issues.map((i) => i.message).join("\n"));
|
|
63
|
+
}
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
validateTestAnnotation,
|
|
67
|
+
validateTestDetails
|
|
68
|
+
});
|
package/lib/runner/loadUtils.js
CHANGED
|
@@ -159,7 +159,8 @@ async function createRootSuite(testRun, errors, shouldFilterOnly) {
|
|
|
159
159
|
if (config.config.shard) {
|
|
160
160
|
const testGroups = [];
|
|
161
161
|
for (const projectSuite of rootSuite.suites) {
|
|
162
|
-
|
|
162
|
+
for (const group of (0, import_testGroups.createTestGroups)(projectSuite, config.config.shard.total))
|
|
163
|
+
testGroups.push(group);
|
|
163
164
|
}
|
|
164
165
|
const testGroupsInThisShard = (0, import_testGroups.filterForShard)(config.config.shard, testGroups);
|
|
165
166
|
const testsInThisShard = /* @__PURE__ */ new Set();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright",
|
|
3
|
-
"version": "1.57.0-alpha-2025-10-
|
|
3
|
+
"version": "1.57.0-alpha-2025-10-22",
|
|
4
4
|
"description": "A high-level API to automate web browsers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"license": "Apache-2.0",
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"playwright-core": "1.57.0-alpha-2025-10-
|
|
67
|
+
"playwright-core": "1.57.0-alpha-2025-10-22"
|
|
68
68
|
},
|
|
69
69
|
"optionalDependencies": {
|
|
70
70
|
"fsevents": "2.3.2"
|