@untestutils/playwright 0.5.4 → 0.6.1
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/dist/harness.d.ts.map +1 -1
- package/dist/harness.mjs +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +11 -3
- package/package.json +2 -2
package/dist/harness.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAQL,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAU3B;;;;GAIG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB1F;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,CAc5E,CAAC"}
|
package/dist/harness.mjs
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { test as base } from "@playwright/test";
|
|
2
|
-
import { ensurePrepared, getRegisteredRecipe, normalizeBaseUrl, resolveArtifactsRoot, envKey, TargetRegistry } from "@untestutils/core";
|
|
2
|
+
import { ensurePrepared, getRegisteredRecipe, listRegisteredRecipes, normalizeBaseUrl, resolveArtifactsRoot, envKey, TargetRegistry } from "@untestutils/core";
|
|
3
|
+
function formatKnownIds() {
|
|
4
|
+
const known = listRegisteredRecipes().map((r) => r.id).filter(Boolean).sort();
|
|
5
|
+
return known.length ? ` Known ids: ${known.join(", ")}.` : "";
|
|
6
|
+
}
|
|
3
7
|
|
|
4
8
|
export async function resolvePlaywrightHarnessId(harness) {
|
|
5
9
|
const id = typeof harness === "string" ? harness : harness.id;
|
|
6
10
|
if (!id) throw new Error("[untestutils/playwright] test.use({ harness }) required");
|
|
7
11
|
const recipe = typeof harness === "string" ? getRegisteredRecipe(harness) : harness;
|
|
8
|
-
if (!recipe)
|
|
12
|
+
if (!recipe) {
|
|
13
|
+
throw new Error(`[untestutils/playwright] unknown harness "${id}".${formatKnownIds()}`);
|
|
14
|
+
}
|
|
9
15
|
const artifactsRoot = resolveArtifactsRoot();
|
|
10
16
|
const prepared = await ensurePrepared(recipe, { artifactsRoot });
|
|
11
17
|
const runningUrl = "url" in prepared.running ? prepared.running.url : undefined;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;A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AC9B,aAAa,EAAE,OAAO,aAAa,CAAC;CAKrC,CAAC;AAEF,gBAAgB;AAChB,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,GAAG,MAAM,CAsBjG;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAmC3D;AAED,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAG9D;AAED,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,IAAI,GACL,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ensureRecipes, getRegisteredRecipe, getRecipesModulePath, ensurePrepared, stopAllTargets, resolveArtifactsRoot, resolveSessionArtifactsRoot, sanitizeSession, progress, TargetRegistry } from "@untestutils/core";
|
|
1
|
+
import { ensureRecipes, getRegisteredRecipe, listRegisteredRecipes, getRecipesModulePath, ensurePrepared, stopAllTargets, resolveArtifactsRoot, resolveSessionArtifactsRoot, sanitizeSession, progress, TargetRegistry } from "@untestutils/core";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -26,7 +26,11 @@ export function createPlaywrightConfig(opts) {
|
|
|
26
26
|
const mod = recipesModule ?? getRecipesModulePath();
|
|
27
27
|
if (mod) process.env.UNTESTUTILS_RECIPES_MODULE = mod;
|
|
28
28
|
const browsers = browsersOpt?.length ? browsersOpt : undefined;
|
|
29
|
-
const defaults = {
|
|
29
|
+
const defaults = {
|
|
30
|
+
fullyParallel: true,
|
|
31
|
+
|
|
32
|
+
testMatch: "**/*.spec.ts"
|
|
33
|
+
};
|
|
30
34
|
if (process.env.CI && rest.workers === undefined) {
|
|
31
35
|
defaults.workers = 2;
|
|
32
36
|
}
|
|
@@ -40,6 +44,8 @@ export function createPlaywrightConfig(opts) {
|
|
|
40
44
|
return {
|
|
41
45
|
...defaults,
|
|
42
46
|
...rest,
|
|
47
|
+
|
|
48
|
+
testMatch: rest.testMatch ?? defaults.testMatch,
|
|
43
49
|
use: { ...rest.use ?? {} },
|
|
44
50
|
globalSetup: companion("pw-global-setup"),
|
|
45
51
|
globalTeardown: companion("pw-global-teardown")
|
|
@@ -91,7 +97,9 @@ export async function playwrightGlobalSetup() {
|
|
|
91
97
|
for (const id of prewarm) {
|
|
92
98
|
const recipe = recipesFromModule?.[id] ?? getRegisteredRecipe(id);
|
|
93
99
|
if (!recipe) {
|
|
94
|
-
|
|
100
|
+
const known = listRegisteredRecipes().map((r) => r.id).filter(Boolean).sort();
|
|
101
|
+
const hint = known.length ? ` Known ids: ${known.join(", ")}.` : "";
|
|
102
|
+
throw new Error(`[untestutils/playwright] prewarm "${id}" missing.${hint} Import recipes via defineRecipes(..., import.meta.url)`);
|
|
95
103
|
}
|
|
96
104
|
await ensurePrepared(recipe, { artifactsRoot });
|
|
97
105
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@untestutils/playwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"homepage": "https://s00d.github.io/untestutils/",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"pathe": "^2.0.3",
|
|
41
|
-
"@untestutils/core": "0.
|
|
41
|
+
"@untestutils/core": "0.6.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@playwright/test": "^1.63.0",
|