@simplysf/simply-utam 0.1.7 → 0.3.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/README.md +124 -1
- package/lib/clipboard.d.ts +31 -0
- package/lib/clipboard.js +98 -0
- package/lib/clipboard.js.map +1 -0
- package/lib/commands/init.d.ts +2 -1
- package/lib/commands/init.js +39 -13
- package/lib/commands/init.js.map +1 -1
- package/lib/commands/snapshot/console/import.d.ts +26 -0
- package/lib/commands/snapshot/console/import.js +96 -0
- package/lib/commands/snapshot/console/import.js.map +1 -0
- package/lib/commands/snapshot/console/snippet.d.ts +25 -0
- package/lib/commands/snapshot/console/snippet.js +72 -0
- package/lib/commands/snapshot/console/snippet.js.map +1 -0
- package/lib/commands/snapshot/find.d.ts +25 -0
- package/lib/commands/snapshot/find.js +82 -0
- package/lib/commands/snapshot/find.js.map +1 -0
- package/lib/commands/snapshot/lookup.d.ts +20 -0
- package/lib/commands/snapshot/lookup.js +57 -0
- package/lib/commands/snapshot/lookup.js.map +1 -0
- package/lib/commands/snapshot/node.d.ts +22 -0
- package/lib/commands/snapshot/node.js +61 -0
- package/lib/commands/snapshot/node.js.map +1 -0
- package/lib/commands/snapshot/path.d.ts +21 -0
- package/lib/commands/snapshot/path.js +77 -0
- package/lib/commands/snapshot/path.js.map +1 -0
- package/lib/commands/snapshot/tree.d.ts +19 -0
- package/lib/commands/snapshot/tree.js +50 -0
- package/lib/commands/snapshot/tree.js.map +1 -0
- package/lib/snapshot-flags.d.ts +40 -0
- package/lib/snapshot-flags.js +70 -0
- package/lib/snapshot-flags.js.map +1 -0
- package/oclif.manifest.json +553 -3
- package/package.json +16 -4
- package/skills/utam-dom-snapshots/SKILL.md +390 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import * as path from 'node:path';
|
|
17
|
+
import { Flags } from '@oclif/core';
|
|
18
|
+
import { DEFAULT_OUTPUT_LIMIT, LATEST_SNAPSHOT, buildPageObjectIndex, readDomSnapshot, snapshotHeader, } from '@simplysf/simply-utam-core';
|
|
19
|
+
/** Flags the `snapshot` commands share. */
|
|
20
|
+
export const fileFlag = {
|
|
21
|
+
file: Flags.string({
|
|
22
|
+
summary: `Snapshot file to read, relative to the current folder (not --project-dir). Defaults to ${LATEST_SNAPSHOT} in the project, the most recent snapshot.`,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
export const projectDirFlag = {
|
|
26
|
+
'project-dir': Flags.string({
|
|
27
|
+
summary: 'Root directory of the test project.',
|
|
28
|
+
default: '.',
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
export const limitFlag = {
|
|
32
|
+
limit: Flags.integer({
|
|
33
|
+
summary: `Maximum lines of text output (default ${DEFAULT_OUTPUT_LIMIT}).`,
|
|
34
|
+
default: DEFAULT_OUTPUT_LIMIT,
|
|
35
|
+
min: 1,
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
/** Exit code 2: bad input, such as a missing snapshot, an unknown handle, or conflicting arguments. */
|
|
39
|
+
export const BAD_INPUT = 2;
|
|
40
|
+
/**
|
|
41
|
+
* The header for a snapshot read from, or saved to, `file`, naming the file relative to the current
|
|
42
|
+
* folder.
|
|
43
|
+
*
|
|
44
|
+
* @param projectDir The test project.
|
|
45
|
+
* @param file The snapshot's file, absolute or relative to the current folder.
|
|
46
|
+
* @param snapshot The snapshot.
|
|
47
|
+
* @param index The page-object index, when the command has one; otherwise it's built only for UTAM's
|
|
48
|
+
* not-found error.
|
|
49
|
+
*/
|
|
50
|
+
export function headerFor(projectDir, file, snapshot, index) {
|
|
51
|
+
const resolved = path.resolve(file);
|
|
52
|
+
return snapshotHeader(snapshot, {
|
|
53
|
+
file: path.relative(process.cwd(), resolved) || resolved,
|
|
54
|
+
index: index ?? (() => buildPageObjectIndex({ projectDir })),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Read the snapshot a query command was pointed at, and the header that names it.
|
|
59
|
+
*
|
|
60
|
+
* @param projectDir The test project.
|
|
61
|
+
* @param file The `--file` flag; the project's latest snapshot when omitted.
|
|
62
|
+
* @param index The page-object index, when the command has one; otherwise it's built only for UTAM's
|
|
63
|
+
* not-found error.
|
|
64
|
+
*/
|
|
65
|
+
export async function loadSnapshot(projectDir, file, index) {
|
|
66
|
+
const resolved = file ? path.resolve(file) : path.resolve(projectDir, LATEST_SNAPSHOT);
|
|
67
|
+
const snapshot = await readDomSnapshot(resolved);
|
|
68
|
+
return { snapshot, header: headerFor(projectDir, resolved, snapshot, index) };
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=snapshot-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-flags.js","sourceRoot":"","sources":["../src/snapshot-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,cAAc,GAGf,MAAM,4BAA4B,CAAC;AAEpC,2CAA2C;AAC3C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,0FAA0F,eAAe,4CAA4C;KAC/J,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,qCAAqC;QAC9C,OAAO,EAAE,GAAG;KACb,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;QACnB,OAAO,EAAE,yCAAyC,oBAAoB,IAAI;QAC1E,OAAO,EAAE,oBAAoB;QAC7B,GAAG,EAAE,CAAC;KACP,CAAC;CACH,CAAC;AAEF,uGAAuG;AACvG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC;AAQ3B;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,UAAkB,EAAE,IAAY,EAAE,QAAqB,EAAE,KAAmB;IACpG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,cAAc,CAAC,QAAQ,EAAE;QAC9B,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,IAAI,QAAQ;QACxD,KAAK,EAAE,KAAK,IAAI,CAAC,GAAoB,EAAE,CAAC,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;KAC9E,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,UAAkB,EAAE,IAAa,EAAE,KAAmB;IACvF,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IACvF,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;IACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;AAChF,CAAC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"init": {
|
|
91
91
|
"aliases": [],
|
|
92
92
|
"args": {},
|
|
93
|
-
"description": "Inspects the target project, generates generator.config.json, utam.config.json, wdio.conf.mjs, and .utam/namespace-map.json, non-destructively injects standard Wireit tasks into package.json, and adds any missing UTAM rules to .forceignore under a \"# Ignore UTAM\" comment without changing existing lines.",
|
|
93
|
+
"description": "Inspects the target project, generates generator.config.json, utam.config.json, wdio.conf.mjs, and .utam/namespace-map.json, adds the DOM snapshot capture step to the UTAM test folder, non-destructively injects standard Wireit tasks into package.json, and adds any missing UTAM rules to .forceignore and .gitignore under a \"# Ignore UTAM\" comment without changing existing lines.",
|
|
94
94
|
"examples": [
|
|
95
95
|
"<%= config.bin %> <%= command.id %>",
|
|
96
96
|
"<%= config.bin %> <%= command.id %> --source-dir force-app --app-name my-app",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"app-name": {
|
|
125
125
|
"char": "a",
|
|
126
126
|
"name": "app-name",
|
|
127
|
-
"summary": "Application name for UTAM namespaces (defaults to package.json name).",
|
|
127
|
+
"summary": "Application name for UTAM namespaces (defaults to package.json name, scope included).",
|
|
128
128
|
"hasDynamicHelp": false,
|
|
129
129
|
"multiple": false,
|
|
130
130
|
"type": "option"
|
|
@@ -165,6 +165,12 @@
|
|
|
165
165
|
"multiple": false,
|
|
166
166
|
"type": "option"
|
|
167
167
|
},
|
|
168
|
+
"gitignore": {
|
|
169
|
+
"name": "gitignore",
|
|
170
|
+
"summary": "Add .utam/snapshots/ to .gitignore, so DOM snapshots stay out of git.",
|
|
171
|
+
"allowNo": true,
|
|
172
|
+
"type": "boolean"
|
|
173
|
+
},
|
|
168
174
|
"verbose": {
|
|
169
175
|
"char": "v",
|
|
170
176
|
"name": "verbose",
|
|
@@ -485,7 +491,551 @@
|
|
|
485
491
|
"commands",
|
|
486
492
|
"steps.js"
|
|
487
493
|
]
|
|
494
|
+
},
|
|
495
|
+
"snapshot:find": {
|
|
496
|
+
"aliases": [],
|
|
497
|
+
"args": {},
|
|
498
|
+
"description": "Text matching is case-insensitive and substring, over each node's own text, its shadow text and its attribute values (not class). Record values are masked, so search by labels. Visible matches are listed first, in document order; hidden matches are counted, or listed with --all. --attr name=value is a case-insensitive substring match; --class matches one whole class token. --css tests a selector as UTAM's findElement would: every match in document order, the first (the one UTAM takes) marked, hidden ones included. It searches the document, or with --within a node's light DOM (a page object's elements) or, adding --shadow, its shadow root (shadow elements).",
|
|
499
|
+
"examples": [
|
|
500
|
+
"<%= config.bin %> <%= command.id %> --text \"Account Name\"",
|
|
501
|
+
"<%= config.bin %> <%= command.id %> --tag records-record-layout-item --all",
|
|
502
|
+
"<%= config.bin %> <%= command.id %> --attr title=Edit",
|
|
503
|
+
"<%= config.bin %> <%= command.id %> --css \"lightning-button.slds-button_brand\"",
|
|
504
|
+
"<%= config.bin %> <%= command.id %> --css \"lightning-input\" --within n5012 --shadow"
|
|
505
|
+
],
|
|
506
|
+
"flags": {
|
|
507
|
+
"json": {
|
|
508
|
+
"description": "Format output as json.",
|
|
509
|
+
"helpGroup": "GLOBAL",
|
|
510
|
+
"name": "json",
|
|
511
|
+
"allowNo": false,
|
|
512
|
+
"type": "boolean"
|
|
513
|
+
},
|
|
514
|
+
"text": {
|
|
515
|
+
"name": "text",
|
|
516
|
+
"summary": "Text to match (case-insensitive substring).",
|
|
517
|
+
"hasDynamicHelp": false,
|
|
518
|
+
"multiple": false,
|
|
519
|
+
"type": "option"
|
|
520
|
+
},
|
|
521
|
+
"attr": {
|
|
522
|
+
"name": "attr",
|
|
523
|
+
"summary": "Attribute to match: `name` (present) or `name=value` (substring).",
|
|
524
|
+
"hasDynamicHelp": false,
|
|
525
|
+
"multiple": false,
|
|
526
|
+
"type": "option"
|
|
527
|
+
},
|
|
528
|
+
"tag": {
|
|
529
|
+
"name": "tag",
|
|
530
|
+
"summary": "Tag name to match exactly.",
|
|
531
|
+
"hasDynamicHelp": false,
|
|
532
|
+
"multiple": false,
|
|
533
|
+
"type": "option"
|
|
534
|
+
},
|
|
535
|
+
"class": {
|
|
536
|
+
"name": "class",
|
|
537
|
+
"summary": "A whole class token to match, as `.name` would (case-sensitive).",
|
|
538
|
+
"hasDynamicHelp": false,
|
|
539
|
+
"multiple": false,
|
|
540
|
+
"type": "option"
|
|
541
|
+
},
|
|
542
|
+
"css": {
|
|
543
|
+
"exclusive": [
|
|
544
|
+
"text",
|
|
545
|
+
"attr",
|
|
546
|
+
"tag",
|
|
547
|
+
"class"
|
|
548
|
+
],
|
|
549
|
+
"name": "css",
|
|
550
|
+
"summary": "A CSS selector to test as UTAM would: all matches in document order, the first marked.",
|
|
551
|
+
"hasDynamicHelp": false,
|
|
552
|
+
"multiple": false,
|
|
553
|
+
"type": "option"
|
|
554
|
+
},
|
|
555
|
+
"within": {
|
|
556
|
+
"dependsOn": [
|
|
557
|
+
"css"
|
|
558
|
+
],
|
|
559
|
+
"name": "within",
|
|
560
|
+
"summary": "With --css: search under this node (its light DOM).",
|
|
561
|
+
"hasDynamicHelp": false,
|
|
562
|
+
"multiple": false,
|
|
563
|
+
"type": "option"
|
|
564
|
+
},
|
|
565
|
+
"shadow": {
|
|
566
|
+
"dependsOn": [
|
|
567
|
+
"css",
|
|
568
|
+
"within"
|
|
569
|
+
],
|
|
570
|
+
"name": "shadow",
|
|
571
|
+
"summary": "With --css and --within: search the node's shadow root instead.",
|
|
572
|
+
"allowNo": false,
|
|
573
|
+
"type": "boolean"
|
|
574
|
+
},
|
|
575
|
+
"all": {
|
|
576
|
+
"name": "all",
|
|
577
|
+
"summary": "List hidden matches in full rather than as a count.",
|
|
578
|
+
"allowNo": false,
|
|
579
|
+
"type": "boolean"
|
|
580
|
+
},
|
|
581
|
+
"file": {
|
|
582
|
+
"name": "file",
|
|
583
|
+
"summary": "Snapshot file to read, relative to the current folder (not --project-dir). Defaults to .utam/snapshots/latest.json in the project, the most recent snapshot.",
|
|
584
|
+
"hasDynamicHelp": false,
|
|
585
|
+
"multiple": false,
|
|
586
|
+
"type": "option"
|
|
587
|
+
},
|
|
588
|
+
"project-dir": {
|
|
589
|
+
"name": "project-dir",
|
|
590
|
+
"summary": "Root directory of the test project.",
|
|
591
|
+
"default": ".",
|
|
592
|
+
"hasDynamicHelp": false,
|
|
593
|
+
"multiple": false,
|
|
594
|
+
"type": "option"
|
|
595
|
+
},
|
|
596
|
+
"limit": {
|
|
597
|
+
"name": "limit",
|
|
598
|
+
"summary": "Maximum lines of text output (default 200).",
|
|
599
|
+
"default": 200,
|
|
600
|
+
"hasDynamicHelp": false,
|
|
601
|
+
"multiple": false,
|
|
602
|
+
"type": "option"
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
"hasDynamicHelp": false,
|
|
606
|
+
"hiddenAliases": [],
|
|
607
|
+
"id": "snapshot:find",
|
|
608
|
+
"pluginAlias": "@simplysf/simply-utam",
|
|
609
|
+
"pluginName": "@simplysf/simply-utam",
|
|
610
|
+
"pluginType": "core",
|
|
611
|
+
"strict": true,
|
|
612
|
+
"summary": "Find nodes in a DOM snapshot by text, attribute, class, tag or CSS selector.",
|
|
613
|
+
"enableJsonFlag": true,
|
|
614
|
+
"isESM": true,
|
|
615
|
+
"relativePath": [
|
|
616
|
+
"lib",
|
|
617
|
+
"commands",
|
|
618
|
+
"snapshot",
|
|
619
|
+
"find.js"
|
|
620
|
+
]
|
|
621
|
+
},
|
|
622
|
+
"snapshot:lookup": {
|
|
623
|
+
"aliases": [],
|
|
624
|
+
"args": {
|
|
625
|
+
"tag": {
|
|
626
|
+
"description": "A custom element tag, or a page object name.",
|
|
627
|
+
"name": "tag"
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
"description": "Reads the project's own page objects (from utam.config.json) and the page-object packages that generator.config.json namespaces and .utam/namespace-map.json map to, such as salesforce-pageobjects. A tag maps to a page object through a root selector, an element typed as that page object, or the naming convention. Where a tag maps to an implementation of an interface, the interface is reported, since test code loads the interface. Also accepts a page object name (such as recordHomeFlexipage2) instead of a tag. With --search, lists the page objects whose name, import path, tags or description contain every word given.",
|
|
631
|
+
"examples": [
|
|
632
|
+
"<%= config.bin %> <%= command.id %> lightning-input",
|
|
633
|
+
"<%= config.bin %> <%= command.id %> one-record-home-flexipage2",
|
|
634
|
+
"<%= config.bin %> <%= command.id %> recordLayoutItem",
|
|
635
|
+
"<%= config.bin %> <%= command.id %> --search \"related list\""
|
|
636
|
+
],
|
|
637
|
+
"flags": {
|
|
638
|
+
"json": {
|
|
639
|
+
"description": "Format output as json.",
|
|
640
|
+
"helpGroup": "GLOBAL",
|
|
641
|
+
"name": "json",
|
|
642
|
+
"allowNo": false,
|
|
643
|
+
"type": "boolean"
|
|
644
|
+
},
|
|
645
|
+
"search": {
|
|
646
|
+
"name": "search",
|
|
647
|
+
"summary": "Words to search for in page object names, import paths, tags and descriptions.",
|
|
648
|
+
"hasDynamicHelp": false,
|
|
649
|
+
"multiple": false,
|
|
650
|
+
"type": "option"
|
|
651
|
+
},
|
|
652
|
+
"project-dir": {
|
|
653
|
+
"name": "project-dir",
|
|
654
|
+
"summary": "Root directory of the test project.",
|
|
655
|
+
"default": ".",
|
|
656
|
+
"hasDynamicHelp": false,
|
|
657
|
+
"multiple": false,
|
|
658
|
+
"type": "option"
|
|
659
|
+
},
|
|
660
|
+
"limit": {
|
|
661
|
+
"name": "limit",
|
|
662
|
+
"summary": "Maximum lines of text output (default 200).",
|
|
663
|
+
"default": 200,
|
|
664
|
+
"hasDynamicHelp": false,
|
|
665
|
+
"multiple": false,
|
|
666
|
+
"type": "option"
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
"hasDynamicHelp": false,
|
|
670
|
+
"hiddenAliases": [],
|
|
671
|
+
"id": "snapshot:lookup",
|
|
672
|
+
"pluginAlias": "@simplysf/simply-utam",
|
|
673
|
+
"pluginName": "@simplysf/simply-utam",
|
|
674
|
+
"pluginType": "core",
|
|
675
|
+
"strict": true,
|
|
676
|
+
"summary": "Show the page objects for a tag, with their import paths, methods and elements; or search them.",
|
|
677
|
+
"enableJsonFlag": true,
|
|
678
|
+
"isESM": true,
|
|
679
|
+
"relativePath": [
|
|
680
|
+
"lib",
|
|
681
|
+
"commands",
|
|
682
|
+
"snapshot",
|
|
683
|
+
"lookup.js"
|
|
684
|
+
]
|
|
685
|
+
},
|
|
686
|
+
"snapshot:node": {
|
|
687
|
+
"aliases": [],
|
|
688
|
+
"args": {
|
|
689
|
+
"id": {
|
|
690
|
+
"description": "The node handle, such as n5012 (from find, path or tree).",
|
|
691
|
+
"name": "id"
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
"description": "Its handle and its address (child positions from the page root, s for a step into a shadow root; the same in another snapshot of the same page). Every recorded attribute, unclipped; its own text and shadow text; its size and position; whether it is hidden, and under which node; its parent; and each of its light DOM and shadow root children in one line. With --ancestors, its ancestors instead, nearest first, one line each, with a line wherever the chain leaves a shadow root: for picking a container to scope a selector with.",
|
|
695
|
+
"examples": [
|
|
696
|
+
"<%= config.bin %> <%= command.id %> n5012",
|
|
697
|
+
"<%= config.bin %> <%= command.id %> --node n5012",
|
|
698
|
+
"<%= config.bin %> <%= command.id %> n5012 --ancestors"
|
|
699
|
+
],
|
|
700
|
+
"flags": {
|
|
701
|
+
"json": {
|
|
702
|
+
"description": "Format output as json.",
|
|
703
|
+
"helpGroup": "GLOBAL",
|
|
704
|
+
"name": "json",
|
|
705
|
+
"allowNo": false,
|
|
706
|
+
"type": "boolean"
|
|
707
|
+
},
|
|
708
|
+
"node": {
|
|
709
|
+
"name": "node",
|
|
710
|
+
"summary": "The node handle, instead of the argument.",
|
|
711
|
+
"hasDynamicHelp": false,
|
|
712
|
+
"multiple": false,
|
|
713
|
+
"type": "option"
|
|
714
|
+
},
|
|
715
|
+
"ancestors": {
|
|
716
|
+
"name": "ancestors",
|
|
717
|
+
"summary": "List the node's ancestors, nearest first, instead.",
|
|
718
|
+
"allowNo": false,
|
|
719
|
+
"type": "boolean"
|
|
720
|
+
},
|
|
721
|
+
"file": {
|
|
722
|
+
"name": "file",
|
|
723
|
+
"summary": "Snapshot file to read, relative to the current folder (not --project-dir). Defaults to .utam/snapshots/latest.json in the project, the most recent snapshot.",
|
|
724
|
+
"hasDynamicHelp": false,
|
|
725
|
+
"multiple": false,
|
|
726
|
+
"type": "option"
|
|
727
|
+
},
|
|
728
|
+
"project-dir": {
|
|
729
|
+
"name": "project-dir",
|
|
730
|
+
"summary": "Root directory of the test project.",
|
|
731
|
+
"default": ".",
|
|
732
|
+
"hasDynamicHelp": false,
|
|
733
|
+
"multiple": false,
|
|
734
|
+
"type": "option"
|
|
735
|
+
},
|
|
736
|
+
"limit": {
|
|
737
|
+
"name": "limit",
|
|
738
|
+
"summary": "Maximum lines of text output (default 200).",
|
|
739
|
+
"default": 200,
|
|
740
|
+
"hasDynamicHelp": false,
|
|
741
|
+
"multiple": false,
|
|
742
|
+
"type": "option"
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
"hasDynamicHelp": false,
|
|
746
|
+
"hiddenAliases": [],
|
|
747
|
+
"id": "snapshot:node",
|
|
748
|
+
"pluginAlias": "@simplysf/simply-utam",
|
|
749
|
+
"pluginName": "@simplysf/simply-utam",
|
|
750
|
+
"pluginType": "core",
|
|
751
|
+
"strict": true,
|
|
752
|
+
"summary": "Show everything a snapshot recorded about one node.",
|
|
753
|
+
"enableJsonFlag": true,
|
|
754
|
+
"isESM": true,
|
|
755
|
+
"relativePath": [
|
|
756
|
+
"lib",
|
|
757
|
+
"commands",
|
|
758
|
+
"snapshot",
|
|
759
|
+
"node.js"
|
|
760
|
+
]
|
|
761
|
+
},
|
|
762
|
+
"snapshot:path": {
|
|
763
|
+
"aliases": [],
|
|
764
|
+
"args": {},
|
|
765
|
+
"description": "Marks each shadow crossing and each hidden ancestor, and annotates each custom element with its page object (import path, and root when utam.load can load it), a likely route through a page object above it (\"reachable through\"), or \"no page object found\". With --text, prints the path only when exactly one visible node matches; otherwise lists the candidates and exits with code 1.",
|
|
766
|
+
"examples": [
|
|
767
|
+
"<%= config.bin %> <%= command.id %> --node n5012",
|
|
768
|
+
"<%= config.bin %> <%= command.id %> --text \"Account Name\""
|
|
769
|
+
],
|
|
770
|
+
"flags": {
|
|
771
|
+
"json": {
|
|
772
|
+
"description": "Format output as json.",
|
|
773
|
+
"helpGroup": "GLOBAL",
|
|
774
|
+
"name": "json",
|
|
775
|
+
"allowNo": false,
|
|
776
|
+
"type": "boolean"
|
|
777
|
+
},
|
|
778
|
+
"node": {
|
|
779
|
+
"name": "node",
|
|
780
|
+
"summary": "The target node handle, such as n5012 (from find or tree).",
|
|
781
|
+
"hasDynamicHelp": false,
|
|
782
|
+
"multiple": false,
|
|
783
|
+
"type": "option"
|
|
784
|
+
},
|
|
785
|
+
"text": {
|
|
786
|
+
"name": "text",
|
|
787
|
+
"summary": "Find the target by text; it must have exactly one visible match.",
|
|
788
|
+
"hasDynamicHelp": false,
|
|
789
|
+
"multiple": false,
|
|
790
|
+
"type": "option"
|
|
791
|
+
},
|
|
792
|
+
"file": {
|
|
793
|
+
"name": "file",
|
|
794
|
+
"summary": "Snapshot file to read, relative to the current folder (not --project-dir). Defaults to .utam/snapshots/latest.json in the project, the most recent snapshot.",
|
|
795
|
+
"hasDynamicHelp": false,
|
|
796
|
+
"multiple": false,
|
|
797
|
+
"type": "option"
|
|
798
|
+
},
|
|
799
|
+
"project-dir": {
|
|
800
|
+
"name": "project-dir",
|
|
801
|
+
"summary": "Root directory of the test project.",
|
|
802
|
+
"default": ".",
|
|
803
|
+
"hasDynamicHelp": false,
|
|
804
|
+
"multiple": false,
|
|
805
|
+
"type": "option"
|
|
806
|
+
},
|
|
807
|
+
"limit": {
|
|
808
|
+
"name": "limit",
|
|
809
|
+
"summary": "Maximum lines of text output (default 200).",
|
|
810
|
+
"default": 200,
|
|
811
|
+
"hasDynamicHelp": false,
|
|
812
|
+
"multiple": false,
|
|
813
|
+
"type": "option"
|
|
814
|
+
}
|
|
815
|
+
},
|
|
816
|
+
"hasDynamicHelp": false,
|
|
817
|
+
"hiddenAliases": [],
|
|
818
|
+
"id": "snapshot:path",
|
|
819
|
+
"pluginAlias": "@simplysf/simply-utam",
|
|
820
|
+
"pluginName": "@simplysf/simply-utam",
|
|
821
|
+
"pluginType": "core",
|
|
822
|
+
"strict": true,
|
|
823
|
+
"summary": "Show the custom elements from the document down to a node, with their page objects.",
|
|
824
|
+
"enableJsonFlag": true,
|
|
825
|
+
"isESM": true,
|
|
826
|
+
"relativePath": [
|
|
827
|
+
"lib",
|
|
828
|
+
"commands",
|
|
829
|
+
"snapshot",
|
|
830
|
+
"path.js"
|
|
831
|
+
]
|
|
832
|
+
},
|
|
833
|
+
"snapshot:tree": {
|
|
834
|
+
"aliases": [],
|
|
835
|
+
"args": {},
|
|
836
|
+
"description": "Each line is one node: tag, #id and .classes as CSS, other attributes, its own text and its shadow text, then its node handle (n…). \"#shadow(mode)\" lines mark a shadow root; \"(hidden)\" marks the top of a hidden subtree.",
|
|
837
|
+
"examples": [
|
|
838
|
+
"<%= config.bin %> <%= command.id %> --node n5012 --depth 3"
|
|
839
|
+
],
|
|
840
|
+
"flags": {
|
|
841
|
+
"json": {
|
|
842
|
+
"description": "Format output as json.",
|
|
843
|
+
"helpGroup": "GLOBAL",
|
|
844
|
+
"name": "json",
|
|
845
|
+
"allowNo": false,
|
|
846
|
+
"type": "boolean"
|
|
847
|
+
},
|
|
848
|
+
"node": {
|
|
849
|
+
"name": "node",
|
|
850
|
+
"summary": "The node to start at. Defaults to the snapshot root.",
|
|
851
|
+
"hasDynamicHelp": false,
|
|
852
|
+
"multiple": false,
|
|
853
|
+
"type": "option"
|
|
854
|
+
},
|
|
855
|
+
"depth": {
|
|
856
|
+
"name": "depth",
|
|
857
|
+
"summary": "How many levels below the node to print.",
|
|
858
|
+
"default": 3,
|
|
859
|
+
"hasDynamicHelp": false,
|
|
860
|
+
"multiple": false,
|
|
861
|
+
"type": "option"
|
|
862
|
+
},
|
|
863
|
+
"file": {
|
|
864
|
+
"name": "file",
|
|
865
|
+
"summary": "Snapshot file to read, relative to the current folder (not --project-dir). Defaults to .utam/snapshots/latest.json in the project, the most recent snapshot.",
|
|
866
|
+
"hasDynamicHelp": false,
|
|
867
|
+
"multiple": false,
|
|
868
|
+
"type": "option"
|
|
869
|
+
},
|
|
870
|
+
"project-dir": {
|
|
871
|
+
"name": "project-dir",
|
|
872
|
+
"summary": "Root directory of the test project.",
|
|
873
|
+
"default": ".",
|
|
874
|
+
"hasDynamicHelp": false,
|
|
875
|
+
"multiple": false,
|
|
876
|
+
"type": "option"
|
|
877
|
+
},
|
|
878
|
+
"limit": {
|
|
879
|
+
"name": "limit",
|
|
880
|
+
"summary": "Maximum lines of text output (default 200).",
|
|
881
|
+
"default": 200,
|
|
882
|
+
"hasDynamicHelp": false,
|
|
883
|
+
"multiple": false,
|
|
884
|
+
"type": "option"
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
"hasDynamicHelp": false,
|
|
888
|
+
"hiddenAliases": [],
|
|
889
|
+
"id": "snapshot:tree",
|
|
890
|
+
"pluginAlias": "@simplysf/simply-utam",
|
|
891
|
+
"pluginName": "@simplysf/simply-utam",
|
|
892
|
+
"pluginType": "core",
|
|
893
|
+
"strict": true,
|
|
894
|
+
"summary": "Print the pruned tree under a node, to a depth.",
|
|
895
|
+
"enableJsonFlag": true,
|
|
896
|
+
"isESM": true,
|
|
897
|
+
"relativePath": [
|
|
898
|
+
"lib",
|
|
899
|
+
"commands",
|
|
900
|
+
"snapshot",
|
|
901
|
+
"tree.js"
|
|
902
|
+
]
|
|
903
|
+
},
|
|
904
|
+
"snapshot:console:import": {
|
|
905
|
+
"aliases": [],
|
|
906
|
+
"args": {},
|
|
907
|
+
"description": "Reads the clipboard by default, or --file (- for standard input). Checks the snapshot, saves it to .utam/snapshots/manual/ as manual--<label or number>.json and to latest.json, and prints the header every snapshot command prints. The rest of the snapshot is kept as captured.",
|
|
908
|
+
"examples": [
|
|
909
|
+
"<%= config.bin %> <%= command.id %> --label \"account list\"",
|
|
910
|
+
"<%= config.bin %> <%= command.id %> --file ~/Downloads/dom-snapshot-20261019T120000.json",
|
|
911
|
+
"pbpaste | <%= config.bin %> <%= command.id %> --file -"
|
|
912
|
+
],
|
|
913
|
+
"flags": {
|
|
914
|
+
"json": {
|
|
915
|
+
"description": "Format output as json.",
|
|
916
|
+
"helpGroup": "GLOBAL",
|
|
917
|
+
"name": "json",
|
|
918
|
+
"allowNo": false,
|
|
919
|
+
"type": "boolean"
|
|
920
|
+
},
|
|
921
|
+
"file": {
|
|
922
|
+
"name": "file",
|
|
923
|
+
"summary": "Snapshot file to read instead of the clipboard, relative to the current folder; - for standard input.",
|
|
924
|
+
"hasDynamicHelp": false,
|
|
925
|
+
"multiple": false,
|
|
926
|
+
"type": "option"
|
|
927
|
+
},
|
|
928
|
+
"label": {
|
|
929
|
+
"name": "label",
|
|
930
|
+
"summary": "Label for the snapshot, used in its file name and header.",
|
|
931
|
+
"hasDynamicHelp": false,
|
|
932
|
+
"multiple": false,
|
|
933
|
+
"type": "option"
|
|
934
|
+
},
|
|
935
|
+
"project-dir": {
|
|
936
|
+
"name": "project-dir",
|
|
937
|
+
"summary": "Root directory of the test project.",
|
|
938
|
+
"default": ".",
|
|
939
|
+
"hasDynamicHelp": false,
|
|
940
|
+
"multiple": false,
|
|
941
|
+
"type": "option"
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
"hasDynamicHelp": false,
|
|
945
|
+
"hiddenAliases": [],
|
|
946
|
+
"id": "snapshot:console:import",
|
|
947
|
+
"pluginAlias": "@simplysf/simply-utam",
|
|
948
|
+
"pluginName": "@simplysf/simply-utam",
|
|
949
|
+
"pluginType": "core",
|
|
950
|
+
"strict": true,
|
|
951
|
+
"summary": "Save the DOM snapshot the console snippet copied, or any snapshot file.",
|
|
952
|
+
"enableJsonFlag": true,
|
|
953
|
+
"isESM": true,
|
|
954
|
+
"relativePath": [
|
|
955
|
+
"lib",
|
|
956
|
+
"commands",
|
|
957
|
+
"snapshot",
|
|
958
|
+
"console",
|
|
959
|
+
"import.js"
|
|
960
|
+
]
|
|
961
|
+
},
|
|
962
|
+
"snapshot:console:snippet": {
|
|
963
|
+
"aliases": [],
|
|
964
|
+
"args": {},
|
|
965
|
+
"description": "Paste it into the console of the page to capture, with the console's context set to top. It runs the same walker a test run does, masks the page there, copies the snapshot JSON to the clipboard and prints a summary; save it with `snapshot console import`. Where the console's copy() isn't available, it downloads the JSON instead, for `import --file`. The mask is fixed in the snippet.",
|
|
966
|
+
"examples": [
|
|
967
|
+
"<%= config.bin %> <%= command.id %> --copy",
|
|
968
|
+
"<%= config.bin %> <%= command.id %> --mask structure --copy",
|
|
969
|
+
"<%= config.bin %> <%= command.id %> > snippet.js"
|
|
970
|
+
],
|
|
971
|
+
"flags": {
|
|
972
|
+
"json": {
|
|
973
|
+
"description": "Format output as json.",
|
|
974
|
+
"helpGroup": "GLOBAL",
|
|
975
|
+
"name": "json",
|
|
976
|
+
"allowNo": false,
|
|
977
|
+
"type": "boolean"
|
|
978
|
+
},
|
|
979
|
+
"copy": {
|
|
980
|
+
"name": "copy",
|
|
981
|
+
"summary": "Copy the snippet to the clipboard instead of printing it.",
|
|
982
|
+
"allowNo": false,
|
|
983
|
+
"type": "boolean"
|
|
984
|
+
},
|
|
985
|
+
"mask": {
|
|
986
|
+
"name": "mask",
|
|
987
|
+
"summary": "Mask mode, from least kept to most. Defaults to UTAM_SNAPSHOT_MASK, then labels.",
|
|
988
|
+
"hasDynamicHelp": false,
|
|
989
|
+
"multiple": false,
|
|
990
|
+
"options": [
|
|
991
|
+
"structure",
|
|
992
|
+
"labels",
|
|
993
|
+
"aria",
|
|
994
|
+
"full"
|
|
995
|
+
],
|
|
996
|
+
"type": "option"
|
|
997
|
+
},
|
|
998
|
+
"focus": {
|
|
999
|
+
"name": "focus",
|
|
1000
|
+
"summary": "Where the walk starts: auto (the active Lightning page or console tab), none, or a CSS selector.",
|
|
1001
|
+
"default": "auto",
|
|
1002
|
+
"hasDynamicHelp": false,
|
|
1003
|
+
"multiple": false,
|
|
1004
|
+
"type": "option"
|
|
1005
|
+
},
|
|
1006
|
+
"max-nodes": {
|
|
1007
|
+
"name": "max-nodes",
|
|
1008
|
+
"summary": "Most visible nodes to capture.",
|
|
1009
|
+
"hasDynamicHelp": false,
|
|
1010
|
+
"multiple": false,
|
|
1011
|
+
"type": "option"
|
|
1012
|
+
},
|
|
1013
|
+
"max-hidden-nodes": {
|
|
1014
|
+
"name": "max-hidden-nodes",
|
|
1015
|
+
"summary": "Most hidden nodes to capture.",
|
|
1016
|
+
"hasDynamicHelp": false,
|
|
1017
|
+
"multiple": false,
|
|
1018
|
+
"type": "option"
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
"hasDynamicHelp": false,
|
|
1022
|
+
"hiddenAliases": [],
|
|
1023
|
+
"id": "snapshot:console:snippet",
|
|
1024
|
+
"pluginAlias": "@simplysf/simply-utam",
|
|
1025
|
+
"pluginName": "@simplysf/simply-utam",
|
|
1026
|
+
"pluginType": "core",
|
|
1027
|
+
"strict": true,
|
|
1028
|
+
"summary": "The snippet to paste into a browser's DevTools console to capture a DOM snapshot.",
|
|
1029
|
+
"enableJsonFlag": true,
|
|
1030
|
+
"isESM": true,
|
|
1031
|
+
"relativePath": [
|
|
1032
|
+
"lib",
|
|
1033
|
+
"commands",
|
|
1034
|
+
"snapshot",
|
|
1035
|
+
"console",
|
|
1036
|
+
"snippet.js"
|
|
1037
|
+
]
|
|
488
1038
|
}
|
|
489
1039
|
},
|
|
490
|
-
"version": "0.
|
|
1040
|
+
"version": "0.3.0"
|
|
491
1041
|
}
|