/* 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 100 "page load" wait element=input name="_user" id="rcmloginuser" fill element=input name="_user" id="rcmloginuser" value="autotest@growheads.de" sleep 100 "username fill" wait element=input name="_pass" id="rcmloginpwd" fill element=input name="_pass" id="rcmloginpwd" value="$PASSWORDMAIL" sleep 100 "password fill" wait element=button type="submit" id="rcmloginsubmit" click element=button type="submit" id="rcmloginsubmit" sleep 100 "login submit" # Wait for and click on the Bestellbestätigung link wait element=a childText="Bestellbestätigung" click element=a childText="Bestellbestätigung" # Click on "Mehr" button to open dropdown menu wait element=a id="messagemenulink" click element=a id="messagemenulink" sleep 300 "mehr button click" # Click on "In neuem Fenster öffnen" link wait element=a id="rcmbtn134" click element=a id="rcmbtn134" sleep 3000 "new window open" # Switch to the new window that was opened switch to new window # Wait a bit more for the new window to fully load sleep 2000 "new window load" # Verify that "Musteranmerkung" exists in the content wait element=p childText="Musteranmerkung" # Extract the order URL from the link extract href from element=a childText="https://growheads.de/profile#W-" to variable="ORDER_URL" sleep 300 "bestellbestätigung click" dump "after_bestellbestaetigung_click" sleep 3000 "bestellbestätigung click" # Delete the email by clicking "Löschen" wait element=a id="rcmbtn105" click element=a id="rcmbtn105" sleep 1000 "email deleted" # Now open the extracted URL open "$ORDER_URL" sleep 2000 "order page load" dump "order_page_from_extracted_url" dump "after_new_window_click" sleep 30000 "login submit"