79 lines
3.0 KiB
Plaintext
79 lines
3.0 KiB
Plaintext
/*
|
|
PlayWrong Test - Complete E-commerce Flow
|
|
This test demonstrates the full purchase flow from product selection to order completion
|
|
with beautiful animations and environment variable support
|
|
Part 1: Load Growheads, put one item in the cart and go to checkout
|
|
Part 2: Fill in the checkout form
|
|
Part 3: Login to the email account
|
|
*/
|
|
use "Chrome"
|
|
|
|
# Part 1 - Load Growheads, put one item in the cart and go to checkout
|
|
open "https://growheads.de"
|
|
sleep 2000 "page load"
|
|
wait element=a href=/Kategorie/Seeds
|
|
click element=a href=/Kategorie/Seeds
|
|
sleep 2000 "seed click"
|
|
wait element=button childText="In den Korb"
|
|
click element=button childText="In den Korb"
|
|
sleep 2000 "in korb click"
|
|
wait element=span class="MuiBadge-badge" childText="1"
|
|
click element=button child=span(class="MuiBadge-badge" childText="1")
|
|
sleep 2000 "korb click"
|
|
wait element=button childText="Weiter zur Kasse"
|
|
click element=button childText="Weiter zur Kasse"
|
|
sleep 2000 "weiter click"
|
|
wait element=input type="email"
|
|
fill element=input type="email" value="autotest@growheads.de"
|
|
sleep 2000 "email fill"
|
|
wait element=input type="password"
|
|
fill element=input type="password" value="$PASSWORD"
|
|
sleep 2000 "password fill"
|
|
wait element=button childText="ANMELDEN" class="MuiButton-fullWidth"
|
|
click element=button childText="ANMELDEN" class="MuiButton-fullWidth"
|
|
sleep 3000 "anmelden click"
|
|
|
|
# Part 2 - Fill in the checkout form
|
|
scroll element=span childText="Vorname"
|
|
wait element=input name="firstName"
|
|
fill element=input name="firstName" value="Max"
|
|
sleep 1000 "vorname fill"
|
|
wait element=input name="lastName"
|
|
fill element=input name="lastName" value="Muster"
|
|
sleep 1000 "nachname fill"
|
|
wait element=input name="street"
|
|
fill element=input name="street" value="Muster"
|
|
sleep 1000 "strasse fill"
|
|
wait element=input name="houseNumber"
|
|
fill element=input name="houseNumber" value="420"
|
|
sleep 1000 "hausnummer fill"
|
|
wait element=input name="postalCode"
|
|
fill element=input name="postalCode" value="42023"
|
|
sleep 1000 "plz fill"
|
|
wait element=input name="city"
|
|
fill element=input name="city" value="Muster"
|
|
sleep 1000 "stadt fill"
|
|
wait element=textarea name="note"
|
|
fill element=textarea name="note" value="Musteranmerkung"
|
|
sleep 1000 "note fill"
|
|
scroll element=button childText="Bestellung abschließen"
|
|
wait element=label childText="Bestimmungen"
|
|
click element=label childText="Bestimmungen"
|
|
sleep 1000 "checkbox checked"
|
|
wait element=button childText="Bestellung abschließen"
|
|
#click element=button childText="Bestellung abschließen"
|
|
sleep 3000 "order completion"
|
|
|
|
# Part 3 - Login to the email account
|
|
open "https://mail.growbnb.de/"
|
|
sleep 2000 "page load"
|
|
wait element=input name="_user" id="rcmloginuser"
|
|
fill element=input name="_user" id="rcmloginuser" value="autotest@growheads.de"
|
|
sleep 1000 "username fill"
|
|
wait element=input name="_pass" id="rcmloginpwd"
|
|
fill element=input name="_pass" id="rcmloginpwd" value="$PASSWORDMAIL"
|
|
sleep 1000 "password fill"
|
|
wait element=button type="submit" id="rcmloginsubmit"
|
|
click element=button type="submit" id="rcmloginsubmit"
|
|
sleep 3000 "login submit"
|
|
dump "email_logged_in" |