@immense/vue-pom-generator 1.0.119 → 1.0.121
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/README.md +88 -0
- package/RELEASE_NOTES.md +23 -34
- package/class-generation/base-page.ts +2 -0
- package/class-generation/index.ts +41 -43
- package/class-generation/pointer.ts +101 -4
- package/dist/class-generation/base-page.d.ts +2 -0
- package/dist/class-generation/base-page.d.ts.map +1 -1
- package/dist/class-generation/index.d.ts +2 -0
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/class-generation/pointer.d.ts +55 -1
- package/dist/class-generation/pointer.d.ts.map +1 -1
- package/dist/index.cjs +222 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +222 -137
- package/dist/index.mjs.map +1 -1
- package/dist/manifest-generator.d.ts +18 -0
- package/dist/manifest-generator.d.ts.map +1 -1
- package/dist/playwright/runtime.cjs +20 -4
- package/dist/playwright/runtime.cjs.map +1 -1
- package/dist/playwright/runtime.mjs +20 -4
- package/dist/playwright/runtime.mjs.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/internal/build-plugin.d.ts.map +1 -1
- package/dist/plugin/internal/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/path-utils.d.ts +1 -0
- package/dist/plugin/path-utils.d.ts.map +1 -1
- package/dist/plugin/resolved-generation-options.d.ts +1 -0
- package/dist/plugin/resolved-generation-options.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +6 -0
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/router-introspection.d.ts +10 -1
- package/dist/router-introspection.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -488,6 +488,7 @@ Optional Playwright fixture output:
|
|
|
488
488
|
|
|
489
489
|
- `fixtures.g.ts` next to the POMs by default
|
|
490
490
|
- `pom-manifest.g.ts` — a Node-importable map from Vue source/test ids to generated methods
|
|
491
|
+
- `component-graph.json` — component usage and route edges, when `generation.playwright.componentGraph` is on (see [Component usage graph](#component-usage-graph-component-graphjson))
|
|
491
492
|
- or a custom directory / file path when configured
|
|
492
493
|
|
|
493
494
|
Optional C# output:
|
|
@@ -1078,6 +1079,26 @@ const brandCallout: CalloutRenderer = {
|
|
|
1078
1079
|
setDefaultCalloutRenderer(brandCallout);
|
|
1079
1080
|
```
|
|
1080
1081
|
|
|
1082
|
+
To act around what page objects do, such as moving a video camera with the pointer, register action hooks. Every page object, generated or handwritten, calls them around each pointer move, click and text input, and waits for each one before it continues. They are read as each action runs, so a fixture can set them for one test and pass `undefined` to `setActionHooks` afterwards. Move hooks run only while animations are enabled, since nothing moves otherwise; a pointer's first move, with no position yet, places it on its target (`from` equals `to`).
|
|
1083
|
+
|
|
1084
|
+
```ts
|
|
1085
|
+
import { setActionHooks } from "@immense/vue-pom-generator/playwright/runtime";
|
|
1086
|
+
|
|
1087
|
+
setActionHooks({
|
|
1088
|
+
// Zoom out before the pointer travels, then in on the target once it stops.
|
|
1089
|
+
async beforeMove({ from, to }) { await camera.show(spanning(from, to)); },
|
|
1090
|
+
async afterMove({ box }) { await camera.show(box); },
|
|
1091
|
+
async afterClick() { await camera.hold(); },
|
|
1092
|
+
async beforeInput({ box }) { if (box) await camera.show(box); },
|
|
1093
|
+
});
|
|
1094
|
+
```
|
|
1095
|
+
|
|
1096
|
+
| Hook | Runs | Gets |
|
|
1097
|
+
| --- | --- | --- |
|
|
1098
|
+
| `beforeMove`, `afterMove` | before the pointer starts moving, after it stops | `page`, `target`, `box`, `from`, `to`, `durationMilliseconds` |
|
|
1099
|
+
| `beforeClick`, `afterClick` | before the click, after it (and after the click instrumentation wait) | `page`, `target`, `box` |
|
|
1100
|
+
| `beforeInput`, `afterInput` | before the text is typed or filled, after it | `page`, `target`, `box`, `text` |
|
|
1101
|
+
|
|
1081
1102
|
The example below uses the optional floating-ui renderer so the callout can auto-place around nearby UI and point back to the target with an arrow.
|
|
1082
1103
|
|
|
1083
1104
|
Example floating-ui callout sequence captured from the Playwright fixture coverage:
|
|
@@ -1176,6 +1197,64 @@ What it contains:
|
|
|
1176
1197
|
- for each component: source file, whether it is a view or component, sorted test ids, and rich entry metadata
|
|
1177
1198
|
- for each entry: test id, semantic name, inferred role, generated property name, generated action names, collected compiler metadata when available, and accessibility review metadata when available
|
|
1178
1199
|
|
|
1200
|
+
## Component usage graph (`component-graph.json`)
|
|
1201
|
+
|
|
1202
|
+
The manifest says what each component contains, not where it is used. Set `generation.playwright.componentGraph: true` (with `fixtures` on) to also write `component-graph.json` next to `pom-manifest.g.ts`. It holds the usage edges, so tools can work out which routes reach a component.
|
|
1203
|
+
|
|
1204
|
+
Schema (`version: 1`):
|
|
1205
|
+
|
|
1206
|
+
- `components` — keyed by source file, relative to the project root, with `/` separators
|
|
1207
|
+
- `name` — the generated component/class name (the key in `pom-manifest.g.ts`)
|
|
1208
|
+
- `uses` — source files of the project components this template uses. Tags resolve the same way as for POM generation (component name or file basename; kebab-case tags included). Tags that are not project components, such as built-ins and library components, are left out.
|
|
1209
|
+
- `routes` — one entry per route record from router introspection; empty when no router is configured
|
|
1210
|
+
- `path` — the path pattern as declared (`/users/:id`)
|
|
1211
|
+
- `name` — the route name, or `null`
|
|
1212
|
+
- `components` — source files the route renders: parent route components first, then the route's own components, named views included. Nuxt pages list their page file.
|
|
1213
|
+
|
|
1214
|
+
Keys and lists are sorted, so the file diffs cleanly. The `ComponentGraph` type is exported from the package.
|
|
1215
|
+
|
|
1216
|
+
```json
|
|
1217
|
+
{
|
|
1218
|
+
"version": 1,
|
|
1219
|
+
"components": {
|
|
1220
|
+
"src/components/NavBar.vue": { "name": "NavBar", "uses": ["src/components/users/UserAvatar.vue"] },
|
|
1221
|
+
"src/components/users/UserAvatar.vue": { "name": "UsersUserAvatar", "uses": [] },
|
|
1222
|
+
"src/layouts/AppShell.vue": { "name": "AppShell", "uses": ["src/components/NavBar.vue"] },
|
|
1223
|
+
"src/views/UserDetail.vue": { "name": "UserDetail", "uses": [] }
|
|
1224
|
+
},
|
|
1225
|
+
"routes": [
|
|
1226
|
+
{ "path": "/users", "name": null, "components": ["src/layouts/AppShell.vue"] },
|
|
1227
|
+
{ "path": "/users/:id", "name": "user-detail", "components": ["src/layouts/AppShell.vue", "src/views/UserDetail.vue"] }
|
|
1228
|
+
]
|
|
1229
|
+
}
|
|
1230
|
+
```
|
|
1231
|
+
|
|
1232
|
+
Routes that reach a component:
|
|
1233
|
+
|
|
1234
|
+
```ts
|
|
1235
|
+
import fs from "node:fs";
|
|
1236
|
+
import type { ComponentGraph } from "@immense/vue-pom-generator";
|
|
1237
|
+
|
|
1238
|
+
const graph: ComponentGraph = JSON.parse(fs.readFileSync("tests/playwright/__generated__/component-graph.json", "utf8"));
|
|
1239
|
+
|
|
1240
|
+
function routesReaching(file: string) {
|
|
1241
|
+
return graph.routes.filter((route) => {
|
|
1242
|
+
const seen = new Set<string>();
|
|
1243
|
+
const visit = (current: string): boolean => {
|
|
1244
|
+
if (current === file) return true;
|
|
1245
|
+
if (seen.has(current)) return false;
|
|
1246
|
+
seen.add(current);
|
|
1247
|
+
return (graph.components[current]?.uses ?? []).some(visit);
|
|
1248
|
+
};
|
|
1249
|
+
return route.components.some(visit);
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
routesReaching("src/components/users/UserAvatar.vue"); // both /users routes
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
Unnamed routes are placed in the route tree by resolving their own path pattern. Generation fails with an error if that pattern does not match itself (for example `/items/:id(\\d+)`). Name the route to fix it.
|
|
1257
|
+
|
|
1179
1258
|
## ESLint rules that actually ship
|
|
1180
1259
|
|
|
1181
1260
|
The package exports `@immense/vue-pom-generator/eslint`.
|
|
@@ -1586,6 +1665,15 @@ This object holds Playwright-specific additions on top of the generated TypeScri
|
|
|
1586
1665
|
- `"path"` — if the string ends in `.ts` / `.tsx` / `.mts` / `.cts`, it is treated as a file path; otherwise as an output directory
|
|
1587
1666
|
- `{ outDir }` — emit to a custom directory
|
|
1588
1667
|
|
|
1668
|
+
#### `generation.playwright.componentGraph`
|
|
1669
|
+
|
|
1670
|
+
- **What it does:** Writes `component-graph.json` next to `pom-manifest.g.ts`: what each component uses and what each route renders.
|
|
1671
|
+
- **Why it exists:** the manifest has no usage edges, so tools cannot tell which routes reach a component.
|
|
1672
|
+
- **Benefit:** one deterministic file that maps components and routes to source files.
|
|
1673
|
+
- **Without it:** no graph file is written. Other outputs are the same either way.
|
|
1674
|
+
- **Requires:** `generation.playwright.fixtures`. Routes need `generation.router` (or Nuxt).
|
|
1675
|
+
- **Schema:** see [Component usage graph](#component-usage-graph-component-graphjson).
|
|
1676
|
+
|
|
1589
1677
|
#### `generation.playwright.outputStructure`
|
|
1590
1678
|
|
|
1591
1679
|
- **What it does:** Chooses whether generated TypeScript POMs are emitted as one aggregate or split per class.
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,49 +1,38 @@
|
|
|
1
|
-
PR search worked. Now let me verify the tag contents and what v1.0.118 included, to reconcile the
|
|
2
|
-
compare range with the window.
|
|
3
|
-
|
|
4
1
|
Highlights
|
|
5
2
|
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
- New exported CustomPomFixtures type on PomFixtures gives specs autocomplete for custom fixtures
|
|
12
|
-
- Generation fails fast with clear errors for misconfiguration; when the option is unset, generated
|
|
13
|
-
output is unchanged (byte-identical fixtures.g.ts verified)
|
|
3
|
+
- Added process-wide action hooks to the generated POM pointer layer: callbacks can now wrap every
|
|
4
|
+
move, click, and input action, enabling cross-cutting behavior (e.g., logging or instrumentation)
|
|
5
|
+
without touching individual POMs (]8;id=md-1exmtnu;https://github.com/immense/vue-pom-generator/pull/88#88]8;;]8;;).]8;;
|
|
6
|
+
- Hooks are registered through BasePage, so all generated page objects pick them up automatically.
|
|
7
|
+
- New coverage in tests/pointer.test.ts exercises the hook lifecycle around each action type.
|
|
14
8
|
|
|
15
9
|
Changes
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
Pointer / POM runtime
|
|
18
12
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
plugin/create-vue-pom-generator-plugins.ts, plugin/internal/build-plugin.ts,
|
|
23
|
-
plugin/internal/dev-plugin.ts, class-generation/index.ts)
|
|
24
|
-
- Unlisted helpers in customPoms.dir are not registered — attachment helpers that take (page,
|
|
25
|
-
owner) can't be built from page alone
|
|
26
|
-
- Fail-fast errors for: a class listed more than once, a listed class with no file, a fixture name
|
|
27
|
-
colliding with a built-in, generated, or other custom fixture (the message names the conflicting
|
|
28
|
-
owner), and fixtures disabled
|
|
13
|
+
- Process-wide action hooks around moves, clicks, and input in the pointer class generation
|
|
14
|
+
(class-generation/pointer.ts).
|
|
15
|
+
- Hook registration wired into BasePage (class-generation/base-page.ts).
|
|
29
16
|
|
|
30
|
-
|
|
17
|
+
Documentation
|
|
31
18
|
|
|
32
|
-
-
|
|
19
|
+
- Documented the action-hooks API in README.md.
|
|
33
20
|
|
|
34
|
-
|
|
21
|
+
Tooling
|
|
22
|
+
|
|
23
|
+
- Updated the packed build smoke-check script (scripts/packed-smoke-check.mjs).
|
|
35
24
|
|
|
36
|
-
|
|
25
|
+
Tests
|
|
26
|
+
|
|
27
|
+
- Expanded tests/pointer.test.ts with tests for the new hooks.
|
|
28
|
+
|
|
29
|
+
Pull Requests Included
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
- ]8;id=md-1exmtnu;https://github.com/immense/vue-pom-generator/pull/88#88 feat(pointer): add process-wide action hooks around moves, clicks and input]8;;]8;; ]8;;
|
|
32
|
+
(@darrenator[bot])
|
|
40
33
|
|
|
41
34
|
Testing
|
|
42
35
|
|
|
43
|
-
- tests
|
|
44
|
-
|
|
45
|
-
(duplicate listing, missing file, reserved/colliding names with owner in the message, fixtures off)
|
|
46
|
-
- tests/generate-vue-poms.test.ts: end-to-end coverage through the public plugin option
|
|
47
|
-
- Local runs: npm run lint -- --max-warnings 0, npm run typecheck, npm run knip, npm test (519
|
|
48
|
-
passed), and npm run build all passed
|
|
36
|
+
- Adds ~128 lines of new tests for the pointer action hooks in tests/pointer.test.ts; the packed
|
|
37
|
+
smoke check was updated accordingly. No additional test-run results were provided with this release.
|
|
49
38
|
|
|
@@ -10,6 +10,8 @@ import { Pointer, type AfterPointerClick, type AfterPointerClickInfo, type Point
|
|
|
10
10
|
// Part of the public `playwright/runtime` entry, whose source is this file.
|
|
11
11
|
export { setDefaultCalloutRenderer } from "./callout";
|
|
12
12
|
export type { CalloutRenderer, CalloutRenderRequest } from "./callout";
|
|
13
|
+
export { setActionHooks } from "./pointer";
|
|
14
|
+
export type { ActionBox, ActionHookContext, ActionHooks, InputHookContext, PointerMoveHookContext } from "./pointer";
|
|
13
15
|
|
|
14
16
|
const POM_ACTIVE_ACTION_REGISTRY = Symbol.for("@immense/vue-pom-generator.active-action-registry");
|
|
15
17
|
const CHECKABLE_CONTROL_SELECTOR = 'input[type="checkbox"], input[type="radio"]';
|
|
@@ -9,7 +9,7 @@ import path from "node:path";
|
|
|
9
9
|
import process from "node:process";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
import { generateViewObjectModelMembers, generateViewObjectModelMethodContent } from "../method-generation";
|
|
12
|
-
import { generatePomManifestModule } from "../manifest-generator";
|
|
12
|
+
import { generateComponentGraphJson, generatePomManifestModule, normalizeTrackedComponentRef, resolveTrackedComponentRef } from "../manifest-generator";
|
|
13
13
|
import type { ElementMetadata } from "../metadata-collector";
|
|
14
14
|
import { writeGeneratedOutputs, type GeneratedFileOutput } from "../plugin/generated-outputs";
|
|
15
15
|
import {
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
type PomStringPattern,
|
|
33
33
|
} from "../pom-patterns";
|
|
34
34
|
import { buildPomLocatorDescription, stripPomActionPrefix } from "../pom-discoverability";
|
|
35
|
+
import type { RouterIntrospectionResult } from "../router-introspection";
|
|
35
36
|
import { introspectNuxtPages, parseRouterFileFromCwd } from "../router-introspection";
|
|
36
37
|
import {
|
|
37
38
|
addNamedImport,
|
|
@@ -279,7 +280,7 @@ function resolveVueSourcePath(
|
|
|
279
280
|
return candidates.find(candidate => fs.existsSync(candidate));
|
|
280
281
|
}
|
|
281
282
|
|
|
282
|
-
async function
|
|
283
|
+
async function introspectRouteMetaEntries(
|
|
283
284
|
projectRoot?: string,
|
|
284
285
|
routerEntry?: string,
|
|
285
286
|
routerType?: "vue-router" | "nuxt",
|
|
@@ -287,8 +288,9 @@ async function getRouteMetaByComponent(
|
|
|
287
288
|
pageDirs?: string[];
|
|
288
289
|
componentDirs?: string[];
|
|
289
290
|
layoutDirs?: string[];
|
|
291
|
+
collectComponentFiles?: boolean;
|
|
290
292
|
} = {},
|
|
291
|
-
): Promise<
|
|
293
|
+
): Promise<RouterIntrospectionResult["routeMetaEntries"]> {
|
|
292
294
|
const root = projectRoot ?? process.cwd();
|
|
293
295
|
const pageDirs = options.pageDirs?.length ? options.pageDirs : ["src/views"];
|
|
294
296
|
const pageDirsAbs = pageDirs.map(dir => path.isAbsolute(dir) ? dir : path.resolve(root, dir));
|
|
@@ -301,7 +303,7 @@ async function getRouteMetaByComponent(
|
|
|
301
303
|
const extraRoots = process.cwd() !== root ? [process.cwd()] : [];
|
|
302
304
|
|
|
303
305
|
const { routeMetaEntries } = routerType === "nuxt"
|
|
304
|
-
? await introspectNuxtPages(root, { pageDirs: pageDirsAbs })
|
|
306
|
+
? await introspectNuxtPages(root, { pageDirs: pageDirsAbs, collectComponentFiles: options.collectComponentFiles })
|
|
305
307
|
: await parseRouterFileFromCwd(resolveRouterEntry(root, routerEntry), {
|
|
306
308
|
componentNaming: {
|
|
307
309
|
projectRoot: root,
|
|
@@ -309,8 +311,12 @@ async function getRouteMetaByComponent(
|
|
|
309
311
|
sourceDirs,
|
|
310
312
|
extraRoots,
|
|
311
313
|
},
|
|
314
|
+
collectComponentFiles: options.collectComponentFiles,
|
|
312
315
|
});
|
|
316
|
+
return routeMetaEntries;
|
|
317
|
+
}
|
|
313
318
|
|
|
319
|
+
function buildRouteMetaByComponent(routeMetaEntries: RouterIntrospectionResult["routeMetaEntries"]): Record<string, RouteMeta> {
|
|
314
320
|
const map = new Map<string, RouteEntry[]>();
|
|
315
321
|
for (const entry of routeMetaEntries) {
|
|
316
322
|
const list = map.get(entry.componentName) ?? [];
|
|
@@ -806,6 +812,9 @@ export interface GenerateFilesOptions {
|
|
|
806
812
|
*/
|
|
807
813
|
customPomFixtures?: string[];
|
|
808
814
|
|
|
815
|
+
/** Write `component-graph.json` next to the generated manifest. Requires `generateFixtures`. */
|
|
816
|
+
componentGraph?: boolean;
|
|
817
|
+
|
|
809
818
|
/**
|
|
810
819
|
* Handwritten POM helper attachments. These helpers are assumed to be present in the
|
|
811
820
|
* aggregated output (e.g. via `tests/playwright/pom/custom/*.ts` inlining), but we only attach them to
|
|
@@ -900,6 +909,7 @@ export async function generateFiles(
|
|
|
900
909
|
customPomImportAliases,
|
|
901
910
|
customPomImportNameCollisionBehavior = "error",
|
|
902
911
|
customPomFixtures = [],
|
|
912
|
+
componentGraph = false,
|
|
903
913
|
testIdAttribute,
|
|
904
914
|
emitLanguages: emitLanguagesOverride,
|
|
905
915
|
typescriptOutputStructure = "aggregated",
|
|
@@ -926,14 +936,16 @@ export async function generateFiles(
|
|
|
926
936
|
throw new Error("[vue-pom-generator] generation.vueTestUtils.outDir must differ from generation.outDir.");
|
|
927
937
|
}
|
|
928
938
|
|
|
939
|
+
const routeMetaEntries = vueRouterFluentChaining && (!routeMetaByComponentOverride || componentGraph)
|
|
940
|
+
? await introspectRouteMetaEntries(projectRoot, routerEntry, routerType, {
|
|
941
|
+
pageDirs,
|
|
942
|
+
componentDirs,
|
|
943
|
+
layoutDirs,
|
|
944
|
+
collectComponentFiles: componentGraph,
|
|
945
|
+
})
|
|
946
|
+
: [];
|
|
929
947
|
const routeMetaByComponent = routeMetaByComponentOverride
|
|
930
|
-
?? (vueRouterFluentChaining
|
|
931
|
-
? await getRouteMetaByComponent(projectRoot, routerEntry, routerType, {
|
|
932
|
-
pageDirs,
|
|
933
|
-
componentDirs,
|
|
934
|
-
layoutDirs,
|
|
935
|
-
})
|
|
936
|
-
: undefined);
|
|
948
|
+
?? (vueRouterFluentChaining ? buildRouteMetaByComponent(routeMetaEntries) : undefined);
|
|
937
949
|
const emittableComponentHierarchyMap = componentHierarchyMap;
|
|
938
950
|
const generatedFiles: GeneratedFileOutput[] = [];
|
|
939
951
|
|
|
@@ -973,6 +985,7 @@ export async function generateFiles(
|
|
|
973
985
|
projectRoot,
|
|
974
986
|
customPomDir,
|
|
975
987
|
customPomFixtures,
|
|
988
|
+
componentGraphRoutes: componentGraph ? routeMetaEntries : undefined,
|
|
976
989
|
elementMetadata,
|
|
977
990
|
testIdAttribute,
|
|
978
991
|
});
|
|
@@ -1881,17 +1894,24 @@ function maybeGenerateFixtureRegistry(
|
|
|
1881
1894
|
projectRoot?: string;
|
|
1882
1895
|
customPomDir?: string;
|
|
1883
1896
|
customPomFixtures: string[];
|
|
1897
|
+
/** Routes for `component-graph.json`; the graph is written only when set. */
|
|
1898
|
+
componentGraphRoutes?: RouterIntrospectionResult["routeMetaEntries"];
|
|
1884
1899
|
elementMetadata: Map<string, Map<string, ElementMetadata>>;
|
|
1885
1900
|
testIdAttribute?: string;
|
|
1886
1901
|
},
|
|
1887
1902
|
): GeneratedFileOutput[] {
|
|
1888
|
-
const { generateFixtures, pomOutDir, customPomFixtures } = options;
|
|
1903
|
+
const { generateFixtures, pomOutDir, customPomFixtures, componentGraphRoutes } = options;
|
|
1889
1904
|
if (!generateFixtures) {
|
|
1890
1905
|
if (customPomFixtures.length > 0) {
|
|
1891
1906
|
throw new VuePomGeneratorError(
|
|
1892
1907
|
"generation.playwright.customPoms.fixtures requires generation.playwright.fixtures to be enabled.",
|
|
1893
1908
|
);
|
|
1894
1909
|
}
|
|
1910
|
+
if (componentGraphRoutes) {
|
|
1911
|
+
throw new VuePomGeneratorError(
|
|
1912
|
+
"generation.playwright.componentGraph requires generation.playwright.fixtures to be enabled.",
|
|
1913
|
+
);
|
|
1914
|
+
}
|
|
1895
1915
|
return [];
|
|
1896
1916
|
}
|
|
1897
1917
|
|
|
@@ -2310,6 +2330,12 @@ function maybeGenerateFixtureRegistry(
|
|
|
2310
2330
|
filePath: path.resolve(fixtureOutDirAbs, manifestFileName),
|
|
2311
2331
|
content: manifestContent,
|
|
2312
2332
|
},
|
|
2333
|
+
...(componentGraphRoutes
|
|
2334
|
+
? [{
|
|
2335
|
+
filePath: path.resolve(fixtureOutDirAbs, "component-graph.json"),
|
|
2336
|
+
content: generateComponentGraphJson(componentHierarchyMap, componentGraphRoutes, root),
|
|
2337
|
+
}]
|
|
2338
|
+
: []),
|
|
2313
2339
|
diagnosticsRuntimeFile,
|
|
2314
2340
|
];
|
|
2315
2341
|
|
|
@@ -2328,36 +2354,8 @@ function prepareViewObjectModelClass(
|
|
|
2328
2354
|
testIdAttribute,
|
|
2329
2355
|
} = options;
|
|
2330
2356
|
|
|
2331
|
-
const normalizeTrackedComponentRef = (value: string): string => {
|
|
2332
|
-
return value.endsWith(".vue") ? value.slice(0, -4) : value;
|
|
2333
|
-
};
|
|
2334
|
-
|
|
2335
|
-
const resolveTrackedComponentRef = (value: string): string | null => {
|
|
2336
|
-
const normalizedValue = normalizeTrackedComponentRef(value);
|
|
2337
|
-
if (componentHierarchyMap.has(value)) {
|
|
2338
|
-
return value;
|
|
2339
|
-
}
|
|
2340
|
-
if (componentHierarchyMap.has(normalizedValue)) {
|
|
2341
|
-
return normalizedValue;
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
let match: string | null = null;
|
|
2345
|
-
for (const [candidateName, candidateDeps] of componentHierarchyMap.entries()) {
|
|
2346
|
-
const normalizedCandidate = normalizeTrackedComponentRef(candidateName);
|
|
2347
|
-
const candidateBaseName = path.parse(candidateDeps.filePath).name;
|
|
2348
|
-
if (normalizedCandidate !== normalizedValue && candidateBaseName !== normalizedValue) {
|
|
2349
|
-
continue;
|
|
2350
|
-
}
|
|
2351
|
-
if (match && match !== candidateName) {
|
|
2352
|
-
return null;
|
|
2353
|
-
}
|
|
2354
|
-
match = candidateName;
|
|
2355
|
-
}
|
|
2356
|
-
return match;
|
|
2357
|
-
};
|
|
2358
|
-
|
|
2359
2357
|
const hasGeneratedPomSurface = (value: string, seen = new Set<string>()): boolean => {
|
|
2360
|
-
const resolvedRef = resolveTrackedComponentRef(value);
|
|
2358
|
+
const resolvedRef = resolveTrackedComponentRef(value, componentHierarchyMap);
|
|
2361
2359
|
if (!resolvedRef || seen.has(resolvedRef)) {
|
|
2362
2360
|
return false;
|
|
2363
2361
|
}
|
|
@@ -2391,7 +2389,7 @@ function prepareViewObjectModelClass(
|
|
|
2391
2389
|
};
|
|
2392
2390
|
|
|
2393
2391
|
const resolveComponentInstance = (spec: PomComponentInstanceSpec): ResolvedComponentInstance | null => {
|
|
2394
|
-
const componentRef = resolveTrackedComponentRef(spec.componentName);
|
|
2392
|
+
const componentRef = resolveTrackedComponentRef(spec.componentName, componentHierarchyMap);
|
|
2395
2393
|
if (
|
|
2396
2394
|
!componentRef
|
|
2397
2395
|
|| isSelfReference(componentRef)
|
|
@@ -2531,7 +2529,7 @@ function prepareViewObjectModelClass(
|
|
|
2531
2529
|
const hasChildComponent = (needle: string) => {
|
|
2532
2530
|
const normalizedNeedle = normalizeTrackedComponentRef(needle);
|
|
2533
2531
|
for (const child of rawComponentRefsForInstances) {
|
|
2534
|
-
const resolvedChild = resolveTrackedComponentRef(child);
|
|
2532
|
+
const resolvedChild = resolveTrackedComponentRef(child, componentHierarchyMap);
|
|
2535
2533
|
if (normalizeTrackedComponentRef(child) === normalizedNeedle)
|
|
2536
2534
|
return true;
|
|
2537
2535
|
if (resolvedChild && normalizeTrackedComponentRef(resolvedChild) === normalizedNeedle)
|
|
@@ -20,8 +20,9 @@ const __PW_POINTER_PNG__ =
|
|
|
20
20
|
|
|
21
21
|
const __pw_pointer_positions__ = new WeakMap<object, { x: number; y: number }>();
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
/** Where the page's pointer is; undefined until its first move, so that move places it instead of gliding in. */
|
|
24
|
+
function __pw_get_pointer_pos__(page: PwPage): { x: number; y: number } | undefined {
|
|
25
|
+
return __pw_pointer_positions__.get(page as object);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
function __pw_set_pointer_pos__(page: PwPage, x: number, y: number): void {
|
|
@@ -133,6 +134,75 @@ export interface AfterPointerClickInfo {
|
|
|
133
134
|
|
|
134
135
|
export type AfterPointerClick = (info: AfterPointerClickInfo) => void | Promise<void>;
|
|
135
136
|
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
// Action hooks
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
|
|
141
|
+
/** A box in viewport pixels. */
|
|
142
|
+
export interface ActionBox {
|
|
143
|
+
x: number;
|
|
144
|
+
y: number;
|
|
145
|
+
width: number;
|
|
146
|
+
height: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** The element an action is on, and its box once scrolled into view (null when it has none). */
|
|
150
|
+
export interface ActionHookContext {
|
|
151
|
+
page: PwPage;
|
|
152
|
+
target: PwLocator;
|
|
153
|
+
box: ActionBox | null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* A pointer move to the center of `box`. `from` is where the pointer was; on its first move it has no position yet,
|
|
158
|
+
* so `from` equals `to` and the pointer is placed there instead of gliding.
|
|
159
|
+
*/
|
|
160
|
+
export interface PointerMoveHookContext extends ActionHookContext {
|
|
161
|
+
box: ActionBox;
|
|
162
|
+
from: { x: number; y: number };
|
|
163
|
+
to: { x: number; y: number };
|
|
164
|
+
/** How long the glide takes; 0 when the pointer is placed without one. */
|
|
165
|
+
durationMilliseconds: number;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Text typed or filled into `target`. */
|
|
169
|
+
export interface InputHookContext extends ActionHookContext {
|
|
170
|
+
text: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Called around each pointer move, click and text input a page object performs, and awaited: the action continues once
|
|
175
|
+
* the hook resolves. For example, a video camera can pan to where the pointer is going before it moves and zoom in on
|
|
176
|
+
* the target after it arrives. Move hooks run only while animations are enabled, since nothing moves otherwise.
|
|
177
|
+
*/
|
|
178
|
+
export interface ActionHooks {
|
|
179
|
+
beforeMove?: (context: PointerMoveHookContext) => void | Promise<void>;
|
|
180
|
+
afterMove?: (context: PointerMoveHookContext) => void | Promise<void>;
|
|
181
|
+
beforeClick?: (context: ActionHookContext) => void | Promise<void>;
|
|
182
|
+
afterClick?: (context: ActionHookContext) => void | Promise<void>;
|
|
183
|
+
beforeInput?: (context: InputHookContext) => void | Promise<void>;
|
|
184
|
+
afterInput?: (context: InputHookContext) => void | Promise<void>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Kept on globalThis so the package's runtime entry and the runtime copied next to the
|
|
188
|
+
// generated POMs share one set, whichever copy the setter is imported from.
|
|
189
|
+
const ACTION_HOOKS = Symbol.for("@immense/vue-pom-generator.action-hooks");
|
|
190
|
+
|
|
191
|
+
type ActionHooksGlobal = typeof globalThis & { [ACTION_HOOKS]?: ActionHooks };
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Sets the process-wide action hooks every page object, generated or handwritten, calls around its pointer moves,
|
|
195
|
+
* clicks and text input. They are read as each action runs, so they can change between tests. Pass `undefined` to
|
|
196
|
+
* remove them.
|
|
197
|
+
*/
|
|
198
|
+
export function setActionHooks(hooks: ActionHooks | undefined): void {
|
|
199
|
+
(globalThis as ActionHooksGlobal)[ACTION_HOOKS] = hooks;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function actionHooks(): ActionHooks | undefined {
|
|
203
|
+
return (globalThis as ActionHooksGlobal)[ACTION_HOOKS];
|
|
204
|
+
}
|
|
205
|
+
|
|
136
206
|
const __pw_default_pointer_renderer__: PointerRenderer = {
|
|
137
207
|
overlayIds: [__PW_POINTER_ID__],
|
|
138
208
|
async ensure(page) {
|
|
@@ -142,7 +212,8 @@ const __pw_default_pointer_renderer__: PointerRenderer = {
|
|
|
142
212
|
);
|
|
143
213
|
if (exists) return;
|
|
144
214
|
|
|
145
|
-
|
|
215
|
+
// A new pointer, such as after a page load, has no position until its first move places it.
|
|
216
|
+
__pw_pointer_positions__.delete(page as object);
|
|
146
217
|
|
|
147
218
|
await page.evaluate(
|
|
148
219
|
({ id, src }: { id: string; src: string }) => {
|
|
@@ -352,6 +423,7 @@ export class Pointer {
|
|
|
352
423
|
|
|
353
424
|
const opts = animationOptions;
|
|
354
425
|
const animEnabled = opts.enabled !== false;
|
|
426
|
+
const hooks = actionHooks();
|
|
355
427
|
if (executeClick) {
|
|
356
428
|
await this.waitForFiniteAncestorAnimations(locator);
|
|
357
429
|
}
|
|
@@ -368,15 +440,18 @@ export class Pointer {
|
|
|
368
440
|
if (extraDelay > 0) await this.page.waitForTimeout(extraDelay);
|
|
369
441
|
|
|
370
442
|
let clickedTestId: string | undefined;
|
|
443
|
+
const click = hooks && executeClick ? await this.hookContext(locator) : undefined;
|
|
371
444
|
if (executeClick) {
|
|
372
445
|
if (options?.afterClick) {
|
|
373
446
|
try { clickedTestId = await this.getTestId(locator); } catch { /* noop */ }
|
|
374
447
|
}
|
|
448
|
+
if (click) await hooks?.beforeClick?.(click);
|
|
375
449
|
await locator.first().click();
|
|
376
450
|
}
|
|
377
451
|
if (options?.afterClick) {
|
|
378
452
|
await options.afterClick({ testId: clickedTestId, instrumented: Boolean(clickedTestId) });
|
|
379
453
|
}
|
|
454
|
+
if (click) await hooks?.afterClick?.(click);
|
|
380
455
|
return;
|
|
381
456
|
}
|
|
382
457
|
|
|
@@ -399,13 +474,23 @@ export class Pointer {
|
|
|
399
474
|
|
|
400
475
|
// Move the pointer to the target element.
|
|
401
476
|
const box = await locator.first().boundingBox();
|
|
477
|
+
let move: PointerMoveHookContext | undefined;
|
|
402
478
|
if (box) {
|
|
403
479
|
const endX = box.x + box.width / 2;
|
|
404
480
|
const endY = box.y + box.height / 2;
|
|
405
|
-
const { x: startX, y: startY } = __pw_get_pointer_pos__(this.page);
|
|
481
|
+
const { x: startX, y: startY } = __pw_get_pointer_pos__(this.page) ?? { x: endX, y: endY };
|
|
406
482
|
const distance = Math.sqrt((endX - startX) ** 2 + (endY - startY) ** 2);
|
|
407
483
|
|
|
408
484
|
const shouldAnimate = moveDurationMs > 0 && distance > 0;
|
|
485
|
+
move = {
|
|
486
|
+
page: this.page,
|
|
487
|
+
target: locator,
|
|
488
|
+
box,
|
|
489
|
+
from: { x: startX, y: startY },
|
|
490
|
+
to: { x: endX, y: endY },
|
|
491
|
+
durationMilliseconds: shouldAnimate ? moveDurationMs : 0,
|
|
492
|
+
};
|
|
493
|
+
await hooks?.beforeMove?.(move);
|
|
409
494
|
await this.renderer.move(this.page, {
|
|
410
495
|
animate: shouldAnimate,
|
|
411
496
|
durationMilliseconds: moveDurationMs,
|
|
@@ -432,6 +517,7 @@ export class Pointer {
|
|
|
432
517
|
}
|
|
433
518
|
|
|
434
519
|
__pw_set_pointer_pos__(this.page, endX, endY);
|
|
520
|
+
await hooks?.afterMove?.(move);
|
|
435
521
|
}
|
|
436
522
|
else {
|
|
437
523
|
await this.callout.hide();
|
|
@@ -442,7 +528,9 @@ export class Pointer {
|
|
|
442
528
|
if (totalDelay > 0) await this.page.waitForTimeout(totalDelay);
|
|
443
529
|
|
|
444
530
|
let clickedTestId: string | undefined;
|
|
531
|
+
const click = hooks && executeClick ? { page: this.page, target: locator, box } : undefined;
|
|
445
532
|
if (executeClick) {
|
|
533
|
+
if (click) await hooks?.beforeClick?.(click);
|
|
446
534
|
// Brief scale-down "press" animation on the pointer image.
|
|
447
535
|
if (moveDurationMs > 0) {
|
|
448
536
|
const pressDur = Math.max(80, Math.round(moveDurationMs / 3));
|
|
@@ -458,6 +546,11 @@ export class Pointer {
|
|
|
458
546
|
if (options?.afterClick) {
|
|
459
547
|
await options.afterClick({ testId: clickedTestId, instrumented: Boolean(clickedTestId) });
|
|
460
548
|
}
|
|
549
|
+
if (click) await hooks?.afterClick?.(click);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
private async hookContext(locator: PwLocator): Promise<ActionHookContext> {
|
|
553
|
+
return { page: this.page, target: locator, box: await locator.first().boundingBox() };
|
|
461
554
|
}
|
|
462
555
|
|
|
463
556
|
public async animateCursorToElementAndClickAndFill(
|
|
@@ -476,6 +569,9 @@ export class Pointer {
|
|
|
476
569
|
const locator = this.toLocator(target);
|
|
477
570
|
const editableLocator = await this.resolveEditableLocator(locator);
|
|
478
571
|
const typeDelayMs = animationOptions.keyboard?.typeDelayMilliseconds ?? 100;
|
|
572
|
+
const hooks = actionHooks();
|
|
573
|
+
const input = hooks ? { ...(await this.hookContext(editableLocator)), text } : undefined;
|
|
574
|
+
if (input) await hooks?.beforeInput?.(input);
|
|
479
575
|
|
|
480
576
|
if (animationOptions.enabled !== false && typeDelayMs > 0) {
|
|
481
577
|
// Clear existing content, then type character-by-character so keystrokes are visible.
|
|
@@ -485,5 +581,6 @@ export class Pointer {
|
|
|
485
581
|
else {
|
|
486
582
|
await editableLocator.fill(text);
|
|
487
583
|
}
|
|
584
|
+
if (input) await hooks?.afterInput?.(input);
|
|
488
585
|
}
|
|
489
586
|
}
|
|
@@ -4,6 +4,8 @@ import type { CalloutRenderer } from "./callout";
|
|
|
4
4
|
import { type AfterPointerClick, type PointerRenderer } from "./pointer";
|
|
5
5
|
export { setDefaultCalloutRenderer } from "./callout";
|
|
6
6
|
export type { CalloutRenderer, CalloutRenderRequest } from "./callout";
|
|
7
|
+
export { setActionHooks } from "./pointer";
|
|
8
|
+
export type { ActionBox, ActionHookContext, ActionHooks, InputHookContext, PointerMoveHookContext } from "./pointer";
|
|
7
9
|
/**
|
|
8
10
|
* A chainable, thenable wrapper around a page object.
|
|
9
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-page.d.ts","sourceRoot":"","sources":["../../class-generation/base-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAW,KAAK,iBAAiB,EAA8B,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAG9G,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"base-page.d.ts","sourceRoot":"","sources":["../../class-generation/base-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAW,KAAK,iBAAiB,EAA8B,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAG9G,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAiCrH;;;;;;;;GAQG;AACH;;;GAGG;AACH,KAAK,UAAU,CAAC,CAAC,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
92
|
*/
|
|
93
93
|
customPomFixtures?: string[];
|
|
94
|
+
/** Write `component-graph.json` next to the generated manifest. Requires `generateFixtures`. */
|
|
95
|
+
componentGraph?: boolean;
|
|
94
96
|
/**
|
|
95
97
|
* Handwritten POM helper attachments. These helpers are assumed to be present in the
|
|
96
98
|
* aggregated output (e.g. via `tests/playwright/pom/custom/*.ts` inlining), but we only attach them to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAE5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAE5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAwB7D,OAAO,EAeL,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EASvB,MAAM,UAAU,CAAC;AAuBlB,OAAO,EAAE,oCAAoC,EAAE,CAAC;AA2ChD,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,UAAU;IAClB,+FAA+F;IAC/F,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,UAAU,SAAS;IACjB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAID,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,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