browser-commander 0.23.0 → 0.24.0
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-baseline.json +47 -29
- package/CHANGELOG.md +8 -0
- package/README.md +12 -3
- package/eslint.config.js +1 -1
- package/examples/react-test-app/package-lock.json +890 -0
- package/examples/react-test-app/package.json +4 -4
- package/package.json +17 -17
- package/src/browser/connector.js +46 -4
- package/src/browser/launcher.js +26 -1
- package/src/browser/real-browser.js +8 -2
- package/src/browser/storage-state.js +27 -0
- package/src/browser/webdriver.js +18 -2
- package/src/cli/args.js +5 -0
- package/src/cli/commands.js +10 -6
- package/src/cli/handle-methods.js +19 -2
- package/src/cli/high-level-methods.js +20 -3
- package/src/cli/modules.js +5 -1
- package/src/cli/sessions.js +14 -2
- package/src/tests/index.js +1 -0
- package/tests/e2e/engine-matrix.e2e.test.js +107 -0
- package/tests/e2e/playwright.e2e.test.js +11 -17
- package/tests/e2e/puppeteer.e2e.test.js +13 -17
- package/tests/unit/cli/dispatcher.test.js +2 -2
- package/tests/unit/cli/selenium-parity.test.js +186 -0
- package/tests/unit/tests/index.test.js +2 -1
- package/tests/unit/traces/links.test.js +2 -2
package/.jscpd-baseline.json
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
"04b28d01d0bb47dc": 1,
|
|
9
9
|
"04f605be138bc350": 1,
|
|
10
10
|
"0796d358ad2562c3": 1,
|
|
11
|
+
"08e28c7706cdddd6": 1,
|
|
11
12
|
"090a69d9528e4cdb": 1,
|
|
12
13
|
"09694dc8fb9d683c": 1,
|
|
13
14
|
"0a3459aad03492bb": 1,
|
|
15
|
+
"0ae281facb3c28dd": 1,
|
|
14
16
|
"0b48b63049c42591": 1,
|
|
15
17
|
"0b8c71391c107a5e": 1,
|
|
16
18
|
"0ba2d165b56db0b3": 1,
|
|
@@ -18,19 +20,19 @@
|
|
|
18
20
|
"0caa402c4eae32d8": 1,
|
|
19
21
|
"0fd23be8410c2c95": 1,
|
|
20
22
|
"0fe4f3b5e5e939b3": 1,
|
|
21
|
-
"1019ebbe7f07a5ad": 1,
|
|
22
23
|
"119f429fe4d23e4a": 1,
|
|
24
|
+
"126a1cfe8f2264ce": 1,
|
|
23
25
|
"1273365073edd790": 1,
|
|
24
|
-
"1296adc3c3128048": 1,
|
|
25
26
|
"13c4b58d3ea0719b": 1,
|
|
26
27
|
"14beedf656e57fba": 1,
|
|
27
28
|
"150c8efe188ac225": 1,
|
|
28
29
|
"16340a16ed52849e": 1,
|
|
30
|
+
"16e58ea67d8ef4e8": 1,
|
|
29
31
|
"17c26c0db2d35ad1": 1,
|
|
30
32
|
"193b46c0e7f72053": 1,
|
|
33
|
+
"19ff70fc80fad524": 1,
|
|
31
34
|
"1ad4dc7e19a77f68": 1,
|
|
32
35
|
"1c1baf1bc8ea0eae": 1,
|
|
33
|
-
"1cbd39b416a2b94b": 1,
|
|
34
36
|
"1d61f5c49f12d2dc": 1,
|
|
35
37
|
"1ef570563d4e5a08": 1,
|
|
36
38
|
"1f2104c950b12a30": 1,
|
|
@@ -39,10 +41,11 @@
|
|
|
39
41
|
"22755b35701c5bb6": 1,
|
|
40
42
|
"2296c06fa00da254": 1,
|
|
41
43
|
"229b903386b17538": 1,
|
|
44
|
+
"22cbd954358d25f8": 1,
|
|
45
|
+
"230bfe57cfda164d": 1,
|
|
42
46
|
"2357ae472525f6bf": 1,
|
|
43
47
|
"2394170c8a2a0e9a": 1,
|
|
44
48
|
"23d2486c0e269b77": 1,
|
|
45
|
-
"24b29d9d78441dbd": 1,
|
|
46
49
|
"266893ea7a511fe4": 1,
|
|
47
50
|
"266b9cb95f783cdf": 1,
|
|
48
51
|
"26bb09996580437c": 1,
|
|
@@ -53,27 +56,28 @@
|
|
|
53
56
|
"2c0f8b5c6f28420b": 1,
|
|
54
57
|
"2d2d6fd6c7c0f30d": 1,
|
|
55
58
|
"2e70be24d2268673": 1,
|
|
56
|
-
"
|
|
59
|
+
"2e75ebb5fafa33a5": 1,
|
|
57
60
|
"2f9e15467cc2f12a": 1,
|
|
58
61
|
"30da9d4e83f1c939": 1,
|
|
59
62
|
"3101802d3ea65339": 1,
|
|
63
|
+
"326f1ff9016e1e37": 1,
|
|
60
64
|
"33357ce94e07cc4b": 1,
|
|
61
65
|
"35cf2769645f3234": 1,
|
|
62
66
|
"37bd4114d0089f49": 1,
|
|
63
|
-
"
|
|
67
|
+
"39cf8134a7fdaa31": 1,
|
|
64
68
|
"3a9f1672ecc1d55b": 1,
|
|
65
69
|
"3adca52a3f04837c": 1,
|
|
66
70
|
"3c1017def7b3216c": 1,
|
|
67
|
-
"
|
|
68
|
-
"3dced48baf70eb36": 1,
|
|
71
|
+
"3c5cb4b62d3739e3": 1,
|
|
69
72
|
"3fa2ebbb416120f0": 1,
|
|
70
73
|
"3fe61c0a7772f18b": 1,
|
|
71
74
|
"406fed8e5b39aafd": 1,
|
|
72
75
|
"40aa2953f783819c": 1,
|
|
73
76
|
"418db56376cc23bd": 1,
|
|
77
|
+
"421bb16fafde32a7": 1,
|
|
74
78
|
"441570d51d6f70a4": 1,
|
|
75
79
|
"457c71f32f53833d": 1,
|
|
76
|
-
"
|
|
80
|
+
"4715a17d690865ee": 1,
|
|
77
81
|
"4b0d3cc5c27227e7": 1,
|
|
78
82
|
"4c3b94caa28045d0": 1,
|
|
79
83
|
"4e090d6bb30e6551": 1,
|
|
@@ -84,29 +88,28 @@
|
|
|
84
88
|
"520a28ee2ced56c2": 1,
|
|
85
89
|
"53519ec61a6ba319": 1,
|
|
86
90
|
"53f7e3f3e444a37d": 1,
|
|
87
|
-
"
|
|
91
|
+
"55fd990468b1fd0f": 1,
|
|
88
92
|
"562ebfb882d4aa8f": 1,
|
|
89
93
|
"56b5df15ee61887d": 1,
|
|
90
94
|
"56b7675e4ce57335": 1,
|
|
91
|
-
"56d45d447baad2fd": 1,
|
|
92
95
|
"56deee57166c4369": 1,
|
|
93
96
|
"578ab1469dc998ec": 1,
|
|
97
|
+
"57aa3b487de27c90": 1,
|
|
94
98
|
"57c410b183671eec": 1,
|
|
95
|
-
"
|
|
99
|
+
"5825f31d55b82fae": 1,
|
|
96
100
|
"58c08b8242c875ec": 1,
|
|
97
101
|
"58c1ca12d4d2b50f": 1,
|
|
98
102
|
"5a09e2677334ba05": 1,
|
|
99
|
-
"
|
|
100
|
-
"
|
|
103
|
+
"5b5d3f792532356c": 1,
|
|
104
|
+
"5ba2f3218754f04c": 1,
|
|
105
|
+
"60052da86e7bb241": 1,
|
|
101
106
|
"608e1dd27138ec6f": 1,
|
|
102
|
-
"6098544c77ff17a2": 1,
|
|
103
107
|
"60d0c58a01fc8746": 1,
|
|
104
108
|
"61ae5da6cc003836": 1,
|
|
105
109
|
"61bcadcd8dc9f63e": 1,
|
|
106
110
|
"63ff613b1780c67a": 1,
|
|
107
111
|
"642cc89ed49f8a21": 1,
|
|
108
112
|
"6479c3604c153ec4": 1,
|
|
109
|
-
"6699064d6e8e09ba": 1,
|
|
110
113
|
"66fb97eebd7ff0dc": 1,
|
|
111
114
|
"67a95e428b8fa31c": 1,
|
|
112
115
|
"6880d620e0e67229": 1,
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
"760d9925f6e3ca85": 1,
|
|
128
131
|
"7623a3eea4680be4": 1,
|
|
129
132
|
"771db68809cce310": 1,
|
|
130
|
-
"
|
|
133
|
+
"77793566535b942e": 1,
|
|
131
134
|
"779517ed59b39aa6": 1,
|
|
132
135
|
"7850ccac58d09216": 1,
|
|
133
136
|
"785d557d0683185b": 1,
|
|
@@ -137,78 +140,89 @@
|
|
|
137
140
|
"799dc9940577a15e": 1,
|
|
138
141
|
"79e705499ddaf44b": 1,
|
|
139
142
|
"7e6bad380644f9b0": 1,
|
|
143
|
+
"80cc77491cde09e5": 1,
|
|
144
|
+
"80f564fe45f6b315": 1,
|
|
140
145
|
"81a56c10bfd42e39": 1,
|
|
141
146
|
"837ba752ecdaf052": 1,
|
|
142
|
-
"8549c997a472cb6c": 1,
|
|
143
147
|
"86646647aab19e39": 1,
|
|
144
148
|
"8678919f1350f154": 1,
|
|
145
149
|
"86aae81b1aa0d21b": 1,
|
|
146
150
|
"87484a2744e09748": 1,
|
|
147
|
-
"876d2c8edfc8c40a": 1,
|
|
148
151
|
"8b013ac20e436d76": 1,
|
|
149
152
|
"8c2b1408886c1db1": 1,
|
|
153
|
+
"8e55579a412bc058": 1,
|
|
150
154
|
"8ec18cdbd4a96518": 1,
|
|
155
|
+
"901317bc4d7d30d0": 1,
|
|
151
156
|
"91049efadc65169b": 1,
|
|
152
157
|
"9134185980de8a17": 1,
|
|
153
158
|
"916833bafca4fa63": 1,
|
|
154
159
|
"91a538e4a0c28f25": 1,
|
|
155
160
|
"92ddafa7e65be7eb": 1,
|
|
156
161
|
"94821a4d1b745dfd": 1,
|
|
162
|
+
"961e3cc731bbc9fe": 1,
|
|
157
163
|
"97c5a112fdde7be8": 1,
|
|
158
164
|
"990d87f21678fa96": 1,
|
|
159
165
|
"9a72b1c2f22156ca": 1,
|
|
160
166
|
"9b6ef4df04562546": 1,
|
|
161
|
-
"
|
|
167
|
+
"9e049e3eefca1869": 1,
|
|
162
168
|
"9fbb8296259dedbe": 1,
|
|
169
|
+
"9fe73b5b918293fe": 1,
|
|
163
170
|
"a0183465782b0b15": 1,
|
|
171
|
+
"a11079d40b28716c": 1,
|
|
172
|
+
"a133391f90bd1a28": 1,
|
|
164
173
|
"a1e3a3a13b27dba4": 1,
|
|
165
174
|
"a1ef39a15701c2b5": 1,
|
|
166
175
|
"a2a00d268fb2cee4": 1,
|
|
167
|
-
"
|
|
176
|
+
"a36f66312d5bfbf8": 1,
|
|
168
177
|
"a4c8498d4f2d2191": 1,
|
|
178
|
+
"a5298242b5439858": 1,
|
|
169
179
|
"a6ad7ab6c05656dc": 1,
|
|
170
180
|
"a6ffab1aacd00af6": 1,
|
|
171
181
|
"a78d76908162699e": 1,
|
|
172
182
|
"a9bd4ffef6da5faf": 1,
|
|
173
|
-
"a9d71c2e50f1b832": 1,
|
|
174
183
|
"acc95d694eb2f581": 1,
|
|
175
184
|
"ad4cfa76daa1b6fc": 1,
|
|
176
185
|
"ad50b48938af8aef": 1,
|
|
177
|
-
"adae1329361a81a1": 1,
|
|
178
186
|
"ae477ba64bafba3f": 1,
|
|
179
187
|
"aee1e5c65f783848": 1,
|
|
180
188
|
"aee45e8b58c2d87f": 1,
|
|
181
189
|
"af702b20ebd45ef2": 1,
|
|
182
190
|
"af9d6a2f4eba146e": 1,
|
|
183
191
|
"b010686af23efa90": 1,
|
|
184
|
-
"b2a0686231220c8a": 1,
|
|
185
192
|
"b35ff46c365dcd18": 1,
|
|
186
193
|
"b41581af204af40e": 1,
|
|
187
194
|
"b71fa5250da28739": 1,
|
|
188
195
|
"b740ecac685a15fe": 1,
|
|
189
196
|
"b8c2d21f2a26f77d": 1,
|
|
197
|
+
"ba675900dc4211b1": 1,
|
|
190
198
|
"bb269582b94ed42d": 1,
|
|
191
199
|
"bb3e6d0f7e7edccd": 1,
|
|
200
|
+
"bb5b0c8d22c9667a": 1,
|
|
192
201
|
"bc9115be3a462930": 1,
|
|
193
202
|
"bd0ae42c13d5b4f9": 1,
|
|
194
|
-
"
|
|
203
|
+
"bd17b166d89cb709": 1,
|
|
195
204
|
"bdb8ca169be36b80": 1,
|
|
196
205
|
"bdcd11c2bfb5fde0": 1,
|
|
197
206
|
"be0900fb3e87164e": 1,
|
|
198
207
|
"bf452b9431c092ad": 1,
|
|
199
208
|
"c0b027bebd7bd737": 1,
|
|
200
209
|
"c189fe5122a7dc91": 1,
|
|
210
|
+
"c225b9d7d519303e": 1,
|
|
201
211
|
"c2c155adbcb46f3c": 1,
|
|
202
212
|
"c30737d62069fc02": 1,
|
|
203
213
|
"c3c3569357673af8": 1,
|
|
204
214
|
"c415ffcd004d6518": 1,
|
|
205
215
|
"c461a83b51eb7740": 1,
|
|
216
|
+
"c5c202c5db4dd601": 1,
|
|
217
|
+
"c714beebc66381dd": 1,
|
|
206
218
|
"c9cf3c28bed33a5b": 1,
|
|
219
|
+
"ca7e08d1eec2ad8c": 1,
|
|
207
220
|
"cab590a1d04b5a05": 1,
|
|
208
221
|
"cbd444e9a6a9072e": 1,
|
|
209
222
|
"cebff7d1cc87f646": 1,
|
|
210
|
-
"
|
|
223
|
+
"cfc928aa393146b6": 1,
|
|
211
224
|
"cfd68135b744c27b": 1,
|
|
225
|
+
"cfdc0cca50233fcb": 1,
|
|
212
226
|
"d016035b3bf3340c": 1,
|
|
213
227
|
"d097f41a6f43e634": 1,
|
|
214
228
|
"d0da8714c4b7de30": 1,
|
|
@@ -220,26 +234,27 @@
|
|
|
220
234
|
"d6157a86fea41907": 1,
|
|
221
235
|
"d6fa9884eee815f0": 1,
|
|
222
236
|
"d86bafb915488255": 1,
|
|
237
|
+
"da2c10a66acdb52f": 1,
|
|
238
|
+
"dabb9fc09638e178": 1,
|
|
223
239
|
"de0bf2317c53d427": 1,
|
|
224
240
|
"de1b481bfe8c3e58": 1,
|
|
225
241
|
"df2dc922f40485e7": 1,
|
|
226
242
|
"df3b85f6947db144": 1,
|
|
227
|
-
"e0b90bce5112bb9c": 1,
|
|
228
243
|
"e2ef7800deb0f464": 1,
|
|
229
244
|
"e3111b845acb7a0e": 1,
|
|
230
|
-
"e4b10b56d7e1edac": 1,
|
|
231
245
|
"e59733bafda785e9": 1,
|
|
232
246
|
"e5feedc0c24e103e": 1,
|
|
233
247
|
"e67726a913675120": 1,
|
|
248
|
+
"e686288f2e9b8a6d": 1,
|
|
234
249
|
"ea1195048ded896c": 1,
|
|
235
250
|
"ea88711c5deb1fe5": 1,
|
|
236
251
|
"eb9a70c2a21094ff": 1,
|
|
237
252
|
"ebe03c5f8c2f5147": 1,
|
|
238
253
|
"ee19c8b9b332ee98": 1,
|
|
239
254
|
"eeca0ccf8d821f21": 1,
|
|
240
|
-
"ef2fc2e92ac07c6e": 1,
|
|
241
255
|
"f022b763ff342b2d": 1,
|
|
242
256
|
"f07f979f8c2706e8": 1,
|
|
257
|
+
"f186f73c118b8e8a": 1,
|
|
243
258
|
"f38f72095a67c95e": 1,
|
|
244
259
|
"f40ba84763547f41": 1,
|
|
245
260
|
"f46509ed693574df": 1,
|
|
@@ -248,10 +263,13 @@
|
|
|
248
263
|
"f6678d6748e9c902": 1,
|
|
249
264
|
"f67a07a611f39cb2": 1,
|
|
250
265
|
"f7b1f9d699bcd580": 1,
|
|
266
|
+
"f81e07af5d3a1c3c": 1,
|
|
267
|
+
"f904844f89cab699": 1,
|
|
251
268
|
"f911821aa7dda47f": 1,
|
|
252
269
|
"f97bf515bfd95829": 1,
|
|
253
270
|
"fae844842fba705b": 1,
|
|
254
271
|
"faf76ec43b2dbbaa": 1,
|
|
272
|
+
"fc0d7bde0033411d": 1,
|
|
255
273
|
"fc6ed7d760c98f51": 1,
|
|
256
274
|
"fccfd8b004c12dd4": 1,
|
|
257
275
|
"fe859df9f97c75d4": 1
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.24.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 31d2387: Support Selenium through the common launch, connection, CLI, and browser-test
|
|
8
|
+
APIs, including raw WebDriver handles and generic engine constructors. Refresh
|
|
9
|
+
all direct dependencies and generated engine APIs to the latest stable releases.
|
|
10
|
+
|
|
3
11
|
## 0.23.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Browser Commander
|
|
2
2
|
|
|
3
|
-
A universal browser automation library for JavaScript/TypeScript that supports
|
|
3
|
+
A universal browser automation library for JavaScript/TypeScript that supports Playwright, Puppeteer, and Selenium with a unified API. The key focus is on **stoppable page triggers** - ensuring automation logic is properly mounted/unmounted during page navigation.
|
|
4
|
+
|
|
5
|
+
See [engine support and native/CLI defaults](../docs/engine-support.md) for the
|
|
6
|
+
cross-language API matrix and Selenium examples.
|
|
4
7
|
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
@@ -222,7 +225,7 @@ await saveStorageState(page, './gmail-state.json');
|
|
|
222
225
|
`browser-commander/tests` adds browser fixtures and scheduling helpers on top of
|
|
223
226
|
[`test-anywhere`](https://github.com/link-foundation/test-anywhere). It keeps
|
|
224
227
|
tests portable across Node.js, Bun, and Deno while running the same browser
|
|
225
|
-
scenario against Playwright and
|
|
228
|
+
scenario against Playwright, Puppeteer, and Selenium.
|
|
226
229
|
|
|
227
230
|
```javascript
|
|
228
231
|
import { assert, browserTest } from 'browser-commander/tests';
|
|
@@ -467,6 +470,12 @@ console.log(session.migration.migrated, session.migration.skipped);
|
|
|
467
470
|
|
|
468
471
|
### launchWebDriver(options) / connectWebDriver(options)
|
|
469
472
|
|
|
473
|
+
The same engine is available through `launchBrowser({engine: 'selenium'})` and
|
|
474
|
+
`connectBrowser({engine: 'selenium', serverUrl, capabilities})`. The common
|
|
475
|
+
launcher defaults to a real Chrome attachment; `launch: 'engine'` enables
|
|
476
|
+
ChromeDriver/GeckoDriver-managed Chrome or Firefox launches. Both return a common
|
|
477
|
+
page facade plus a raw `driver` and `close()`.
|
|
478
|
+
|
|
470
479
|
The `selenium` engine drives Chrome or Firefox over W3C WebDriver through
|
|
471
480
|
`selenium-webdriver` (an optional peer dependency). `launchWebDriver()` finds a
|
|
472
481
|
driver (`driverPath`, then `PATH`, then the Selenium Manager bundled with
|
|
@@ -1032,7 +1041,7 @@ echo '{"jsonrpc":"2.0","id":1,"method":"version"}' | npx browser-commander serve
|
|
|
1032
1041
|
|
|
1033
1042
|
The other commands are `open`, `click`, `screenshot`, `pdf`, `trace start|stop|view`, `cookies import`, `profile migrate` and `doctor`. Use the `=` form for values that start with `--`, for example `--arg=--lang=de`.
|
|
1034
1043
|
|
|
1035
|
-
`serve --stdio` exposes the high-level methods (`session.launch`, `page.goto`, …). It also exposes generic handle methods (`handle.root`, `handle.call`, `handle.get`, `handle.describe`, `events.subscribe`, …), which reach
|
|
1044
|
+
`serve --stdio` exposes the high-level methods (`session.launch`, `page.goto`, …). It also exposes generic handle methods (`handle.root`, `handle.call`, `handle.get`, `handle.describe`, `events.subscribe`, …), which reach public Playwright, Puppeteer, and Selenium methods and constructors. The Rust and Python ports use this bridge for the engines they do not implement natively.
|
|
1036
1045
|
|
|
1037
1046
|
For raw Chrome DevTools Protocol access from JavaScript, `createCdpSession(page)` (or `commander.createCdpSession()`) returns the same `send`/`on`/`once`/`off`/`detach` surface for Playwright and Puppeteer pages.
|
|
1038
1047
|
|