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:
seb
2025-07-17 13:20:05 +02:00
parent a69911e874
commit 41e4424650
2 changed files with 23 additions and 21 deletions

View File

@@ -506,8 +506,8 @@ class TestExecutor {
for (let i = 0; i < value.length; i++) { for (let i = 0; i < value.length; i++) {
const char = value[i]; const char = value[i];
// Human-like typing speed variation (80-200ms between keystrokes) // Human-like typing speed variation (40-100ms between keystrokes) - 50% faster
const typingDelay = Math.random() * 120 + 80; const typingDelay = Math.random() * 60 + 40;
// Create flying letter animation // Create flying letter animation
await this.page.evaluate(({ sel, character, isPassword, currentIndex, totalLength }) => { await this.page.evaluate(({ sel, character, isPassword, currentIndex, totalLength }) => {
@@ -600,7 +600,8 @@ class TestExecutor {
console.log(sleepMsg); console.log(sleepMsg);
// Add visual sleep animation with countdown in headed mode // 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 { try {
await this.page.addStyleTag({ await this.page.addStyleTag({
content: ` content: `
@@ -668,7 +669,8 @@ class TestExecutor {
if (countdownEl) { if (countdownEl) {
countdownEl.textContent = remaining + 's'; countdownEl.textContent = remaining + 's';
} }
if (remaining <= 0) { // Hide visualization when less than 0.5 seconds remaining
if (remaining <= 0.5) {
clearInterval(interval); clearInterval(interval);
const element = document.getElementById('sleep-indicator'); const element = document.getElementById('sleep-indicator');
if (element) { if (element) {

View File

@@ -10,59 +10,59 @@ use "Chrome"
# Part 1 - Load Growheads, put one item in the cart and go to checkout # Part 1 - Load Growheads, put one item in the cart and go to checkout
open "https://dev.seedheads.de" open "https://dev.seedheads.de"
sleep 2000 "page load" sleep 200 "page load"
wait element=a href=/Kategorie/Seeds wait element=a href=/Kategorie/Seeds
click element=a href=/Kategorie/Seeds click element=a href=/Kategorie/Seeds
sleep 2000 "seed click" sleep 200 "seed click"
wait element=button childText="In den Korb" wait element=button childText="In den Korb"
click element=button childText="In den Korb" click element=button childText="In den Korb"
sleep 2000 "in korb click" sleep 200 "in korb click"
wait element=span class="MuiBadge-badge" childText="1" wait element=span class="MuiBadge-badge" childText="1"
click element=button child=span(class="MuiBadge-badge" childText="1") click element=button child=span(class="MuiBadge-badge" childText="1")
sleep 2000 "korb click" sleep 200 "korb click"
wait element=button childText="Weiter zur Kasse" wait element=button childText="Weiter zur Kasse"
click element=button childText="Weiter zur Kasse" click element=button childText="Weiter zur Kasse"
sleep 2000 "weiter click" sleep 200 "weiter click"
wait element=input type="email" wait element=input type="email"
fill element=input type="email" value="autotest@growheads.de" fill element=input type="email" value="autotest@growheads.de"
sleep 2000 "email fill" sleep 200 "email fill"
wait element=input type="password" wait element=input type="password"
fill element=input type="password" value="$PASSWORD" fill element=input type="password" value="$PASSWORD"
sleep 2000 "password fill" sleep 200 "password fill"
wait element=button childText="ANMELDEN" class="MuiButton-fullWidth" wait element=button childText="ANMELDEN" class="MuiButton-fullWidth"
click element=button childText="ANMELDEN" class="MuiButton-fullWidth" click element=button childText="ANMELDEN" class="MuiButton-fullWidth"
sleep 3000 "anmelden click" sleep 300 "anmelden click"
# Part 2 - Fill in the checkout form # Part 2 - Fill in the checkout form
scroll element=span childText="Vorname" scroll element=span childText="Vorname"
wait element=input name="firstName" wait element=input name="firstName"
fill element=input name="firstName" value="Max" fill element=input name="firstName" value="Max"
sleep 1000 "vorname fill" sleep 100 "vorname fill"
wait element=input name="lastName" wait element=input name="lastName"
fill element=input name="lastName" value="Muster" fill element=input name="lastName" value="Muster"
sleep 1000 "nachname fill" sleep 100 "nachname fill"
wait element=input name="street" wait element=input name="street"
fill element=input name="street" value="Muster" fill element=input name="street" value="Muster"
sleep 1000 "strasse fill" sleep 100 "strasse fill"
wait element=input name="houseNumber" wait element=input name="houseNumber"
fill element=input name="houseNumber" value="420" fill element=input name="houseNumber" value="420"
sleep 1000 "hausnummer fill" sleep 100 "hausnummer fill"
wait element=input name="postalCode" wait element=input name="postalCode"
fill element=input name="postalCode" value="42023" fill element=input name="postalCode" value="42023"
sleep 1000 "plz fill" sleep 100 "plz fill"
wait element=input name="city" wait element=input name="city"
fill element=input name="city" value="Muster" fill element=input name="city" value="Muster"
sleep 1000 "stadt fill" sleep 100 "stadt fill"
wait element=textarea name="note" wait element=textarea name="note"
fill element=textarea name="note" value="Musteranmerkung" fill element=textarea name="note" value="Musteranmerkung"
sleep 1000 "note fill" sleep 100 "note fill"
scroll element=button childText="Bestellung abschließen" scroll element=button childText="Bestellung abschließen"
wait element=label childText="Bestimmungen" wait element=label childText="Bestimmungen"
click element=label childText="Bestimmungen" click element=label childText="Bestimmungen"
sleep 1000 "checkbox checked" sleep 100 "checkbox checked"
wait element=button childText="Bestellung abschließen" wait element=button childText="Bestellung abschließen"
click element=button childText="Bestellung abschließen" click element=button childText="Bestellung abschließen"
sleep 3000 "order completion" sleep 300 "order completion"
# Part 3 - Login to the email account # Part 3 - Login to the email account
open "https://mail.growbnb.de/" open "https://mail.growbnb.de/"