venetian 0.2.2-aarch64-linux → 0.2.3-aarch64-linux

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/exe/aarch64-linux/LICENSE +2 -2
  3. data/exe/aarch64-linux/node +2 -2
  4. data/exe/aarch64-linux/package/browsers.json +9 -32
  5. data/exe/aarch64-linux/package/lib/coreBundle.js +5402 -4419
  6. data/exe/aarch64-linux/package/lib/server/electron/loader.js +0 -2
  7. data/exe/aarch64-linux/package/lib/serverRegistry.js +1674 -7082
  8. data/exe/aarch64-linux/package/lib/serverRegistry.js.LICENSE +8 -297
  9. data/exe/aarch64-linux/package/lib/tools/cli-client/help.json +19 -6
  10. data/exe/aarch64-linux/package/lib/tools/cli-client/minimist.js +1 -1
  11. data/exe/aarch64-linux/package/lib/tools/cli-client/output.js +9 -1
  12. data/exe/aarch64-linux/package/lib/tools/cli-client/program.js +17 -3
  13. data/exe/aarch64-linux/package/lib/tools/cli-client/registry.js +9 -5
  14. data/exe/aarch64-linux/package/lib/tools/cli-client/session.js +2 -1
  15. data/exe/aarch64-linux/package/lib/tools/skills/playwright-cli/SKILL.md +5 -0
  16. data/exe/aarch64-linux/package/lib/tools/skills/playwright-cli/references/tracing.md +1 -1
  17. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/SKILL.md +4 -11
  18. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/migration.md +6 -2
  19. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/react.md +2 -0
  20. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  21. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/vue.md +2 -0
  22. data/exe/aarch64-linux/package/lib/tools/skills/playwright-trace/SKILL.md +6 -3
  23. data/exe/aarch64-linux/package/lib/tools/utils/extension.js +13 -2
  24. data/exe/aarch64-linux/package/lib/utilsBundle.js +1934 -7341
  25. data/exe/aarch64-linux/package/lib/utilsBundle.js.LICENSE +8 -297
  26. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  27. data/exe/aarch64-linux/package/lib/vite/{recorder/assets/codeMirrorModule-CwYYHbcZ.js → dashboard/assets/codeMirrorModule-CQ8RZGBm.js} +1 -1
  28. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  29. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  30. data/exe/aarch64-linux/package/lib/vite/dashboard/index.html +2 -2
  31. data/exe/aarch64-linux/package/lib/vite/htmlReport/report.css +1 -1
  32. data/exe/aarch64-linux/package/lib/vite/htmlReport/report.js +4 -4
  33. data/exe/aarch64-linux/package/lib/vite/recorder/assets/codeMirrorModule-CVQWJZAA.js +32 -0
  34. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  35. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-hrlLqLtq.js +129 -0
  36. data/exe/aarch64-linux/package/lib/vite/recorder/index.html +2 -2
  37. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/{codeMirrorModule-rXmQmLUY.js → codeMirrorModule-BbkfBe3n.js} +1 -1
  38. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-Ds6CBOo0.js +182 -0
  39. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/{xtermModule-BuZfJS5v.js → xtermModule-DywYcAf8.js} +1 -1
  40. data/exe/aarch64-linux/package/lib/vite/traceViewer/defaultSettingsView.Bqk9acqE.css +1 -0
  41. data/exe/aarch64-linux/package/lib/vite/traceViewer/index.B4cLoZK3.js +1 -0
  42. data/exe/aarch64-linux/package/lib/vite/traceViewer/index.html +3 -3
  43. data/exe/aarch64-linux/package/lib/vite/traceViewer/sw.bundle.js +3 -3
  44. data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.CU5KtEkS.js +5 -0
  45. data/exe/aarch64-linux/package/lib/vite/traceViewer/{uiMode.C7UW1sC9.css → uiMode.CyMfwkXJ.css} +1 -1
  46. data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.html +4 -4
  47. data/exe/aarch64-linux/package/package.json +1 -1
  48. data/exe/aarch64-linux/package/types/protocol.d.ts +201 -398
  49. data/exe/aarch64-linux/package/types/types.d.ts +771 -327
  50. data/lib/venetian/version.rb +2 -2
  51. metadata +21 -18
  52. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-CyWAfh-p.js +0 -11
  53. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-DhC616m4.css +0 -1
  54. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-DYjdXIbE.js +0 -129
  55. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-l_lX622x.css +0 -1
  56. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-B-dXF5JN.js +0 -181
  57. data/exe/aarch64-linux/package/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +0 -1
  58. data/exe/aarch64-linux/package/lib/vite/traceViewer/index.KZ4wOW1K.js +0 -1
  59. data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.Dzuouizj.js +0 -5
@@ -22,6 +22,9 @@ form for the test to assert on). Plain data props travel through `mount(storyId,
22
22
  | `ctViteConfig`, `ctPort`, `ctTemplateDir`, `ctCacheDir` | Gone — the gallery runs through the app's own dev server; port lives in `webServer` + `baseURL`; location is `playwright/gallery/` |
23
23
  | `defineConfig` from `@playwright/experimental-ct-react` | Plain `defineConfig` from `@playwright/test`, with `baseURL` = gallery URL, `serviceWorkers: 'block'`, `reuseContext: true` (see `SKILL.md`) |
24
24
 
25
+ The CT packages were removed in Playwright 1.63 and are no longer published, so migrate while
26
+ pinned to Playwright 1.62 and upgrade once the last spec is ported.
27
+
25
28
  ## Steps
26
29
 
27
30
  1. Set up the gallery and config per `SKILL.md`. Keep the old CT project running until the last
@@ -39,13 +42,14 @@ form for the test to assert on). Plain data props travel through `mount(storyId,
39
42
  4. Port `beforeMount` hooks: app-wide setup into the gallery's `window.mount`; per-test
40
43
  `hooksConfig` branches into props interpreted by a story or decorator.
41
44
  5. When all specs are green, delete the CT project from the config, drop the
42
- `@playwright/experimental-ct-*` dependency, and remove `playwright/index.html`,
43
- `playwright/index.ts*` and `playwright/.cache`.
45
+ `@playwright/experimental-ct-*` dependency, remove `playwright/index.html`,
46
+ `playwright/index.ts*` and `playwright/.cache`, and lift the Playwright version pin.
44
47
 
45
48
  ## Gotchas
46
49
 
47
50
  - **Story ids are strings.** Renaming or moving a story breaks specs at runtime, not compile time
48
51
  — and the suffix-matching resolution can silently match a different story after a rename.
52
+ Gallery types (`typing.md`) turn registered ids into a compile-time check.
49
53
  - **Per-test JSX is gone.** Any test that built a different JSX tree per test (children matrices,
50
54
  inline wrappers) becomes one story export per composition.
51
55
 
@@ -57,6 +57,8 @@ import type { WithTitle } from './Button.story';
57
57
  const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
58
58
  ```
59
59
 
60
+ Alternatively, generate gallery types so the id itself is typed and no type import is needed: `mount('acme-ui/components/Button/WithTitle', { title: 'Hello' })` — see `references/typing.md`.
61
+
60
62
  ## CSS
61
63
 
62
64
  - Global stylesheets: import them in your gallery entry (`playwright/gallery/main.tsx`, e.g. `import '../../src/index.css'`), mirroring the app's own entry point.
@@ -0,0 +1,173 @@
1
+ # Typing `mount()`
2
+
3
+ `mount(storyId, props?)` accepts any string id and any serializable props. Two optional layers
4
+ add type checking on top; both are supported and can be mixed in one project.
5
+
6
+ | | Explicit story type | Gallery types |
7
+ |---|---|---|
8
+ | Call | `mount<typeof WithTitle>('components/Button/WithTitle', { title })` | `mount('acme-ui/components/Button/WithTitle', { title })` |
9
+ | Checks | props and `update()` | props, `update()`, and the id itself (autocomplete, rename safety) |
10
+ | Needs | `import type { WithTitle } from './Button.story'` in the spec | a generated `stories.d.ts` kept in sync by a gallery plugin |
11
+ | Id grammar | any suffix the gallery resolves | full id, prefixed with the package name |
12
+
13
+ ## Explicit story type
14
+
15
+ Pass the story type as a template argument. Nothing to set up; works in every project.
16
+
17
+ ```ts
18
+ import type { WithTitle } from './Button.story';
19
+
20
+ const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
21
+ await component.update({ title: 'Again' });
22
+ ```
23
+
24
+ Use `import type` so the story (and with it React/Vue and CSS imports) is never loaded into the
25
+ Node test process. Function components, class components and `defineComponent` stories all infer
26
+ their props; see the `Typed props` sections in `react.md` / `vue.md` for framework details.
27
+
28
+ ## Gallery types
29
+
30
+ `@playwright/test` exports an empty `interface Stories {}`. When a story id is a key of `Stories`,
31
+ `mount` types the props from that entry; any other string keeps untyped props, so adoption can be
32
+ partial. A tiny Vite plugin next to the gallery generates `stories.d.ts`, which fills `Stories` in
33
+ via module augmentation:
34
+
35
+ ```ts
36
+ // playwright/gallery/stories.d.ts (generated)
37
+ type StoriesOf<Prefix extends string, Mod> = { [K in keyof Mod & string as `${Prefix}/${K}`]: Mod[K] };
38
+
39
+ declare module '@playwright/test' {
40
+ interface Stories extends
41
+ StoriesOf<'acme-ui/components/Button', typeof import('../../src/components/Button.story')>,
42
+ StoriesOf<'acme-ui/components/Expandable', typeof import('../../src/components/Expandable.story')> {}
43
+ }
44
+
45
+ export {};
46
+ ```
47
+
48
+ One line per story file; export names and prop types come from the story module itself, so the
49
+ file only changes when a story file is added, removed or moved. Specs then need no type imports:
50
+
51
+ ```ts
52
+ const component = await mount('acme-ui/components/Button/WithTitle', { title: 'Hello' });
53
+ // ^ autocompletes registered ids ^ checked against WithTitle's props
54
+ ```
55
+
56
+ ### Namespace ids with the package name
57
+
58
+ `Stories` is merged per TypeScript program. In a monorepo whose packages share one `tsconfig`,
59
+ two packages both registering `components/Button/Default` with different props fail with
60
+ `TS2320: Interface 'Stories' cannot simultaneously extend types ...` at the `Stories` declaration,
61
+ and even distinct ids leak into each other's autocomplete. Prefix every id with the package name,
62
+ `<package>/<path under src>/<Export>`, from the start, so the convention holds when a project
63
+ becomes a package. Read the name from `package.json` in both places that derive ids, so they
64
+ cannot drift:
65
+
66
+ ```ts
67
+ // playwright/gallery/main.tsx
68
+ import packageJSON from '../../package.json';
69
+
70
+ const id = (f: string) => packageJSON.name + '/' + f.replace(/^(\.\.\/)+src\//, '').replace(/\.story\.\w+$/, '');
71
+ ```
72
+
73
+ Suffix resolution keeps working at runtime, so `mount('Button/Primary')` still renders; only the
74
+ full prefixed id is typed.
75
+
76
+ ### The plugin
77
+
78
+ Framework-agnostic: it only lists story files. Adjust `storyFile` to match the gallery's glob.
79
+
80
+ ```ts
81
+ // playwright/gallery/storyTypes.ts
82
+ import fs from 'fs';
83
+ import path from 'path';
84
+ import type { Plugin } from 'vite';
85
+
86
+ const storyFile = /\.story\.(tsx|jsx)$/;
87
+
88
+ export function storyTypes(options: { prefix: string, src: string, outFile: string }): Plugin {
89
+ const generate = () => {
90
+ const content = render(listStoryFiles(options.src), options);
91
+ if (fs.existsSync(options.outFile) && fs.readFileSync(options.outFile, 'utf8') === content)
92
+ return;
93
+ fs.writeFileSync(options.outFile, content);
94
+ };
95
+ return {
96
+ name: 'story-types',
97
+ buildStart() {
98
+ this.addWatchFile(options.src);
99
+ generate();
100
+ },
101
+ configureServer(server) {
102
+ const onFile = (file: string) => {
103
+ if (storyFile.test(file))
104
+ generate();
105
+ };
106
+ server.watcher.on('add', onFile);
107
+ server.watcher.on('unlink', onFile);
108
+ },
109
+ };
110
+ }
111
+
112
+ function listStoryFiles(dir: string): string[] {
113
+ const result: string[] = [];
114
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
115
+ const file = path.join(dir, entry.name);
116
+ if (entry.isDirectory())
117
+ result.push(...listStoryFiles(file));
118
+ else if (storyFile.test(entry.name))
119
+ result.push(file);
120
+ }
121
+ return result.sort();
122
+ }
123
+
124
+ function render(files: string[], { prefix, src, outFile }: { prefix: string, src: string, outFile: string }): string {
125
+ const outDir = path.dirname(outFile);
126
+ const posix = (p: string) => p.split(path.sep).join('/');
127
+ const entries = files.map(file => {
128
+ const id = prefix + '/' + posix(path.relative(src, file)).replace(storyFile, '');
129
+ const specifier = posix(path.relative(outDir, file)).replace(/\.\w+$/, '');
130
+ return ` StoriesOf<'${id}', typeof import('${specifier.startsWith('.') ? specifier : './' + specifier}')>`;
131
+ });
132
+ const stories = entries.length ? `interface Stories extends\n${entries.join(',\n')} {}` : 'interface Stories {}';
133
+ return `// Generated by storyTypes.ts, do not edit.
134
+
135
+ type StoriesOf<Prefix extends string, Mod> = { [K in keyof Mod & string as \`\${Prefix}/\${K}\`]: Mod[K] };
136
+
137
+ declare module '@playwright/test' {
138
+ ${stories}
139
+ }
140
+
141
+ export {};
142
+ `;
143
+ }
144
+ ```
145
+
146
+ Register it on whichever Vite server serves the gallery (the app's `vite.config.ts`, or the
147
+ standalone `playwright/vite.config.ts`):
148
+
149
+ ```ts
150
+ import packageJSON from './package.json';
151
+ import { storyTypes } from './playwright/gallery/storyTypes';
152
+
153
+ export default defineConfig({
154
+ plugins: [
155
+ react(),
156
+ storyTypes({
157
+ prefix: packageJSON.name,
158
+ src: path.resolve(__dirname, 'src'),
159
+ outFile: path.resolve(__dirname, 'playwright/gallery/stories.d.ts'),
160
+ }),
161
+ ],
162
+ });
163
+ ```
164
+
165
+ The file is regenerated on every dev-server start and build, and while the server runs, whenever
166
+ a story file appears or disappears. Its content is deterministic, so **commit it**: type-checking
167
+ in CI or an editor must not depend on a running dev server. Nothing imports the file, so list it
168
+ explicitly in the project's `tsconfig` (`"files": ["playwright/gallery/stories.d.ts"]`) so that
169
+ `tsc` and editors load it.
170
+
171
+ For `.story.vue` single-file components, map the `default` export to the bare path in
172
+ `StoriesOf` (`K extends 'default' ? Prefix : \`${Prefix}/${K}\``) and rely on `vue-tsc` for the
173
+ SFC's types; a story without inferable props types as `unknown` props, which accepts anything.
@@ -68,6 +68,8 @@ import type { WithTitle } from './Button.story';
68
68
  const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
69
69
  ```
70
70
 
71
+ Alternatively, generate gallery types so the id itself is typed and no type import is needed: `mount('acme-ui/components/Button/WithTitle', { title: 'Hello' })` — see `references/typing.md`.
72
+
71
73
  Options-API stories (`defineComponent({ props: { ... } })`) infer props the same way. For `.story.vue` SFC stories, prop types are only inferable when the setup generates SFC types (Volar/vue-tsc); otherwise pass the props type directly: `mount<{ title?: string }>('components/Button.primary', { title: 'Hello' })`.
72
74
 
73
75
  ## CSS
@@ -55,12 +55,12 @@ npx playwright trace actions --errors-only
55
55
  npx playwright trace action <action-id>
56
56
  ```
57
57
 
58
- The `action` command displays available snapshot phases (before, input, after) and the exact command to extract them.
58
+ The `action` command displays available snapshot phases (before, action, after) and the exact command to extract them.
59
59
 
60
60
  ### Requests
61
61
 
62
62
  ```bash
63
- # All network requests: method, status, URL, duration, size
63
+ # All network requests: start time (on the `trace actions` clock), method, status, URL, duration, size
64
64
  npx playwright trace requests
65
65
 
66
66
  # Filter by URL pattern
@@ -94,6 +94,9 @@ npx playwright trace console --browser
94
94
 
95
95
  # Only stdout/stderr (no browser console)
96
96
  npx playwright trace console --stdio
97
+
98
+ # Filter by message text pattern
99
+ npx playwright trace console --grep "failed to fetch"
97
100
  ```
98
101
 
99
102
  ### Errors
@@ -112,7 +115,7 @@ The `snapshot` command loads the DOM snapshot for an action into a headless brow
112
115
  npx playwright trace snapshot <action-id>
113
116
 
114
117
  # Use a specific phase
115
- npx playwright trace snapshot <action-id> --name before
118
+ npx playwright trace snapshot <action-id> --phase before
116
119
 
117
120
  # Run eval to query the DOM
118
121
  npx playwright trace snapshot <action-id> -- eval "document.title"
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var extension_exports = {};
30
30
  __export(extension_exports, {
31
31
  findPlaywrightExtensionProfile: () => findPlaywrightExtensionProfile,
32
+ isExtensionInstalledInProfile: () => isExtensionInstalledInProfile,
32
33
  isPlaywrightExtensionInstalled: () => isPlaywrightExtensionInstalled,
33
34
  playwrightExtensionId: () => playwrightExtensionId,
34
35
  playwrightExtensionInstallUrl: () => playwrightExtensionInstallUrl
@@ -77,12 +78,21 @@ async function isPlaywrightExtensionInstalled(userDataDir) {
77
78
  async function isExtensionInstalledInProfile(profileDir) {
78
79
  if (await pathExists(import_path.default.join(profileDir, "Extensions", playwrightExtensionId)))
79
80
  return true;
81
+ for (const fileName of ["Preferences", "Secure Preferences"]) {
82
+ if (await hasExtensionSettingsRecord(import_path.default.join(profileDir, fileName)))
83
+ return true;
84
+ }
85
+ return false;
86
+ }
87
+ async function hasExtensionSettingsRecord(prefsPath) {
88
+ let prefs;
80
89
  try {
81
- const prefs = await import_fs.default.promises.readFile(import_path.default.join(profileDir, "Preferences"), "utf-8");
82
- return prefs.includes(`"${playwrightExtensionId}"`);
90
+ prefs = JSON.parse(await import_fs.default.promises.readFile(prefsPath, "utf-8"));
83
91
  } catch {
84
92
  return false;
85
93
  }
94
+ const record = prefs?.extensions?.settings?.[playwrightExtensionId];
95
+ return !!record && typeof record === "object" && Object.keys(record).length > 0;
86
96
  }
87
97
  async function pathExists(p) {
88
98
  try {
@@ -95,6 +105,7 @@ async function pathExists(p) {
95
105
  // Annotate the CommonJS export names for ESM import in node:
96
106
  0 && (module.exports = {
97
107
  findPlaywrightExtensionProfile,
108
+ isExtensionInstalledInProfile,
98
109
  isPlaywrightExtensionInstalled,
99
110
  playwrightExtensionId,
100
111
  playwrightExtensionInstallUrl