Skip to content

Commit 06bb2eb

Browse files
committed
fix: change timeout per char
1 parent ddeed7b commit 06bb2eb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/tools/input.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,10 @@ async function fillFormElement(
160160
await selectOption(handle, aXNode, value);
161161
} else {
162162
// Increase timeout for longer input values.
163-
const textLengthIn1kChars = Math.floor(value.length / 1_000);
164-
const timeoutPer1kChars = 5_000; // ms
163+
const timeoutPerChar = 5; // ms
165164
const fillTimeout =
166165
context.getSelectedPage().getDefaultTimeout() +
167-
textLengthIn1kChars * timeoutPer1kChars;
166+
value.length * timeoutPerChar;
168167
await handle.asLocator().setTimeout(fillTimeout).fill(value);
169168
}
170169
} finally {

0 commit comments

Comments
 (0)