def test_search_existing_product_and_register_user(self): product = "dress" user_information = PersonalInformation(email="*****@*****.**", first_name="John", last_name="Doe", password="******") user_address = Address(address="4374 Traders Alley", city="Kansas City", state="Missouri", postal_code="64106", phone_mobile="8164465964") self.browser.get('http://automationpractice.com/index.php') self.assertIn('My Store', self.browser.title) home_page = HomePage(self.browser) home_page.search_product(product) home_page.search_button() search_results = SearchPage(self.browser) res = search_results.product_found() self.assertTrue(res) search_results.select_list_view() search_results.add_to_cart_first_product_found() cart = ShoppingCartPopupPage(self.browser) cart.proceed_to_checkout() cart_summary = ShoppingCartSummary(self.browser) cart_summary.proceed_to_checkout() authentication = Authentication(self.browser) authentication.create_an_account(user_information.email) c = CreateAccount(self.browser) c.register(user_information=user_information, address=user_address)
def test_search_existing_product_sign_in_existing_user_not_tos(self): product = "dress" user_information = PersonalInformation(email="*****@*****.**", first_name="John", last_name="Doe", password="******") self.browser.get('http://automationpractice.com/index.php') self.assertIn('My Store', self.browser.title) home_page = HomePage(self.browser) home_page.sign_in() home_page.search_product(product) home_page.search_button() search_results = SearchPage(self.browser) res = search_results.product_found() self.assertTrue(res) search_results.select_list_view() search_results.add_to_cart_first_product_found() cart = ShoppingCartPopupPage(self.browser) cart.proceed_to_checkout() cart_summary = ShoppingCartSummary(self.browser) cart_summary.proceed_to_checkout() authentication = Authentication(self.browser) authentication.sign_in(user=user_information) addresses = Addresses(self.browser) addresses.proceed_to_checkout() shipping = Shipping(self.browser) shipping.proceed_to_checkout() self.assertTrue(shipping.tos_not_selected())
def test_product_correctly_inserted_into_cart_user_not_signed_in(self): product = "dress" p = Product(name="Printed Summer Dress", sku="demo_5", color="Yellow", size="S") self.browser.get('http://automationpractice.com/index.php') self.assertIn('My Store', self.browser.title) home_page = HomePage(self.browser) home_page.sign_in() home_page.search_product(product) home_page.search_button() search_results = SearchPage(self.browser) res = search_results.product_found() self.assertTrue(res) search_results.select_list_view() search_results.add_to_cart_first_product_found() cart = ShoppingCartPopupPage(self.browser) cart.proceed_to_checkout() cart_summary = ShoppingCartSummary(self.browser) self.assertTrue(cart_summary.product_correctly_inserted(p))