Skip to content

Commit a3e2739

Browse files
committed
Tweak test VPN dialog handling
1 parent 4731108 commit a3e2739

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

integration-tests/src/ui-automation.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,11 @@ export async function handleVpnPermissionDialog(timeoutMs: number = 15000): Prom
250250
const button = findTextInXml(xml, buttonText, true);
251251
if (button) {
252252
await tap(button.x, button.y);
253-
await delay(1000);
254-
return true;
253+
await delay(2000);
254+
if (await checkVpnActive()) {
255+
return true;
256+
}
257+
continue;
255258
}
256259
}
257260

@@ -267,8 +270,11 @@ export async function handleVpnPermissionDialog(timeoutMs: number = 15000): Prom
267270
if (match) {
268271
const [, x1, y1, x2, y2] = match.map(Number);
269272
await tap(Math.round((x1 + x2) / 2), Math.round((y1 + y2) / 2));
270-
await delay(1000);
271-
return true;
273+
await delay(2000);
274+
if (await checkVpnActive()) {
275+
return true;
276+
}
277+
continue;
272278
}
273279
}
274280
}
@@ -295,6 +301,9 @@ export async function handleVpnPermissionDialog(timeoutMs: number = 15000): Prom
295301
await delay(500);
296302
}
297303

304+
const finalXml = await dumpUiHierarchy();
305+
const textElements = finalXml.match(/text="[^"]+"/g) || [];
306+
console.log('VPN dialog timeout. UI texts:', textElements.slice(0, 15).join(', '));
298307
return false;
299308
}
300309

0 commit comments

Comments
 (0)