def test_place_order(self): # Set the driver to ShopSite HomePage home_page = HomePage(self.driver) # Navigate to store home page store_page = home_page.get_store_page() # Sign in to the store store_page.sign_in() # Input email & password/Click sign in button store_page.input_credentials(email, password) # Navigate back to the Home Page store_page.home() # Locate test-product, and add it to cart store_page.add_to_cart() # Click on View Cart store_page.view_cart() # Click on Checkout twice store_page.checkout() # Fill in billing information store_page.fill_generic_billing() # Submit order store_page.submit_order() # Verify order in order_list in the Back Office store_page.verify_order()
def test_add_page(self): # Set the driver to ShopSite HomePage home_page = HomePage(self.driver) # Navigate to the Pages tab in navbar manage_pages_page = home_page.get_pages() # Click Add a Page manage_pages_page.add_page() # Test Text # self.add_page_text() # Test Images self.add_page_images()
def test_pageCreation(self): # Set the driver to ShopSite HomePage home_page = HomePage(self.driver) # Navigate to the Pages tab in navbar manage_pages_page = home_page.get_pages() # Navigate to create a new page screen edit_page = manage_pages_page.add_page() # Fill in Page information edit_page.fill_page_title(page_title) # Save Page edit_page.save() # Validate that the Page has been created assert page_title in edit_page.get_page_list()
def test_coupon_creation(self): # Get Logger log = self.getLogger() log.info("TEST HAS STARTED") # Set the driver to ShopSite HomePage home_page = HomePage(self.driver) # Navigate to Merchandising merchandising = home_page.get_merchandising_page() # Navigate to Coupons coupon_page = merchandising.get_coupon_page() # Click Delete Coupon to reset coupon list coupon_page.delete_coupon() time.sleep(5) # Click Add Coupon coupon_page.add_coupon() # Fill Coupon Display Name coupon_page.set_coupon_name(name) # Enter Promo Code coupon_page.set_promo(promo) x = 10 str(x) # Set Expiration Date coupon_page.set_expiration(date) # Set Discount coupon_page.set_discount(discount) # Click Create Coupon Link coupon_page.create_coupon() # Save Changes coupon_page.save() # Verify that Coupon is in coupon_list assert name in coupon_page.get_coupon_list()
def test_tab_download(self): # Get Logger log = self.getLogger() log.info("TEST HAS STARTED") # Set the driver to ShopSite HomePage home_page = HomePage(self.driver) # Navigate to Utilities utilities_page = home_page.get_utilities_page() # Click Database database_page = utilities_page.get_database_page() # Click Download database_page.download() # Loop through products and pages databases for i in fields: # Select field database_page.set_table(i) # Click Download database_page.download() # Select Tab-Delimited text format database_page.set_format(out_format) # Set Version # database_page.set_version(version) # Click Proceed database_page.proceed() # Click Return (double-click) **Check later if this could be a bug that we have to click submit twice database_page.click_return() time.sleep(1) database_page.click_return() time.sleep(1) # Verify that file has been downloaded database_page.verify_file_download()
def test_image_upload(self): # Get Logger log = self.getLogger() log.info("TEST HAS STARTED") # Set the driver to ShopSite HomePage home_page = HomePage(self.driver) # Navigate to Images images = home_page.get_images_page() # Click on Upload Images images.upload_images() # Click Choose File Button images.file_upload(filepath) # Click on Upload images.send() # Verify that Image file is in Images directory assert "starship.jpg" in images.get_image_list()
def test_product_creation(self): # Get Logger log = self.getLogger() log.info("TEST HAS STARTED") # Set the driver to ShopSite HomePage home_page = HomePage(self.driver) # Set the driver to ProductPage manage_products = home_page.get_products_page() # Click Add Product manage_products.add_product() # Fill Product name and price boxes manage_products.set_name(name) manage_products.set_price(price) # Click Save manage_products.save() # Verify product in product_list assert name in manage_products.get_product_list()