browser-commander 0.21.0 → 0.21.1
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/.jscpd.json +2 -1
- package/.prettierignore +1 -0
- package/CHANGELOG.md +14 -0
- package/package.json +4 -2
- package/src/browser/attach/snapshot.js +4 -4
- package/src/browser/browser-cookie-cache.js +14 -2
- package/src/browser/profile-directory.js +109 -6
- package/src/browser/real-browser.js +38 -6
- package/src/cli/args.js +47 -0
- package/src/cli/sessions.js +4 -0
- package/src/traces/bundle.js +3 -2
- package/src/traces/observers.js +14 -5
- package/src/traces/recorder.js +3 -0
- package/src/traces/viewer.js +16 -8
- package/tests/e2e/playwright.e2e.test.js +1 -0
- package/tests/e2e/puppeteer.e2e.test.js +1 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0001.html +2 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0001.png +1 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0001.state.json +54 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0002.html +2 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0002.png +1 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0002.state.json +60 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0003.html +2 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0003.png +1 -0
- package/tests/fixtures/traces/conformance/expected/bundle/checkpoints/0003.state.json +60 -0
- package/tests/fixtures/traces/conformance/expected/bundle/events.ndjson +18 -0
- package/tests/fixtures/traces/conformance/expected/bundle/manifest.json +77 -0
- package/tests/fixtures/traces/conformance/expected/bundle/mutations/0001.ndjson +2 -0
- package/tests/fixtures/traces/conformance/expected/bundle/mutations/0002.ndjson +1 -0
- package/tests/fixtures/traces/conformance/expected/bundle/viewer.html +309 -0
- package/tests/fixtures/traces/conformance/expected/redaction.json +86 -0
- package/tests/fixtures/traces/conformance/expected/trace.lino +27 -0
- package/tests/fixtures/traces/conformance/scenario.json +249 -0
- package/tests/unit/browser/attach/extension-relay.test.js +1 -1
- package/tests/unit/browser/attach/snapshot-launch.test.js +10 -1
- package/tests/unit/browser/attach/snapshot.test.js +23 -4
- package/tests/unit/browser/browser-cookie-lock.test.js +102 -0
- package/tests/unit/browser/launch-building-blocks.test.js +127 -4
- package/tests/unit/browser/migration/index.test.js +1 -1
- package/tests/unit/browser/open-in-user-browser.test.js +1 -1
- package/tests/unit/browser/parity.test.js +1 -1
- package/tests/unit/browser/real-browser.test.js +1 -1
- package/tests/unit/browser/storage-state.test.js +2 -0
- package/tests/unit/cli/main.test.js +30 -2
- package/tests/unit/core/navigation-manager.test.js +11 -1
- package/tests/unit/playwright-protocol-coverage.test.js +231 -0
- package/tests/unit/puppeteer-bindings-coverage.test.js +214 -0
- package/tests/unit/scripts/ci-timeout-budgets.test.js +23 -0
- package/tests/unit/scripts/feature-parity.test.js +111 -5
- package/tests/unit/traces/conformance.test.js +92 -0
- package/tests/unit/traces/reader.test.js +1 -1
- package/tests/unit/traces/recorder.test.js +1 -1
- package/tests/unit/traces/viewer.test.js +78 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"url": "https://[redacted]:[redacted]@example.com/start?ticket=[redacted]&lang=en#access_token=[redacted]&view=1",
|
|
3
|
+
"title": "Start – “quoted” 'single' \\ back",
|
|
4
|
+
"readyState": "complete",
|
|
5
|
+
"scroll": {
|
|
6
|
+
"x": 0,
|
|
7
|
+
"y": 12.5
|
|
8
|
+
},
|
|
9
|
+
"viewport": {
|
|
10
|
+
"width": 1280,
|
|
11
|
+
"height": 720
|
|
12
|
+
},
|
|
13
|
+
"activeElement": null,
|
|
14
|
+
"controls": [
|
|
15
|
+
{
|
|
16
|
+
"path": "form > input:nth-of-type(1)",
|
|
17
|
+
"tag": "input",
|
|
18
|
+
"type": "text",
|
|
19
|
+
"name": "user",
|
|
20
|
+
"id": null,
|
|
21
|
+
"focused": false,
|
|
22
|
+
"value": "alice",
|
|
23
|
+
"redacted": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "form > input:nth-of-type(2)",
|
|
27
|
+
"tag": "input",
|
|
28
|
+
"type": "checkbox",
|
|
29
|
+
"name": "agree",
|
|
30
|
+
"id": null,
|
|
31
|
+
"focused": false,
|
|
32
|
+
"value": "on",
|
|
33
|
+
"checked": false,
|
|
34
|
+
"redacted": false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "form > select",
|
|
38
|
+
"tag": "select",
|
|
39
|
+
"type": null,
|
|
40
|
+
"name": "plan",
|
|
41
|
+
"id": null,
|
|
42
|
+
"focused": false,
|
|
43
|
+
"value": "a",
|
|
44
|
+
"selected": [
|
|
45
|
+
0
|
|
46
|
+
],
|
|
47
|
+
"redacted": false
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"frames": [],
|
|
51
|
+
"name": "initial",
|
|
52
|
+
"actor": "recorder",
|
|
53
|
+
"reason": "initial"
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fake-png
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"url": "https://example.com/next?token=[redacted]",
|
|
3
|
+
"title": "Next",
|
|
4
|
+
"readyState": "interactive",
|
|
5
|
+
"scroll": {
|
|
6
|
+
"x": 0,
|
|
7
|
+
"y": 0
|
|
8
|
+
},
|
|
9
|
+
"viewport": {
|
|
10
|
+
"width": 1280,
|
|
11
|
+
"height": 720
|
|
12
|
+
},
|
|
13
|
+
"activeElement": "form > textarea",
|
|
14
|
+
"controls": [
|
|
15
|
+
{
|
|
16
|
+
"path": "form > input:nth-of-type(1)",
|
|
17
|
+
"tag": "input",
|
|
18
|
+
"type": "text",
|
|
19
|
+
"name": "user",
|
|
20
|
+
"id": null,
|
|
21
|
+
"focused": false,
|
|
22
|
+
"value": "bob",
|
|
23
|
+
"redacted": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "form > input:nth-of-type(2)",
|
|
27
|
+
"tag": "input",
|
|
28
|
+
"type": "checkbox",
|
|
29
|
+
"name": "agree",
|
|
30
|
+
"id": null,
|
|
31
|
+
"focused": false,
|
|
32
|
+
"value": "on",
|
|
33
|
+
"checked": true,
|
|
34
|
+
"redacted": false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "form > textarea",
|
|
38
|
+
"tag": "textarea",
|
|
39
|
+
"type": null,
|
|
40
|
+
"name": null,
|
|
41
|
+
"id": "note",
|
|
42
|
+
"focused": true,
|
|
43
|
+
"value": "[redacted] note",
|
|
44
|
+
"scroll": {
|
|
45
|
+
"x": 0,
|
|
46
|
+
"y": 3
|
|
47
|
+
},
|
|
48
|
+
"redacted": false
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"frames": [
|
|
52
|
+
{
|
|
53
|
+
"url": "https://ads.example.com/frame",
|
|
54
|
+
"crossOrigin": true
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"name": "after click",
|
|
58
|
+
"actor": "automation",
|
|
59
|
+
"reason": "checkpoint"
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fake-png
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"url": "https://example.com/next?token=[redacted]",
|
|
3
|
+
"title": "Next",
|
|
4
|
+
"readyState": "interactive",
|
|
5
|
+
"scroll": {
|
|
6
|
+
"x": 0,
|
|
7
|
+
"y": 0
|
|
8
|
+
},
|
|
9
|
+
"viewport": {
|
|
10
|
+
"width": 1280,
|
|
11
|
+
"height": 720
|
|
12
|
+
},
|
|
13
|
+
"activeElement": "form > textarea",
|
|
14
|
+
"controls": [
|
|
15
|
+
{
|
|
16
|
+
"path": "form > input:nth-of-type(1)",
|
|
17
|
+
"tag": "input",
|
|
18
|
+
"type": "text",
|
|
19
|
+
"name": "user",
|
|
20
|
+
"id": null,
|
|
21
|
+
"focused": false,
|
|
22
|
+
"value": "bob",
|
|
23
|
+
"redacted": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "form > input:nth-of-type(2)",
|
|
27
|
+
"tag": "input",
|
|
28
|
+
"type": "checkbox",
|
|
29
|
+
"name": "agree",
|
|
30
|
+
"id": null,
|
|
31
|
+
"focused": false,
|
|
32
|
+
"value": "on",
|
|
33
|
+
"checked": true,
|
|
34
|
+
"redacted": false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "form > textarea",
|
|
38
|
+
"tag": "textarea",
|
|
39
|
+
"type": null,
|
|
40
|
+
"name": null,
|
|
41
|
+
"id": "note",
|
|
42
|
+
"focused": true,
|
|
43
|
+
"value": "[redacted] note",
|
|
44
|
+
"scroll": {
|
|
45
|
+
"x": 0,
|
|
46
|
+
"y": 3
|
|
47
|
+
},
|
|
48
|
+
"redacted": false
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"frames": [
|
|
52
|
+
{
|
|
53
|
+
"url": "https://ads.example.com/frame",
|
|
54
|
+
"crossOrigin": true
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"name": "final",
|
|
58
|
+
"actor": "caller",
|
|
59
|
+
"reason": "failure"
|
|
60
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{"sequence":1,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"trace.start","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-1","mode":"continuous","engine":"playwright","dom":{"html":true,"liveControlState":true,"liveState":true,"mutations":true,"openShadowRoots":true},"events":["navigation","interaction","console","pageerror","dialog","requestfailed","download"],"initialCheckpoint":true}
|
|
2
|
+
{"sequence":2,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"checkpoint","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-1","index":1,"name":"initial","actor":"recorder","reason":"initial","url":"https://[redacted]:[redacted]@example.com/start?ticket=[redacted]&lang=en#access_token=[redacted]&view=1","truncated":false,"members":{"html":"checkpoints/0001.html","state":"checkpoints/0001.state.json","screenshot":"checkpoints/0001.png"}}
|
|
3
|
+
{"sequence":3,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"navigation","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","phase":"framenavigated","mainFrame":true,"url":"https://example.com/next?token=[redacted]&q=a+b"}
|
|
4
|
+
{"sequence":4,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"navigation","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","phase":"framenavigated","mainFrame":false,"url":"https://ads.example.com/frame"}
|
|
5
|
+
{"sequence":5,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"console","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","level":"log","text":"key [redacted] loaded\n\ttab \"and\" 'quotes'"}
|
|
6
|
+
{"sequence":6,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"pageerror","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","message":"boom: (unbalanced","stack":"Error: boom\n at main.js:1:2"}
|
|
7
|
+
{"sequence":7,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"requestfailed","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","url":"https://api.example.com/v1?api_key=[redacted]&page=2","method":"POST","failure":"net::ERR_FAILED"}
|
|
8
|
+
{"sequence":8,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"dialog","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","type":"confirm","message":"Continue? #yes"}
|
|
9
|
+
{"sequence":9,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"download","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","phase":"completed","id":"download-1","suggestedFilename":"report final.csv","path":"/downloads/report final.csv","checksum":"sha256:00ff","bytes":42,"url":"https://files.example.com/r.csv?signature=[redacted]","failure":null}
|
|
10
|
+
{"sequence":10,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"interaction","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","actionId":"trace-1-action-1","action":"goto","target":"https://example.com/next?code=abc","durationMs":0,"ok":true}
|
|
11
|
+
{"sequence":11,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"interaction","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","actionId":"trace-1-action-2","action":"clickButton","target":"#go","durationMs":0,"ok":false,"error":"button #go is not visible"}
|
|
12
|
+
{"sequence":12,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"dropped","reason":"size-limit","member":"mutations","detail":"2 records over the in-page queue limit"}
|
|
13
|
+
{"sequence":13,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"mutations","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","member":"mutations/0001.ndjson","batches":2,"checkpoint":1,"frames":1}
|
|
14
|
+
{"sequence":14,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"checkpoint","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","index":2,"name":"after click","actor":"automation","reason":"checkpoint","url":"https://example.com/next?token=[redacted]","truncated":true,"members":{"html":"checkpoints/0002.html","state":"checkpoints/0002.state.json","screenshot":"checkpoints/0002.png"}}
|
|
15
|
+
{"sequence":15,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"interaction","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","action":"note","actor":"caller","authorization":"[redacted]","detail":"uses [redacted]","pageUrl":"https://example.com/?session=[redacted]","count":3,"ratio":0.25,"whole":2,"nested":{"list":[1,"two",null,true]}}
|
|
16
|
+
{"sequence":16,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"mutations","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","member":"mutations/0002.ndjson","batches":1,"checkpoint":2,"frames":1}
|
|
17
|
+
{"sequence":17,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"checkpoint","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","index":3,"name":"final","actor":"caller","reason":"failure","url":"https://example.com/next?token=[redacted]","truncated":true,"members":{"html":"checkpoints/0003.html","state":"checkpoints/0003.state.json","screenshot":"checkpoints/0003.png"}}
|
|
18
|
+
{"sequence":18,"at":"2026-01-01T00:00:00.000Z","monotonicMs":1235,"kind":"trace.stop","traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","discarded":false}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"format": "browser-commander-trace",
|
|
4
|
+
"mode": "continuous",
|
|
5
|
+
"outcome": "partial",
|
|
6
|
+
"startedAt": "2026-01-01T00:00:00.000Z",
|
|
7
|
+
"stoppedAt": "2026-01-01T00:00:00.000Z",
|
|
8
|
+
"commanderVersion": "0.0.0-conformance",
|
|
9
|
+
"engine": "playwright",
|
|
10
|
+
"browser": null,
|
|
11
|
+
"platform": "conformance",
|
|
12
|
+
"runtime": "conformance",
|
|
13
|
+
"events": [
|
|
14
|
+
"navigation",
|
|
15
|
+
"interaction",
|
|
16
|
+
"console",
|
|
17
|
+
"pageerror",
|
|
18
|
+
"dialog",
|
|
19
|
+
"requestfailed",
|
|
20
|
+
"download"
|
|
21
|
+
],
|
|
22
|
+
"dom": {
|
|
23
|
+
"html": true,
|
|
24
|
+
"liveControlState": true,
|
|
25
|
+
"liveState": true,
|
|
26
|
+
"mutations": true,
|
|
27
|
+
"openShadowRoots": true
|
|
28
|
+
},
|
|
29
|
+
"replay": {
|
|
30
|
+
"checkpoints": true,
|
|
31
|
+
"mutations": true,
|
|
32
|
+
"childListPositions": true,
|
|
33
|
+
"liveState": true,
|
|
34
|
+
"identifiers": true
|
|
35
|
+
},
|
|
36
|
+
"privacy": {
|
|
37
|
+
"redactSelectors": [
|
|
38
|
+
"input[type=password]",
|
|
39
|
+
"[data-private]",
|
|
40
|
+
"[data-bc-redact]"
|
|
41
|
+
],
|
|
42
|
+
"redactAttributes": [
|
|
43
|
+
"authorization",
|
|
44
|
+
"proxy-authorization",
|
|
45
|
+
"cookie",
|
|
46
|
+
"set-cookie",
|
|
47
|
+
"x-api-key",
|
|
48
|
+
"x-auth-token",
|
|
49
|
+
"x-csrf-token"
|
|
50
|
+
],
|
|
51
|
+
"redactQueryParams": [
|
|
52
|
+
"access_token",
|
|
53
|
+
"api_key",
|
|
54
|
+
"apikey",
|
|
55
|
+
"auth",
|
|
56
|
+
"code",
|
|
57
|
+
"id_token",
|
|
58
|
+
"password",
|
|
59
|
+
"refresh_token",
|
|
60
|
+
"secret",
|
|
61
|
+
"session",
|
|
62
|
+
"signature",
|
|
63
|
+
"token",
|
|
64
|
+
"ticket"
|
|
65
|
+
],
|
|
66
|
+
"hasCallback": false
|
|
67
|
+
},
|
|
68
|
+
"limits": {
|
|
69
|
+
"maxQueuedMutations": 100
|
|
70
|
+
},
|
|
71
|
+
"counts": {
|
|
72
|
+
"checkpoints": 3,
|
|
73
|
+
"events": 18,
|
|
74
|
+
"mutationBatches": 3
|
|
75
|
+
},
|
|
76
|
+
"dropped": 1
|
|
77
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
{"traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","frameId":"main","mainFrame":true,"at":1767225600100,"records":[{"type":"live-state","target":2,"property":"value","value":"bo"},{"type":"childList","target":1,"added":[{"id":9,"html":"<p>new
line</p>"}],"removed":[],"index":3}]}
|
|
2
|
+
{"traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","frameId":"main","mainFrame":true,"at":1767225600200,"records":[{"type":"attributes","target":4,"name":"class","value":"busy"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"traceId":"trace-1","browserContextId":"context-1","pageId":"page-1","navigationId":"nav-2","frameId":"main","mainFrame":true,"at":1767225600300,"records":[{"type":"characterData","target":7,"value":"done ✓ 😀"}]}
|