Skip to content

Commit 9d92f13

Browse files
test(webdriver): withhold clears when focus is refused
1 parent c8d3888 commit 9d92f13

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎packages/provider-webdriver/src/webdriver-interactor.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ test('fill refuses when a keyboard-up tap misses and focus stays on the previous
6767
return true;
6868
});
6969

70-
// The decisive assertion: no keys reached the field the previous fill focused.
71-
assert.equal(world.transcript.includes('keys'), false);
70+
assert.ok(!world.transcript.some((step) => step === 'clear' || step === 'keys'));
7271
});
7372

7473
// Found on a live AWS Device Farm iPhone 16: tapping Safari's collapsed address
@@ -130,7 +129,7 @@ test('fill refuses a keyboard-up tap when the driver cannot report the focused f
130129
return true;
131130
});
132131

133-
assert.equal(world.transcript.includes('keys'), false);
132+
assert.ok(!world.transcript.some((step) => step === 'clear' || step === 'keys'));
134133
});
135134

136135
// The last path that typed without evidence. It reported ordinary success, and
@@ -150,7 +149,7 @@ test('fill refuses when the driver implements neither focus route', async () =>
150149
return true;
151150
});
152151

153-
assert.equal(world.transcript.includes('keys'), false);
152+
assert.ok(!world.transcript.some((step) => step === 'clear' || step === 'keys'));
154153
});
155154

156155
// The #1658 report is "fill answered Filled N chars while the field kept its
@@ -167,7 +166,7 @@ test('fill refuses without typing when nothing ever takes focus', async () => {
167166
return true;
168167
});
169168

170-
assert.equal(world.transcript.includes('keys'), false);
169+
assert.ok(!world.transcript.some((step) => step === 'clear' || step === 'keys'));
171170
});
172171

173172
// A probe that FAILED is not a driver without the feature. Swallowing a dead
@@ -182,7 +181,7 @@ test('fill propagates a failing keyboard probe instead of typing blind', async (
182181
});
183182

184183
// It threw on a pre-tap probe, so the device was never touched at all.
185-
assert.equal(world.transcript.includes('tap'), false);
184+
assert.deepEqual(world.transcript, ['keyboard', 'active']);
186185
});
187186

188187
// Post-tap the device HAS been touched, so one transient grid error must not
@@ -208,7 +207,7 @@ test('fill rethrows the probe failure when no probe ever answers', async () => {
208207
return true;
209208
});
210209

211-
assert.equal(world.transcript.includes('keys'), false);
210+
assert.ok(!world.transcript.some((step) => step === 'clear' || step === 'keys'));
212211
});
213212

214213
// P2: a probe handed the full fixed timeout near the deadline would finish well
@@ -228,6 +227,7 @@ test('fill caps each probe timeout by the readiness budget remaining', async ()
228227
// The budget is 2s and probes start at t=0, so once under 1.5s remain the cap
229228
// is the remainder, and the final probe gets exactly one poll interval.
230229
assert.equal(timeouts.at(-1), 100);
230+
assert.ok(!world.transcript.some((step) => step === 'clear' || step === 'keys'));
231231
});
232232

233233
/**

0 commit comments

Comments
 (0)