@immense/vue-pom-generator 1.0.59 → 1.0.60
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 +30 -7
- package/RELEASE_NOTES.md +28 -76
- package/class-generation/base-page.ts +43 -12
- package/class-generation/index.ts +19 -18
- package/dist/class-generation/base-page.d.ts +7 -4
- package/dist/class-generation/base-page.d.ts.map +1 -1
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/index.cjs +332 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +332 -77
- package/dist/index.mjs.map +1 -1
- package/dist/manifest-generator.d.ts +35 -1
- package/dist/manifest-generator.d.ts.map +1 -1
- package/dist/method-generation.d.ts +2 -2
- package/dist/method-generation.d.ts.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/support/virtual-modules.d.ts +3 -1
- package/dist/plugin/support/virtual-modules.d.ts.map +1 -1
- package/dist/plugin/support-plugins.d.ts +2 -1
- package/dist/plugin/support-plugins.d.ts.map +1 -1
- package/dist/pom-discoverability.d.ts +10 -0
- package/dist/pom-discoverability.d.ts.map +1 -0
- package/dist/tests/fixtures/generated-tsc/base-page.full.d.ts +7 -4
- package/dist/tests/fixtures/generated-tsc/base-page.full.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,10 +12,11 @@ If you already use Playwright with `getByTestId`, the point is simple: this pack
|
|
|
12
12
|
- **Injects test ids during Vue compilation, not at runtime.** It hooks into the Vue template compiler and rewrites the compiled template output.
|
|
13
13
|
- **Uses real template signals to name ids and methods.** Click handlers, `v-model`, `id`/`name`, `:to`, wrapper configuration, and a few targeted fallbacks all feed the generated API.
|
|
14
14
|
- **Generates TypeScript POM output as either one aggregate or split per class, always with a stable `index.ts` barrel.**
|
|
15
|
+
- **Describes generated Playwright locators** with deterministic human-readable labels via `Locator.describe()`.
|
|
15
16
|
- **Can generate Playwright fixtures** so tests can request `userListPage` instead of constructing `new UserListPage(page)` manually.
|
|
16
17
|
- **Can fail fast on unnameable wrapper-button actions** so complex inline handlers do not silently degrade into low-signal generated APIs.
|
|
17
18
|
- **Can emit a single C# POM file** for Playwright .NET consumers.
|
|
18
|
-
- **Exposes `virtual:testids`** so your app can
|
|
19
|
+
- **Exposes `virtual:testids` and `virtual:pom-manifest`** so your app can inspect collected ids and generated POM metadata at runtime.
|
|
19
20
|
- **Ships ESLint rules** to remove legacy manually-authored test ids, ban raw `page` fixture usage in spec callbacks, and discourage raw locator actions on generated getters.
|
|
20
21
|
|
|
21
22
|
## What this does not do
|
|
@@ -347,8 +348,8 @@ This is important if you are deciding whether the tool will fit into a real code
|
|
|
347
348
|
|
|
348
349
|
- **Dev server:** on startup, it scans the configured Vue page/component/layout directories (or the directories resolved from Nuxt config in Nuxt mode), compiles each `.vue` file into a snapshot, writes the configured TypeScript outputs once, then batches add/change/delete events and regenerates incrementally.
|
|
349
350
|
- **Build:** it generates from the richest build pass it sees, which matters because Vite can run multiple passes (for example SSR plus client). The generator avoids letting a thinner pass clobber a richer one.
|
|
350
|
-
- **Always-on virtual
|
|
351
|
-
- **Generation can be disabled:** `generation: false` still keeps compile-time test-id injection and the virtual
|
|
351
|
+
- **Always-on virtual modules:** `virtual:testids` and `virtual:pom-manifest` are registered whether generation is enabled or disabled.
|
|
352
|
+
- **Generation can be disabled:** `generation: false` still keeps compile-time test-id injection and the virtual modules, but skips emitted POM files.
|
|
352
353
|
|
|
353
354
|
## Router-aware navigation: the real semantics
|
|
354
355
|
|
|
@@ -680,27 +681,49 @@ This package registers a Vite virtual module named `virtual:testids`.
|
|
|
680
681
|
Usage:
|
|
681
682
|
|
|
682
683
|
```ts
|
|
683
|
-
import { testIdManifest } from "virtual:testids";
|
|
684
|
+
import { pomManifest, testIdManifest } from "virtual:testids";
|
|
684
685
|
|
|
685
686
|
console.log(testIdManifest.UserEditorPage);
|
|
687
|
+
console.log(pomManifest.UserEditorPage.entries);
|
|
686
688
|
```
|
|
687
689
|
|
|
688
690
|
What it contains:
|
|
689
691
|
|
|
690
692
|
- an object keyed by component name
|
|
691
|
-
- each value is a sorted array of collected test ids for that component
|
|
693
|
+
- `testIdManifest`: each value is a sorted array of collected test ids for that component
|
|
694
|
+
- `pomManifest`: richer per-component metadata including source file, generated locator/property names, and generated action names
|
|
695
|
+
- each manifest entry also carries `locatorDescription`, which matches the human-readable label used by generated Playwright locators
|
|
692
696
|
|
|
693
697
|
What it is good for:
|
|
694
698
|
|
|
695
699
|
- runtime inspection
|
|
696
700
|
- analytics / logging helpers that need the current generated ids
|
|
697
|
-
- debugging what the generator has collected
|
|
701
|
+
- debugging what the generator has collected and generated
|
|
702
|
+
- keeping manifest-driven tools aligned with the same locator descriptions shown in Playwright traces
|
|
698
703
|
|
|
699
704
|
What it is not:
|
|
700
705
|
|
|
701
|
-
- a full metadata export
|
|
702
706
|
- a generated source file on disk
|
|
703
707
|
|
|
708
|
+
## `virtual:pom-manifest`
|
|
709
|
+
|
|
710
|
+
This package also registers `virtual:pom-manifest` for consumers that only want the richer discoverability surface.
|
|
711
|
+
|
|
712
|
+
Usage:
|
|
713
|
+
|
|
714
|
+
```ts
|
|
715
|
+
import { pomManifest } from "virtual:pom-manifest";
|
|
716
|
+
|
|
717
|
+
console.log(pomManifest.UserEditorPage.sourceFile);
|
|
718
|
+
console.log(pomManifest.UserEditorPage.entries.map(entry => entry.generatedActionNames));
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
What it contains:
|
|
722
|
+
|
|
723
|
+
- an object keyed by component/page object model class name
|
|
724
|
+
- for each component: source file, whether it is a view or component, sorted test ids, and rich entry metadata
|
|
725
|
+
- for each entry: test id, semantic name, inferred role, generated property name, generated action names, and collected compiler metadata when available
|
|
726
|
+
|
|
704
727
|
## ESLint rules that actually ship
|
|
705
728
|
|
|
706
729
|
The package exports `@immense/vue-pom-generator/eslint`.
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,93 +1,45 @@
|
|
|
1
|
-
●
|
|
1
|
+
● ## Highlights
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
- **
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- **Fail-fast error handling** – added early validation for dev snapshot generation and
|
|
11
|
-
unnameable handlers
|
|
12
|
-
- **Expanded test coverage** – new build–serve parity regression tests and additional test
|
|
13
|
-
suites
|
|
3
|
+
- **Manifest and locator descriptions**: Page Object Model (POM) manifests now include
|
|
4
|
+
human-readable descriptions for both routes and locators, improving discoverability and
|
|
5
|
+
developer experience
|
|
6
|
+
- **New discoverability module**: Added `pom-discoverability.ts` to centralize description
|
|
7
|
+
generation and introspection logic
|
|
8
|
+
- **Enhanced test coverage**: Expanded tests for class generation, virtual modules, and base
|
|
9
|
+
page functionality
|
|
14
10
|
|
|
15
11
|
## Changes
|
|
16
12
|
|
|
17
|
-
**Core
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
- Added `pom-params.ts` and `pom-patterns.ts` modules to centralize generation logic
|
|
21
|
-
- Improved routing `to-directive` handling for awaited handler wrappers
|
|
22
|
-
|
|
23
|
-
**Plugin System**
|
|
24
|
-
- Added `resolved-generation-options.ts` and `resolved-injection-options.ts` for clearer plugin
|
|
25
|
-
configuration
|
|
26
|
-
- Enhanced `create-vue-pom-generator-plugins`, build-plugin, and dev-plugin implementations
|
|
27
|
-
- Relaxed Vite peer dependency range for broader compatibility (#13)
|
|
28
|
-
|
|
29
|
-
**Bug Fixes**
|
|
30
|
-
- Fixed reparsing of generated test IDs (#21)
|
|
31
|
-
- Hardened local app integration (#19)
|
|
32
|
-
- Restored router DOM globals after introspection (#18)
|
|
33
|
-
- Resolved Nuxt app-root dev POM clobber (#15)
|
|
34
|
-
- Fixed keyed POM dedupe and C# navigation returns (#4)
|
|
35
|
-
|
|
36
|
-
**Error Handling & Validation**
|
|
37
|
-
- Added fail-fast on unnameable wrapper handlers (#11)
|
|
38
|
-
- Added fail-fast on dev snapshot generation errors (#6)
|
|
39
|
-
- Guarded manual releases (#16)
|
|
13
|
+
**Core Features**
|
|
14
|
+
- Added manifest and locator description generation for improved POM documentation (#24)
|
|
15
|
+
- Implemented new `pom-discoverability.ts` module for centralized description handling
|
|
40
16
|
|
|
41
|
-
**
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
17
|
+
**Generator Improvements**
|
|
18
|
+
- Enhanced `manifest-generator.ts` with description support (+256 lines)
|
|
19
|
+
- Updated method generation to include locator descriptions
|
|
20
|
+
- Improved base page class generation with description metadata
|
|
45
21
|
|
|
46
|
-
**
|
|
47
|
-
-
|
|
48
|
-
-
|
|
22
|
+
**Plugin & Integration**
|
|
23
|
+
- Updated virtual module system to support description exports
|
|
24
|
+
- Enhanced Vite plugin integration for description handling
|
|
49
25
|
|
|
50
|
-
**Testing**
|
|
51
|
-
- Added
|
|
52
|
-
-
|
|
53
|
-
-
|
|
26
|
+
**Testing & Documentation**
|
|
27
|
+
- Added class generation coverage tests
|
|
28
|
+
- Expanded virtual test ID tests with description validation
|
|
29
|
+
- Updated README with new feature documentation
|
|
30
|
+
- Refreshed generated TypeScript fixtures
|
|
54
31
|
|
|
55
32
|
## Breaking Changes
|
|
56
33
|
|
|
57
|
-
None
|
|
34
|
+
None
|
|
58
35
|
|
|
59
36
|
## Pull Requests Included
|
|
60
37
|
|
|
61
|
-
- #
|
|
62
|
-
(https://github.com/immense/vue-pom-generator/pull/
|
|
63
|
-
- #19 fix: harden local app integration (https://github.com/immense/vue-pom-generator/pull/19)
|
|
64
|
-
- #18 fix: restore router DOM globals after introspection
|
|
65
|
-
(https://github.com/immense/vue-pom-generator/pull/18)
|
|
66
|
-
- #17 fix: support awaited handler wrappers
|
|
67
|
-
(https://github.com/immense/vue-pom-generator/pull/17)
|
|
68
|
-
- #16 fix: guard manual releases (https://github.com/immense/vue-pom-generator/pull/16)
|
|
69
|
-
- #15 fix: resolve Nuxt app-root dev POM clobber
|
|
70
|
-
(https://github.com/immense/vue-pom-generator/pull/15)
|
|
71
|
-
- #13 Relax Vite peer dependency range (https://github.com/immense/vue-pom-generator/pull/13)
|
|
72
|
-
- #12 feat: add split Playwright POM output for discoverability
|
|
73
|
-
(https://github.com/immense/vue-pom-generator/pull/12)
|
|
74
|
-
- #11 feat: fail fast on unnameable wrapper handlers
|
|
75
|
-
(https://github.com/immense/vue-pom-generator/pull/11)
|
|
76
|
-
- #9 refactor(deps): eliminate all runtime dependencies
|
|
77
|
-
(https://github.com/immense/vue-pom-generator/pull/9)
|
|
78
|
-
- #7 test: add build–serve parity regression tests
|
|
79
|
-
(https://github.com/immense/vue-pom-generator/pull/7)
|
|
80
|
-
- #6 fix: fail fast on dev snapshot generation errors
|
|
81
|
-
(https://github.com/immense/vue-pom-generator/pull/6)
|
|
82
|
-
- #5 fix: dev-mode POM generation parity with build mode
|
|
83
|
-
(https://github.com/immense/vue-pom-generator/pull/5)
|
|
84
|
-
- #4 Fix keyed POM dedupe and C# navigation returns
|
|
85
|
-
(https://github.com/immense/vue-pom-generator/pull/4)
|
|
86
|
-
- #1 Add PR release-notes preview comments (https://github.com/immense/vue-pom-generator/pull/1)
|
|
38
|
+
- #24 feat: add manifest and locator descriptions
|
|
39
|
+
(https://github.com/immense/vue-pom-generator/pull/24)
|
|
87
40
|
|
|
88
41
|
## Testing
|
|
89
42
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
refactored architecture. All tests passing.
|
|
43
|
+
All changes include corresponding test coverage. Added new test suites for class generation
|
|
44
|
+
coverage and expanded virtual module tests to validate description functionality.
|
|
93
45
|
|
|
@@ -233,12 +233,22 @@ export class BasePage {
|
|
|
233
233
|
return `[${this.testIdAttribute}="${testId}"]`;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
protected
|
|
237
|
-
|
|
236
|
+
protected describeLocator(locator: PwLocator, description?: string): PwLocator {
|
|
237
|
+
const normalizedDescription = description?.trim();
|
|
238
|
+
return normalizedDescription ? locator.describe(normalizedDescription) : locator;
|
|
238
239
|
}
|
|
239
240
|
|
|
240
|
-
protected
|
|
241
|
-
return this.
|
|
241
|
+
protected locatorByTestId(testId: string, description?: string): PwLocator {
|
|
242
|
+
return this.describeLocator(this.page.locator(this.selectorForTestId(testId)), description);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
protected locatorWithinTestIdByLabel(
|
|
246
|
+
rootTestId: string,
|
|
247
|
+
label: string,
|
|
248
|
+
options?: { exact?: boolean; description?: string },
|
|
249
|
+
): PwLocator {
|
|
250
|
+
const locator = this.locatorByTestId(rootTestId).getByLabel(label, { exact: options?.exact ?? true });
|
|
251
|
+
return this.describeLocator(locator, options?.description);
|
|
242
252
|
}
|
|
243
253
|
|
|
244
254
|
/**
|
|
@@ -488,8 +498,14 @@ export class BasePage {
|
|
|
488
498
|
* Clicks on an element with the specified data-testid
|
|
489
499
|
* @param testId The data-testid of the element to click
|
|
490
500
|
*/
|
|
491
|
-
public async clickByTestId(
|
|
492
|
-
|
|
501
|
+
public async clickByTestId(
|
|
502
|
+
testId: string,
|
|
503
|
+
annotationText: string = "",
|
|
504
|
+
wait: boolean = true,
|
|
505
|
+
description?: string,
|
|
506
|
+
): Promise<void> {
|
|
507
|
+
const locator = this.locatorByTestId(testId, description);
|
|
508
|
+
await this.pointer.animateCursorToElement(locator, true, 200, annotationText, {
|
|
493
509
|
afterClick: async ({ testId: clickedTestId, instrumented }: AfterPointerClickInfo) => {
|
|
494
510
|
if (!wait) return;
|
|
495
511
|
if (!clickedTestId || !instrumented) return;
|
|
@@ -513,14 +529,23 @@ export class BasePage {
|
|
|
513
529
|
label: string,
|
|
514
530
|
annotationText: string = "",
|
|
515
531
|
wait: boolean = true,
|
|
516
|
-
options?: { exact?: boolean },
|
|
532
|
+
options?: { exact?: boolean; description?: string },
|
|
517
533
|
): Promise<void> {
|
|
518
|
-
const locator = this.locatorWithinTestIdByLabel(rootTestId, label, {
|
|
534
|
+
const locator = this.locatorWithinTestIdByLabel(rootTestId, label, {
|
|
535
|
+
exact: options?.exact,
|
|
536
|
+
description: options?.description,
|
|
537
|
+
});
|
|
519
538
|
await this.clickLocator(locator, annotationText, wait);
|
|
520
539
|
}
|
|
521
540
|
|
|
522
|
-
protected async fillInputByTestId(
|
|
523
|
-
|
|
541
|
+
protected async fillInputByTestId(
|
|
542
|
+
testId: string,
|
|
543
|
+
text: string,
|
|
544
|
+
annotationText: string = "",
|
|
545
|
+
description?: string,
|
|
546
|
+
): Promise<void> {
|
|
547
|
+
const locator = this.locatorByTestId(testId, description);
|
|
548
|
+
await this.pointer.animateCursorToElementAndClickAndFill(locator, text, true, 200, annotationText, {
|
|
524
549
|
afterClick: async ({ testId: clickedTestId, instrumented }: AfterPointerClickInfo) => {
|
|
525
550
|
if (!clickedTestId || !instrumented) return;
|
|
526
551
|
await this.waitForTestIdClickEventAfter(clickedTestId);
|
|
@@ -532,8 +557,14 @@ export class BasePage {
|
|
|
532
557
|
* Interacts with a vue-select control rooted by a data-testid.
|
|
533
558
|
* This is emitted frequently by the generator; keeping it here reduces per-page duplicated code.
|
|
534
559
|
*/
|
|
535
|
-
protected async selectVSelectByTestId(
|
|
536
|
-
|
|
560
|
+
protected async selectVSelectByTestId(
|
|
561
|
+
testId: string,
|
|
562
|
+
value: string,
|
|
563
|
+
timeOut: number = 500,
|
|
564
|
+
annotationText: string = "",
|
|
565
|
+
description?: string,
|
|
566
|
+
): Promise<void> {
|
|
567
|
+
const root = this.locatorByTestId(testId, description);
|
|
537
568
|
const input = root.locator("input");
|
|
538
569
|
|
|
539
570
|
await this.pointer.animateCursorToElement(input, false, 200, annotationText);
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
uniquePomStringPatterns,
|
|
29
29
|
type PomStringPattern,
|
|
30
30
|
} from "../pom-patterns";
|
|
31
|
+
import { buildPomLocatorDescription, stripPomActionPrefix } from "../pom-discoverability";
|
|
31
32
|
import { introspectNuxtPages, parseRouterFileFromCwd } from "../router-introspection";
|
|
32
33
|
import {
|
|
33
34
|
addExportAll,
|
|
@@ -348,7 +349,7 @@ function getSelectorPatterns(selector: PomSelectorSpec): PomStringPattern[] {
|
|
|
348
349
|
: [selector.rootTestId, selector.label];
|
|
349
350
|
}
|
|
350
351
|
|
|
351
|
-
function generateExtraClickMethodMembers(spec: PomExtraClickMethodSpec): TypeScriptClassMember[] {
|
|
352
|
+
function generateExtraClickMethodMembers(spec: PomExtraClickMethodSpec, componentName: string): TypeScriptClassMember[] {
|
|
352
353
|
if (spec.kind !== "click") {
|
|
353
354
|
return [];
|
|
354
355
|
}
|
|
@@ -365,20 +366,15 @@ function generateExtraClickMethodMembers(spec: PomExtraClickMethodSpec): TypeScr
|
|
|
365
366
|
const hasWait = signatureSpecs.some(param => param.name === "wait");
|
|
366
367
|
const annotationArg = hasAnnotationText ? "annotationText" : "\"\"";
|
|
367
368
|
const waitArg = hasWait ? "wait" : "true";
|
|
369
|
+
const locatorDescription = JSON.stringify(buildPomLocatorDescription({
|
|
370
|
+
componentName,
|
|
371
|
+
methodName: stripPomActionPrefix(spec.name),
|
|
372
|
+
nativeRole: "button",
|
|
373
|
+
}));
|
|
368
374
|
|
|
369
375
|
if (spec.selector.kind === "testId") {
|
|
370
376
|
const testIdBinding = bindTypeScriptPomPattern(spec.selector.testId, "testId");
|
|
371
377
|
|
|
372
|
-
const clickArgs: string[] = [];
|
|
373
|
-
clickArgs.push(testIdBinding.expression);
|
|
374
|
-
|
|
375
|
-
if (hasAnnotationText || hasWait) {
|
|
376
|
-
clickArgs.push(annotationArg);
|
|
377
|
-
}
|
|
378
|
-
if (hasWait) {
|
|
379
|
-
clickArgs.push(waitArg);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
378
|
return [
|
|
383
379
|
createClassMethod({
|
|
384
380
|
name: spec.name,
|
|
@@ -391,7 +387,7 @@ function generateExtraClickMethodMembers(spec: PomExtraClickMethodSpec): TypeScr
|
|
|
391
387
|
for (const statement of testIdBinding.setupStatements) {
|
|
392
388
|
writer.writeLine(statement);
|
|
393
389
|
}
|
|
394
|
-
writer.writeLine(`await this.clickByTestId(${
|
|
390
|
+
writer.writeLine(`await this.clickByTestId(${testIdBinding.expression}, ${annotationArg}, ${waitArg}, ${locatorDescription});`);
|
|
395
391
|
},
|
|
396
392
|
}),
|
|
397
393
|
];
|
|
@@ -414,18 +410,23 @@ function generateExtraClickMethodMembers(spec: PomExtraClickMethodSpec): TypeScr
|
|
|
414
410
|
for (const statement of labelBinding.setupStatements) {
|
|
415
411
|
writer.writeLine(statement);
|
|
416
412
|
}
|
|
417
|
-
writer.writeLine(`await this.clickWithinTestIdByLabel(${rootBinding.expression}, ${labelBinding.expression}, ${annotationArg}, ${waitArg});`);
|
|
413
|
+
writer.writeLine(`await this.clickWithinTestIdByLabel(${rootBinding.expression}, ${labelBinding.expression}, ${annotationArg}, ${waitArg}, { description: ${locatorDescription} });`);
|
|
418
414
|
},
|
|
419
415
|
}),
|
|
420
416
|
];
|
|
421
417
|
}
|
|
422
418
|
|
|
423
|
-
function generateMethodMembersFromPom(
|
|
419
|
+
function generateMethodMembersFromPom(
|
|
420
|
+
componentName: string,
|
|
421
|
+
primary: PomPrimarySpec,
|
|
422
|
+
targetPageObjectModelClass?: string,
|
|
423
|
+
): TypeScriptClassMember[] {
|
|
424
424
|
if (primary.emitPrimary === false) {
|
|
425
425
|
return [];
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
return generateViewObjectModelMembers(
|
|
429
|
+
componentName,
|
|
429
430
|
targetPageObjectModelClass,
|
|
430
431
|
primary.methodName,
|
|
431
432
|
primary.nativeRole,
|
|
@@ -436,7 +437,7 @@ function generateMethodMembersFromPom(primary: PomPrimarySpec, targetPageObjectM
|
|
|
436
437
|
);
|
|
437
438
|
}
|
|
438
439
|
|
|
439
|
-
function generateMethodsContentForDependencies(dependencies: IComponentDependencies): TypeScriptClassMember[] {
|
|
440
|
+
function generateMethodsContentForDependencies(componentName: string, dependencies: IComponentDependencies): TypeScriptClassMember[] {
|
|
440
441
|
const entries = Array.from(dependencies.dataTestIdSet ?? []);
|
|
441
442
|
const primarySpecsAll = entries
|
|
442
443
|
.map(e => ({ pom: e.pom, target: e.targetPageObjectModelClass }))
|
|
@@ -475,11 +476,11 @@ function generateMethodsContentForDependencies(dependencies: IComponentDependenc
|
|
|
475
476
|
|
|
476
477
|
const members: TypeScriptClassMember[] = [];
|
|
477
478
|
for (const { pom, target } of primarySpecs) {
|
|
478
|
-
members.push(...generateMethodMembersFromPom(pom, target));
|
|
479
|
+
members.push(...generateMethodMembersFromPom(componentName, pom, target));
|
|
479
480
|
}
|
|
480
481
|
|
|
481
482
|
for (const extra of extras) {
|
|
482
|
-
members.push(...generateExtraClickMethodMembers(extra));
|
|
483
|
+
members.push(...generateExtraClickMethodMembers(extra, componentName));
|
|
483
484
|
}
|
|
484
485
|
|
|
485
486
|
return members;
|
|
@@ -1698,7 +1699,7 @@ function prepareViewObjectModelClass(
|
|
|
1698
1699
|
members.push(...generateGoToSelfMethod(className));
|
|
1699
1700
|
}
|
|
1700
1701
|
|
|
1701
|
-
members.push(...generateMethodsContentForDependencies(dependencies));
|
|
1702
|
+
members.push(...generateMethodsContentForDependencies(componentName, dependencies));
|
|
1702
1703
|
|
|
1703
1704
|
return {
|
|
1704
1705
|
className,
|
|
@@ -52,9 +52,11 @@ export declare class BasePage {
|
|
|
52
52
|
get screencast(): PwPage["screencast"];
|
|
53
53
|
private waitForTestIdClickEventAfter;
|
|
54
54
|
protected selectorForTestId(testId: string): string;
|
|
55
|
-
protected
|
|
55
|
+
protected describeLocator(locator: PwLocator, description?: string): PwLocator;
|
|
56
|
+
protected locatorByTestId(testId: string, description?: string): PwLocator;
|
|
56
57
|
protected locatorWithinTestIdByLabel(rootTestId: string, label: string, options?: {
|
|
57
58
|
exact?: boolean;
|
|
59
|
+
description?: string;
|
|
58
60
|
}): PwLocator;
|
|
59
61
|
/**
|
|
60
62
|
* Animates the pointer to an element.
|
|
@@ -90,17 +92,18 @@ export declare class BasePage {
|
|
|
90
92
|
* Clicks on an element with the specified data-testid
|
|
91
93
|
* @param testId The data-testid of the element to click
|
|
92
94
|
*/
|
|
93
|
-
clickByTestId(testId: string, annotationText?: string, wait?: boolean): Promise<void>;
|
|
95
|
+
clickByTestId(testId: string, annotationText?: string, wait?: boolean, description?: string): Promise<void>;
|
|
94
96
|
clickLocator(locator: PwLocator, annotationText?: string, wait?: boolean): Promise<void>;
|
|
95
97
|
protected clickWithinTestIdByLabel(rootTestId: string, label: string, annotationText?: string, wait?: boolean, options?: {
|
|
96
98
|
exact?: boolean;
|
|
99
|
+
description?: string;
|
|
97
100
|
}): Promise<void>;
|
|
98
|
-
protected fillInputByTestId(testId: string, text: string, annotationText?: string): Promise<void>;
|
|
101
|
+
protected fillInputByTestId(testId: string, text: string, annotationText?: string, description?: string): Promise<void>;
|
|
99
102
|
/**
|
|
100
103
|
* Interacts with a vue-select control rooted by a data-testid.
|
|
101
104
|
* This is emitted frequently by the generator; keeping it here reduces per-page duplicated code.
|
|
102
105
|
*/
|
|
103
|
-
protected selectVSelectByTestId(testId: string, value: string, timeOut?: number, annotationText?: string): Promise<void>;
|
|
106
|
+
protected selectVSelectByTestId(testId: string, value: string, timeOut?: number, annotationText?: string, description?: string): Promise<void>;
|
|
104
107
|
fillInputByLocator(locator: PwLocator, text: string, annotationText?: string): Promise<void>;
|
|
105
108
|
protected clickByAriaLabel(ariaLabel: string, annotationText?: string): Promise<void>;
|
|
106
109
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-page.d.ts","sourceRoot":"","sources":["../../class-generation/base-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAW,KAAK,iBAAiB,EAA8B,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAe9G;;;;;;;;GAQG;AACH;;;GAGG;A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CAG7E"}
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAyC5G,OAAO,EACL,sBAAsB,EAOvB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,oCAAoC,EAAE,CAAC;AA2ChD,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,oBAAoB,CAAC;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AASD,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,OAAO,CAAC;AAqW/D,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAE1D;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhD;;;;;OAKG;IACH,oCAAoC,CAAC,EAAE,OAA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