Skip to content

Commit 3f1b2af

Browse files
committed
Stabilize JS API focus typing
1 parent bf25dd8 commit 3f1b2af

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

scripts/integration/js-api.mjs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -208,30 +208,30 @@ async function main() {
208208
await expectFixtureText("URL Opened");
209209
});
210210
await measuredStep("JS focus URL and type", async () => {
211-
await session.tapElement(
212-
simulatorUDID,
213-
{ id: "fixture.message" },
214-
{
215-
source: "native-ax",
216-
maxDepth: 3,
217-
waitTimeoutMs: 15_000,
218-
durationMs: 30,
219-
},
220-
);
221211
await retryAsync(
222212
async () => {
213+
await session.tapElement(
214+
simulatorUDID,
215+
{ id: "fixture.message" },
216+
{
217+
source: "native-ax",
218+
maxDepth: 3,
219+
waitTimeoutMs: 15_000,
220+
durationMs: 30,
221+
},
222+
);
223223
await session.openUrl(simulatorUDID, fixtureFocusUrl);
224-
await expectFixtureText("Message Focused");
224+
await expectFixtureText("Message Focused", { timeoutMs: 20_000 });
225+
await sleep(1_000);
226+
await session.batch(simulatorUDID, [
227+
{ action: "type", text: "agent-ready", delayMs: 20 },
228+
]);
229+
await expectFixtureText("agent-ready", { timeoutMs: 20_000 });
225230
},
226-
"JS focus URL",
231+
"JS focus URL and type",
227232
3,
228233
2_000,
229234
);
230-
await sleep(1_000);
231-
await session.batch(simulatorUDID, [
232-
{ action: "type", text: "agent-ready", delayMs: 12 },
233-
]);
234-
await expectFixtureText("agent-ready");
235235
});
236236

237237
await measuredStep(

0 commit comments

Comments
 (0)