You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: browser-extension/README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@
18
18
-`npm run biome:fix` - fixes most of what `biome check` finds
19
19
-`npm run compile` - typechecking
20
20
-`npm test` - vitest
21
+
-`npm test -- -u` updates all the snapshots
21
22
22
23
### Deployment
23
24
-`npm run build` - build for mv3 for most browsers
@@ -42,3 +43,21 @@ Every time a `textarea` shows up on a page, on initial load or later on, it gets
42
43
Those values get bundled up with the `HTMLTextAreaElement` itself into an `EnhancedTextarea`, which gets added to the `TextareaRegistry`. At some interval, draft edits will get saved by the browser extension (TODO).
43
44
44
45
When the `textarea` gets removed from the page, the `TextareaRegistry` is notified so that the `CommentSpot` can be marked as abandoned or submitted as appropriate (TODO).
46
+
47
+
## Testing
48
+
49
+
In `tests/har` there are various `.har` files. These are complete recordings of a single page load.
50
+
51
+
-`npm run har:view` and you can see the recordings, with or without our browser extension.
52
+
53
+
### Recording new HAR files
54
+
55
+
- you can add or change URLs in `tests/har-index.ts`
56
+
-`npx playwright codegen https://github.com/login --save-storage=playwright/.auth/gh.json` will store new auth tokens
57
+
- login manually, then close the browser
58
+
-***these cookies are very sensitive! we only run this script using a test account that has no permissions or memberships to anything, recommend you do the same!***
59
+
-`npm run har:record` this records new snapshots using those auth tokens (it needs args, run it with no args for docs)
60
+
- DO NOT COMMIT AND PUSH NEW OR CHANGED `har` files!
61
+
- we try to sanitize these (see `har-record.ts` for details) but there may be important PII in them
62
+
- if you need new HAR files for something, let us know and we will generate them ourselves using a dummy account
63
+
- IF YOUR PR CHANGES OR ADDS HAR FILES WE WILL CLOSE IT. Ask for HAR files and we'll be happy to generate clean ones you can test against.
0 commit comments