File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Testing Library Extension for Chrome DevTools Recorder
4
4
5
+ ## Installation
6
+
7
+ 1 . Clone the repo
8
+ 2 . ` npm install `
9
+ 3 . ` npm run build `
10
+ 4 . Visit ` chrome://extensions `
11
+ 5 . Enable ` Developer mode ` via toggle switch in upper right corner
12
+ 6 . Click ` Load unpacked ` button in upper left corner
13
+ 7 . Select the ` dist ` directory
14
+
15
+ ## Usage
16
+
17
+ 1 . Create a new recording via the Recorder panel.
18
+ 2 . Hover over the export icon
19
+ 3 . Click ` Export as a Testing Library script `
20
+ 4 . Save file as ` {testName}.test.{ts.js} `
21
+
5
22
## Inspiration
6
23
7
- - [ Puppeteer Replay example extension ] ( https://github.com/puppeteer/replay/tree/main/examples/chrome-extension )
24
+ - [ Puppeteer Replay examples ] ( https://github.com/puppeteer/replay/tree/main/examples )
Original file line number Diff line number Diff line change 1
- import type { UserFlow } from "@puppeteer/replay"
1
+ import { stringify , type UserFlow } from "@puppeteer/replay"
2
2
3
3
export class RecorderPlugin {
4
- async stringify ( recording : UserFlow ) {
5
- return JSON . stringify ( recording , null , 2 )
4
+ stringify ( recording : UserFlow ) {
5
+ return stringify ( recording )
6
6
}
7
7
}
8
8
9
9
chrome . devtools . recorder . registerRecorderExtensionPlugin (
10
10
new RecorderPlugin ( ) ,
11
11
"Testing Library" ,
12
- "application/json " ,
12
+ "application/javascript " ,
13
13
)
Original file line number Diff line number Diff line change
1
+ import webpack from "webpack"
1
2
import CopyPlugin from "copy-webpack-plugin"
2
3
import HtmlPlugin from "html-webpack-plugin"
3
4
5
+ const { IgnorePlugin } = webpack
6
+
4
7
export default {
5
8
module : {
6
9
rules : [
@@ -20,5 +23,8 @@ export default {
20
23
patterns : [ "manifest.json" ] ,
21
24
} ) ,
22
25
new HtmlPlugin ( ) ,
26
+ new IgnorePlugin ( {
27
+ resourceRegExp : / ^ p u p p e t e e r $ / ,
28
+ } ) ,
23
29
] ,
24
30
}
You can’t perform that action at this time.
0 commit comments