Add an example test: "test_coffee_cart.py"

This commit is contained in:
Michael Mintz 2022-08-18 15:25:47 -04:00
parent fbd47f3f25
commit a53fb8de87
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
from seleniumbase import BaseCase
class CoffeeCartTest(BaseCase):
def test_coffee_cart(self):
self.open("https://coffee-cart.netlify.app/")
self.click('div[data-test="Cappucino"]')
self.click('div[data-test="Cafe_Latte"]')
self.click('div[data-test="Cafe_Breve"]')
self.click('a[aria-label="Cart page"]')
self.assert_exact_text("Total: $50.00", 'button[data-test="checkout"]')
self.click('button[data-test="checkout"]')
self.type("input#name", "Selenium Coffee")
self.type("input#email", "test@test.test")
self.click("button#submit-payment")
self.assert_text("Thanks for your purchase.", "div#app div")