@cloud411716/fancy-webnovel 0.1.78 → 0.1.80
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/package.json +4 -1
- package/plugins/fancy-scan/scripts/scan-output-format.md +1 -1
- package/plugins/fancy-scan/scripts/scraper-registry.md +12 -12
- package/plugins/fancy-scan/scripts/scrapers/cdp-utils.cjs +11 -186
- package/plugins/fancy-scan/scripts/scrapers/node_modules/.package-lock.json +0 -20
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/LICENSE +0 -202
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/NOTICE +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/README.md +0 -3
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/ThirdPartyNotices.txt +0 -13
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/install_media_pack.ps1 +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +0 -33
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +0 -42
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +0 -13
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +0 -42
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +0 -12
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +0 -48
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +0 -23
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +0 -48
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +0 -23
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +0 -48
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/browsers.json +0 -75
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/cli.js +0 -21
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/index.d.ts +0 -17
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/index.js +0 -17
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/index.mjs +0 -28
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/bootstrap.js +0 -88
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/coreBundle.js +0 -74830
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/cliDaemon.js +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/dashboardApp.js +0 -3
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/mcp.js +0 -10
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +0 -3
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/package.js +0 -50
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/server/electron/loader.js +0 -118
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/serverRegistry.js +0 -7347
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +0 -354
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +0 -141
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/cli.js +0 -6
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/help.json +0 -708
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/minimist.js +0 -128
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/output.js +0 -343
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/program.js +0 -404
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/registry.js +0 -176
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/session.js +0 -258
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +0 -420
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +0 -23
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +0 -39
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +0 -87
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +0 -241
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +0 -225
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +0 -275
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +0 -433
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +0 -139
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +0 -143
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +0 -143
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +0 -144
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +0 -85
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +0 -67
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +0 -75
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +0 -171
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/utils/extension.js +0 -101
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/utils/socketConnection.js +0 -108
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/utilsBundle.js +0 -90764
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +0 -2179
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/index.html +0 -29
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/htmlReport/index.html +0 -16
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/htmlReport/report.css +0 -2
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/htmlReport/report.js +0 -32
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CwYYHbcZ.js +0 -32
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/index-DYjdXIbE.js +0 -129
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/index.html +0 -29
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +0 -9
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-rXmQmLUY.js +0 -32
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-B-dXF5JN.js +0 -181
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-BuZfJS5v.js +0 -7
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/index.KZ4wOW1K.js +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/index.html +0 -44
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +0 -16
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +0 -9
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +0 -10
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +0 -4
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/uiMode.C7UW1sC9.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Dzuouizj.js +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +0 -18
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/webp_codec.LICENSE +0 -173
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/xdg-open +0 -1267
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/package.json +0 -34
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/types/protocol.d.ts +0 -24842
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/types/structs.d.ts +0 -52
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/types/types.d.ts +0 -26188
- package/plugins/fancy-scan/scripts/scrapers/package.json +0 -9
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# React setup
|
|
2
|
-
|
|
3
|
-
Follow the setup workflow in `SKILL.md`. Implement the gallery per `references/gallery-spec.md` (which has a React worked example); this page covers React-specific details.
|
|
4
|
-
|
|
5
|
-
## Files
|
|
6
|
-
|
|
7
|
-
- `playwright/gallery/` — the gallery you implement to `references/gallery-spec.md` (an `index.html` + a `main.tsx` module). Requires `react` and `react-dom` 18+ (`createRoot`).
|
|
8
|
-
- Stories: `src/**/*.story.tsx` (the glob also picks up `.story.jsx`); example in `templates/react/Button.story.tsx`.
|
|
9
|
-
|
|
10
|
-
## StrictMode
|
|
11
|
-
|
|
12
|
-
Wrap the rendered story in `<React.StrictMode>` in your gallery to match how most apps render. In development builds StrictMode intentionally double-invokes render functions and effects. This matters for stories that record events with counters set in effects — recording via state updates from event handlers (like the `CountsClicks` example story) is unaffected. If a story misbehaves under StrictMode, that is usually a real finding about the component; drop the wrapper only if the app itself does not use StrictMode.
|
|
13
|
-
|
|
14
|
-
## Global providers
|
|
15
|
-
|
|
16
|
-
If components require context (theme, store, i18n, router), create one shared decorator and use it in stories, so each story states its scenario and nothing more:
|
|
17
|
-
|
|
18
|
-
```tsx
|
|
19
|
-
// src/stories/decorators.tsx
|
|
20
|
-
import { ThemeProvider } from '../theme';
|
|
21
|
-
import { MemoryRouter } from 'react-router-dom';
|
|
22
|
-
|
|
23
|
-
export function AppScaffold({ children, route = '/' }: { children: React.ReactNode, route?: string }) {
|
|
24
|
-
return (
|
|
25
|
-
<ThemeProvider theme="light">
|
|
26
|
-
<MemoryRouter initialEntries={[route]}>{children}</MemoryRouter>
|
|
27
|
-
</ThemeProvider>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```tsx
|
|
33
|
-
// src/components/ProfilePage.story.tsx
|
|
34
|
-
export const LoggedIn = () => (
|
|
35
|
-
<AppScaffold route="/profile/42">
|
|
36
|
-
<ProfilePage user={{ id: 42, name: 'Test User' }} />
|
|
37
|
-
</AppScaffold>
|
|
38
|
-
);
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Do not build the decorator into the gallery — keeping it in story files makes the wrapping visible and lets stories opt out.
|
|
42
|
-
|
|
43
|
-
## Typed props
|
|
44
|
-
|
|
45
|
-
`mount` is generic over the story: pass the story type as a template argument to type-check per-test props (and `update()`). Props are inferred from the component signature; function and class components both work.
|
|
46
|
-
|
|
47
|
-
```tsx
|
|
48
|
-
// src/components/Button.story.tsx
|
|
49
|
-
export const WithTitle = ({ title = 'Default' }: { title?: string }) =>
|
|
50
|
-
<Button title={title} />;
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
// src/components/button.spec.ts
|
|
55
|
-
import type { WithTitle } from './Button.story';
|
|
56
|
-
|
|
57
|
-
const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## CSS
|
|
61
|
-
|
|
62
|
-
- 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.
|
|
63
|
-
- Tailwind: if content scanning is path-based, make sure `*.story.tsx` files are covered.
|
|
64
|
-
|
|
65
|
-
## Data fetching
|
|
66
|
-
|
|
67
|
-
For libraries with client objects (React Query, Apollo), create the client inside the story or decorator so each navigation starts fresh.
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Vue setup
|
|
2
|
-
|
|
3
|
-
Follow the setup workflow in `SKILL.md`. Implement the gallery per `references/gallery-spec.md`, exposing `window.mount`/`window.unmount` — in Vue, mount with `app = createApp(h(story, props)); app.mount('#root')` and unmount with `app.unmount()`; this page covers Vue-specific details.
|
|
4
|
-
|
|
5
|
-
## Files
|
|
6
|
-
|
|
7
|
-
- `playwright/gallery/` — the gallery you implement to `references/gallery-spec.md` (an `index.html` + a `main.ts` module). Requires Vue 3.
|
|
8
|
-
- Stories: `src/**/*.story.{ts,js,vue}`; example in `templates/vue/Button.story.ts`.
|
|
9
|
-
|
|
10
|
-
## Two ways to write stories
|
|
11
|
-
|
|
12
|
-
**Render-function stories** (`Button.story.ts`) — several scenarios per file, one named export each; see `templates/vue/Button.story.ts`. Uses `defineComponent` + `h()`, no SFC compilation involved.
|
|
13
|
-
|
|
14
|
-
**Single-file-component stories** (`Button.primary.story.vue`) — one story per file, full template syntax:
|
|
15
|
-
|
|
16
|
-
```vue
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
import { ref } from 'vue';
|
|
19
|
-
import Button from './Button.vue';
|
|
20
|
-
const clicks = ref(0);
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<Button title="Submit" @click="clicks++" />
|
|
25
|
-
<form hidden><input data-testid="click-count" readonly :value="String(clicks)" /></form>
|
|
26
|
-
</template>
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
An SFC story is addressed by its path without the extension: `mount('components/Button.primary')`. Prefer SFC stories when the scenario needs slots or non-trivial templates.
|
|
30
|
-
|
|
31
|
-
## Global plugins
|
|
32
|
-
|
|
33
|
-
Apps that rely on plugins (Pinia, vue-router, i18n) should wrap components with a decorator story helper that creates a fresh instance per story:
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
// src/stories/decorators.ts
|
|
37
|
-
import { defineComponent, h, type Component } from 'vue';
|
|
38
|
-
import { createPinia } from 'pinia';
|
|
39
|
-
|
|
40
|
-
export function withStore(story: Component) {
|
|
41
|
-
return defineComponent(() => {
|
|
42
|
-
const pinia = createPinia();
|
|
43
|
-
return () => h(story, { pinia });
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
For plugins that must be installed on the app instance (`app.use(...)`), add them in your gallery right after `createApp(...)` — that is the equivalent of the app's own bootstrap.
|
|
49
|
-
|
|
50
|
-
## Typed props
|
|
51
|
-
|
|
52
|
-
A story that takes per-test props declares them twice: in the setup signature (for the type) and in the `props` option (so Vue delivers them as props rather than `attrs`):
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
// src/components/Button.story.ts
|
|
56
|
-
export const WithTitle = defineComponent(
|
|
57
|
-
(props: { title?: string }) => () => h(Button, { title: props.title ?? 'Default' }),
|
|
58
|
-
{ props: ['title'] },
|
|
59
|
-
);
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
`mount` is generic over the story: pass the story type as a template argument to type-check the props (and `update()`):
|
|
63
|
-
|
|
64
|
-
```ts
|
|
65
|
-
// src/components/button.spec.ts
|
|
66
|
-
import type { WithTitle } from './Button.story';
|
|
67
|
-
|
|
68
|
-
const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
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
|
-
|
|
73
|
-
## CSS
|
|
74
|
-
|
|
75
|
-
Import global stylesheets in your gallery entry (`playwright/gallery/main.ts`, e.g. `import '../../src/assets/main.css'`), mirroring the app's entry point.
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: playwright-trace
|
|
3
|
-
description: Inspect Playwright trace files from the command line — list actions, view requests, console, errors, snapshots and screenshots.
|
|
4
|
-
allowed-tools: Bash(npx:*)
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Playwright Trace CLI
|
|
8
|
-
|
|
9
|
-
Inspect `.zip` trace files produced by Playwright tests without opening a browser.
|
|
10
|
-
|
|
11
|
-
## Workflow
|
|
12
|
-
|
|
13
|
-
1. Start with `trace open <trace.zip>` to extract the trace and see its metadata.
|
|
14
|
-
2. Use `trace actions` to see all actions with their action IDs.
|
|
15
|
-
3. Use `trace action <action-id>` to drill into a specific action — see parameters, logs, source location, and available snapshots.
|
|
16
|
-
4. Use `trace requests`, `trace console`, or `trace errors` for cross-cutting views.
|
|
17
|
-
5. Use `trace snapshot <action-id>` to get the DOM snapshot, or run a browser command against it.
|
|
18
|
-
6. Use `trace close` to remove the extracted trace data when done.
|
|
19
|
-
|
|
20
|
-
All commands after `open` operate on the currently opened trace — no need to pass the trace file again. Opening a new trace replaces the previous one.
|
|
21
|
-
|
|
22
|
-
## Commands
|
|
23
|
-
|
|
24
|
-
### Open a trace
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
# Extract trace and show metadata: browser, viewport, duration, action/error counts
|
|
28
|
-
npx playwright trace open <trace.zip>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Close a trace
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Remove extracted trace data
|
|
35
|
-
npx playwright trace close
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Actions
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# List all actions as a tree with action IDs and timing
|
|
42
|
-
npx playwright trace actions
|
|
43
|
-
|
|
44
|
-
# Filter by action title (regex, case-insensitive)
|
|
45
|
-
npx playwright trace actions --grep "click"
|
|
46
|
-
|
|
47
|
-
# Only failed actions
|
|
48
|
-
npx playwright trace actions --errors-only
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Action details
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
# Show full details for one action: params, result, logs, source, snapshots
|
|
55
|
-
npx playwright trace action <action-id>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
The `action` command displays available snapshot phases (before, input, after) and the exact command to extract them.
|
|
59
|
-
|
|
60
|
-
### Requests
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# All network requests: method, status, URL, duration, size
|
|
64
|
-
npx playwright trace requests
|
|
65
|
-
|
|
66
|
-
# Filter by URL pattern
|
|
67
|
-
npx playwright trace requests --grep "api"
|
|
68
|
-
|
|
69
|
-
# Filter by HTTP method
|
|
70
|
-
npx playwright trace requests --method POST
|
|
71
|
-
|
|
72
|
-
# Only failed requests (status >= 400)
|
|
73
|
-
npx playwright trace requests --failed
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Request details
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
# Show full details for one request: headers, body, security
|
|
80
|
-
npx playwright trace request <request-id>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Console
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# All console messages and stdout/stderr
|
|
87
|
-
npx playwright trace console
|
|
88
|
-
|
|
89
|
-
# Only errors
|
|
90
|
-
npx playwright trace console --errors-only
|
|
91
|
-
|
|
92
|
-
# Only browser console (no stdout/stderr)
|
|
93
|
-
npx playwright trace console --browser
|
|
94
|
-
|
|
95
|
-
# Only stdout/stderr (no browser console)
|
|
96
|
-
npx playwright trace console --stdio
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Errors
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
# All errors with stack traces and associated actions
|
|
103
|
-
npx playwright trace errors
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Snapshots
|
|
107
|
-
|
|
108
|
-
The `snapshot` command loads the DOM snapshot for an action into a headless browser and runs a single browser command against it. Without a browser command, it returns the accessibility snapshot.
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
# Get the accessibility snapshot (default)
|
|
112
|
-
npx playwright trace snapshot <action-id>
|
|
113
|
-
|
|
114
|
-
# Use a specific phase
|
|
115
|
-
npx playwright trace snapshot <action-id> --name before
|
|
116
|
-
|
|
117
|
-
# Run eval to query the DOM
|
|
118
|
-
npx playwright trace snapshot <action-id> -- eval "document.title"
|
|
119
|
-
npx playwright trace snapshot <action-id> -- eval "document.querySelector('#error').textContent"
|
|
120
|
-
|
|
121
|
-
# Eval on a specific element ref (from the snapshot)
|
|
122
|
-
npx playwright trace snapshot <action-id> -- eval "el => el.getAttribute('data-testid')" e5
|
|
123
|
-
|
|
124
|
-
# Take a screenshot of the snapshot
|
|
125
|
-
npx playwright trace snapshot <action-id> -- screenshot
|
|
126
|
-
|
|
127
|
-
# Redirect output to a file
|
|
128
|
-
npx playwright trace snapshot <action-id> -- eval "document.body.outerHTML" --filename=page.html
|
|
129
|
-
npx playwright trace snapshot <action-id> -- screenshot --filename=screenshot.png
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Only three browser commands are useful on a frozen snapshot: `snapshot`, `eval`, and `screenshot`.
|
|
133
|
-
|
|
134
|
-
### Attachments
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# List all trace attachments
|
|
138
|
-
npx playwright trace attachments
|
|
139
|
-
|
|
140
|
-
# Extract an attachment by its number
|
|
141
|
-
npx playwright trace attachment 1
|
|
142
|
-
npx playwright trace attachment 1 -o out.png
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## Typical investigation
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# 1. Open the trace and see what's inside
|
|
149
|
-
npx playwright trace open test-results/my-test/trace.zip
|
|
150
|
-
|
|
151
|
-
# 2. What actions ran?
|
|
152
|
-
npx playwright trace actions
|
|
153
|
-
|
|
154
|
-
# 3. Which action failed?
|
|
155
|
-
npx playwright trace actions --errors-only
|
|
156
|
-
|
|
157
|
-
# 4. What went wrong?
|
|
158
|
-
npx playwright trace action 12
|
|
159
|
-
|
|
160
|
-
# 5. What did the page look like at that moment?
|
|
161
|
-
npx playwright trace snapshot 12
|
|
162
|
-
|
|
163
|
-
# 6. Query the DOM for more detail
|
|
164
|
-
npx playwright trace snapshot 12 -- eval "document.querySelector('.error-message').textContent"
|
|
165
|
-
|
|
166
|
-
# 7. Any relevant network failures?
|
|
167
|
-
npx playwright trace requests --failed
|
|
168
|
-
|
|
169
|
-
# 8. Any console errors?
|
|
170
|
-
npx playwright trace console --errors-only
|
|
171
|
-
```
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var extension_exports = {};
|
|
30
|
-
__export(extension_exports, {
|
|
31
|
-
findPlaywrightExtensionProfile: () => findPlaywrightExtensionProfile,
|
|
32
|
-
isPlaywrightExtensionInstalled: () => isPlaywrightExtensionInstalled,
|
|
33
|
-
playwrightExtensionId: () => playwrightExtensionId,
|
|
34
|
-
playwrightExtensionInstallUrl: () => playwrightExtensionInstallUrl
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(extension_exports);
|
|
37
|
-
var import_fs = __toESM(require("fs"));
|
|
38
|
-
var import_path = __toESM(require("path"));
|
|
39
|
-
const playwrightExtensionId = "mmlmfjhmonkocbjadbfplnigmagldckm";
|
|
40
|
-
const playwrightExtensionInstallUrl = `https://chromewebstore.google.com/detail/playwright-extension/${playwrightExtensionId}`;
|
|
41
|
-
async function findPlaywrightExtensionProfile(userDataDir) {
|
|
42
|
-
const profiles = await listProfileDirectories(userDataDir);
|
|
43
|
-
const lastUsed = await readLastUsedProfile(userDataDir);
|
|
44
|
-
const ordered = lastUsed && profiles.includes(lastUsed) ? [lastUsed, ...profiles.filter((profile) => profile !== lastUsed)] : profiles;
|
|
45
|
-
for (const profile of ordered) {
|
|
46
|
-
if (await isExtensionInstalledInProfile(import_path.default.join(userDataDir, profile)))
|
|
47
|
-
return profile;
|
|
48
|
-
}
|
|
49
|
-
return void 0;
|
|
50
|
-
}
|
|
51
|
-
async function listProfileDirectories(userDataDir) {
|
|
52
|
-
let entries;
|
|
53
|
-
try {
|
|
54
|
-
entries = await import_fs.default.promises.readdir(userDataDir);
|
|
55
|
-
} catch {
|
|
56
|
-
return [];
|
|
57
|
-
}
|
|
58
|
-
const profiles = entries.filter((entry) => entry === "Default" || /^Profile \d+$/.test(entry));
|
|
59
|
-
profiles.sort((a, b) => profileRank(a) - profileRank(b));
|
|
60
|
-
return profiles;
|
|
61
|
-
}
|
|
62
|
-
function profileRank(profile) {
|
|
63
|
-
return profile === "Default" ? -1 : parseInt(profile.slice("Profile ".length), 10);
|
|
64
|
-
}
|
|
65
|
-
async function readLastUsedProfile(userDataDir) {
|
|
66
|
-
try {
|
|
67
|
-
const localState = JSON.parse(await import_fs.default.promises.readFile(import_path.default.join(userDataDir, "Local State"), "utf-8"));
|
|
68
|
-
const lastUsed = localState?.profile?.last_used;
|
|
69
|
-
return typeof lastUsed === "string" ? lastUsed : void 0;
|
|
70
|
-
} catch {
|
|
71
|
-
return void 0;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async function isPlaywrightExtensionInstalled(userDataDir) {
|
|
75
|
-
return await findPlaywrightExtensionProfile(userDataDir) !== void 0;
|
|
76
|
-
}
|
|
77
|
-
async function isExtensionInstalledInProfile(profileDir) {
|
|
78
|
-
if (await pathExists(import_path.default.join(profileDir, "Extensions", playwrightExtensionId)))
|
|
79
|
-
return true;
|
|
80
|
-
try {
|
|
81
|
-
const prefs = await import_fs.default.promises.readFile(import_path.default.join(profileDir, "Preferences"), "utf-8");
|
|
82
|
-
return prefs.includes(`"${playwrightExtensionId}"`);
|
|
83
|
-
} catch {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async function pathExists(p) {
|
|
88
|
-
try {
|
|
89
|
-
await import_fs.default.promises.access(p);
|
|
90
|
-
return true;
|
|
91
|
-
} catch {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
-
0 && (module.exports = {
|
|
97
|
-
findPlaywrightExtensionProfile,
|
|
98
|
-
isPlaywrightExtensionInstalled,
|
|
99
|
-
playwrightExtensionId,
|
|
100
|
-
playwrightExtensionInstallUrl
|
|
101
|
-
});
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var socketConnection_exports = {};
|
|
20
|
-
__export(socketConnection_exports, {
|
|
21
|
-
SocketConnection: () => SocketConnection,
|
|
22
|
-
compareSemver: () => compareSemver
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(socketConnection_exports);
|
|
25
|
-
class SocketConnection {
|
|
26
|
-
constructor(socket) {
|
|
27
|
-
this._pendingBuffers = [];
|
|
28
|
-
this._socket = socket;
|
|
29
|
-
socket.on("data", (buffer) => this._onData(buffer));
|
|
30
|
-
socket.on("close", () => {
|
|
31
|
-
this.onclose?.();
|
|
32
|
-
});
|
|
33
|
-
socket.on("error", (e) => console.error(`error: ${e.message}`));
|
|
34
|
-
}
|
|
35
|
-
async send(message) {
|
|
36
|
-
await new Promise((resolve, reject) => {
|
|
37
|
-
this._socket.write(`${JSON.stringify(message)}
|
|
38
|
-
`, (error) => {
|
|
39
|
-
if (error)
|
|
40
|
-
reject(error);
|
|
41
|
-
else
|
|
42
|
-
resolve(void 0);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
close() {
|
|
47
|
-
this._socket.destroy();
|
|
48
|
-
}
|
|
49
|
-
_onData(buffer) {
|
|
50
|
-
let end = buffer.indexOf("\n");
|
|
51
|
-
if (end === -1) {
|
|
52
|
-
this._pendingBuffers.push(buffer);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
this._pendingBuffers.push(buffer.slice(0, end));
|
|
56
|
-
const message = Buffer.concat(this._pendingBuffers).toString();
|
|
57
|
-
this._dispatchMessage(message);
|
|
58
|
-
let start = end + 1;
|
|
59
|
-
end = buffer.indexOf("\n", start);
|
|
60
|
-
while (end !== -1) {
|
|
61
|
-
const message2 = buffer.toString(void 0, start, end);
|
|
62
|
-
this._dispatchMessage(message2);
|
|
63
|
-
start = end + 1;
|
|
64
|
-
end = buffer.indexOf("\n", start);
|
|
65
|
-
}
|
|
66
|
-
this._pendingBuffers = [buffer.slice(start)];
|
|
67
|
-
}
|
|
68
|
-
_dispatchMessage(message) {
|
|
69
|
-
try {
|
|
70
|
-
this.onmessage?.(JSON.parse(message));
|
|
71
|
-
} catch (e) {
|
|
72
|
-
console.error("failed to dispatch message", e);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function compareSemver(a, b) {
|
|
77
|
-
const aBase = a.replace(/-.*$/, "");
|
|
78
|
-
const bBase = b.replace(/-.*$/, "");
|
|
79
|
-
const aParts = aBase.split(".").map(Number);
|
|
80
|
-
const bParts = bBase.split(".").map(Number);
|
|
81
|
-
for (let i = 0; i < 3; i++) {
|
|
82
|
-
if (aParts[i] > bParts[i])
|
|
83
|
-
return 1;
|
|
84
|
-
if (aParts[i] < bParts[i])
|
|
85
|
-
return -1;
|
|
86
|
-
}
|
|
87
|
-
const aTimestamp = parseSuffixTimestamp(a);
|
|
88
|
-
const bTimestamp = parseSuffixTimestamp(b);
|
|
89
|
-
if (aTimestamp > bTimestamp)
|
|
90
|
-
return 1;
|
|
91
|
-
if (aTimestamp < bTimestamp)
|
|
92
|
-
return -1;
|
|
93
|
-
return 0;
|
|
94
|
-
}
|
|
95
|
-
function parseSuffixTimestamp(version) {
|
|
96
|
-
const match = version.match(/^\d+\.\d+\.\d+-(?:alpha|beta)-(.+)$/);
|
|
97
|
-
if (!match)
|
|
98
|
-
return Infinity;
|
|
99
|
-
const suffix = match[1];
|
|
100
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(suffix))
|
|
101
|
-
return new Date(suffix).getTime();
|
|
102
|
-
return Number(suffix);
|
|
103
|
-
}
|
|
104
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
-
0 && (module.exports = {
|
|
106
|
-
SocketConnection,
|
|
107
|
-
compareSemver
|
|
108
|
-
});
|