Reduce sleep durations in step1.test for improved test execution speed; adjust typing delay in executor.js for faster human-like input simulation and enhance sleep visualization conditions.
This commit is contained in:
@@ -506,8 +506,8 @@ class TestExecutor {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
const char = value[i];
|
||||
|
||||
// Human-like typing speed variation (80-200ms between keystrokes)
|
||||
const typingDelay = Math.random() * 120 + 80;
|
||||
// Human-like typing speed variation (40-100ms between keystrokes) - 50% faster
|
||||
const typingDelay = Math.random() * 60 + 40;
|
||||
|
||||
// Create flying letter animation
|
||||
await this.page.evaluate(({ sel, character, isPassword, currentIndex, totalLength }) => {
|
||||
@@ -600,7 +600,8 @@ class TestExecutor {
|
||||
console.log(sleepMsg);
|
||||
|
||||
// Add visual sleep animation with countdown in headed mode
|
||||
if (!this.headless) {
|
||||
// Only show visualization for sleeps >= 1000ms
|
||||
if (!this.headless && command.milliseconds >= 1000) {
|
||||
try {
|
||||
await this.page.addStyleTag({
|
||||
content: `
|
||||
@@ -668,7 +669,8 @@ class TestExecutor {
|
||||
if (countdownEl) {
|
||||
countdownEl.textContent = remaining + 's';
|
||||
}
|
||||
if (remaining <= 0) {
|
||||
// Hide visualization when less than 0.5 seconds remaining
|
||||
if (remaining <= 0.5) {
|
||||
clearInterval(interval);
|
||||
const element = document.getElementById('sleep-indicator');
|
||||
if (element) {
|
||||
|
||||
Reference in New Issue
Block a user