ohos-playwright 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/setup.mjs +3 -10
  2. package/package.json +1 -1
package/dist/setup.mjs CHANGED
@@ -186,7 +186,6 @@ export default async function globalSetup() {
186
186
  await ensureDeviceConnected();
187
187
  console.log(`[ohos-playwright] locating ${BUNDLE}...`);
188
188
  // Batch ps + /proc/net/unix into a single hdc call.
189
- let deviceState = fetchDeviceState();
190
189
  let pid = findBrowserPid();
191
190
  if (!pid) {
192
191
  console.log('[ohos-playwright] browser not running, launching...');
@@ -195,15 +194,9 @@ export default async function globalSetup() {
195
194
  pid = await retry(findBrowserPid, { max: 20, interval: 1000, label: `Failed to launch ${BUNDLE}` });
196
195
  }
197
196
  console.log(`[ohos-playwright] browser pid=${pid}`);
198
- // Reuse the /proc/net/unix snapshot if it's fresh (same shell call as ps above).
199
- // If we waited for browser launch, re-fetch since the socket may be new.
200
- let unixCache = pid ? undefined : deviceState.unix;
201
- if (!unixCache) {
202
- // Re-fetch device state to get fresh /proc/net/unix after browser launch
203
- deviceState = fetchDeviceState();
204
- unixCache = deviceState.unix;
205
- }
206
- const socket = await retry(() => findDevToolsSocket(pid, unixCache), { max: 10, interval: 500, label: `DevTools socket not found for pid ${pid}` });
197
+ // Wait for the DevTools socket to appear each retry fetches fresh
198
+ // /proc/net/unix since the socket appears asynchronously after launch.
199
+ const socket = await retry(() => findDevToolsSocket(pid), { max: 10, interval: 500, label: `DevTools socket not found for pid ${pid}` });
207
200
  console.log(`[ohos-playwright] socket=${socket}`);
208
201
  const port = await pickFreePort();
209
202
  setupForward(port, socket);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ohos-playwright",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Playwright adapter for OpenHarmony / ArkWeb via hdc + CDP",
5
5
  "license": "MIT",
6
6
  "author": "social4hyq",