示例#1
0
def test_catalog(browser, opencart_base_url, catalog_page):
    catalog_page.open(opencart_base_url, 20)
    get_element(browser, catalog_page.BREADCRUMBS)
    get_element(browser, catalog_page.SIDEBAR)
    get_element(browser, catalog_page.LIST_VIEW_BUTTON)
    get_element(browser, catalog_page.GRID_VIEW_BUTTON)
    get_element(browser, catalog_page.PAGINATION_INFO)
def test_login_page(browser, opencart_base_url, login_page):
    login_page.open(opencart_base_url)
    get_element(browser, login_page.EMAIL_FIELD)
    get_element(browser, login_page.PASSWORD_FIELD)
    get_element(browser, login_page.FORGOTTEN_PASSWORD_LINK)
    get_element(browser, login_page.NEW_CUSTOMER_BLOCK)
    get_element(browser, login_page.RETURNING_CUSTOMER_BLOCK)
示例#3
0
def test_homepage(browser, opencart_base_url, home_page):
    home_page.open(opencart_base_url)
    get_element(browser, home_page.MENU)
    get_element(browser, home_page.SLIDER)
    get_element(browser, home_page.SLIDER_PAGINATION)
    get_element(browser, home_page.BRANDS_SLIDER)
    get_element(browser, home_page.FEATURED_HEADER)
示例#4
0
def test_product(browser, opencart_base_url, product_page):
    product_page.open(opencart_base_url, 57, 49)
    get_element(browser, product_page.PRODUCT_TITLE)
    get_element(browser, product_page.PRODUCT_CODE)
    get_element(browser, product_page.TAX)
    get_element(browser, product_page.WISH_LIST_BUTTON)
    get_element(browser, product_page.COMPARE_BUTTON)
示例#5
0
 def fill_form(self, product_name, meta_title_tag, model):
     get_element(self.driver,
                 self.PRODUCT_NAME_FIELD).send_keys(product_name)
     get_element(self.driver,
                 self.META_TITLE_TAG_FIELD).send_keys(meta_title_tag)
     get_element(self.driver, self.DATA_TAB).click()
     get_element(self.driver, self.MODEL_FIELD).send_keys(model)
 def login(self, username, password):
     get_element(self.driver, self.USERNAME_FIELD).send_keys(username)
     get_element(self.driver, self.PASSWORD_FIELD).send_keys(password)
     get_element(self.driver, self.LOGIN_BUTTON).click()
示例#7
0
 def get_currency(self):
     return get_element(self.driver, self.CURRENCY_DROPDOWN).text.strip()
示例#8
0
 def change_currency(self, code):
     currency_locator = (
         By.CSS_SELECTOR,
         '#top .pull-left .dropdown-menu button[name="{}"]'.format(code))
     get_element(self.driver, self.CURRENCY_DROPDOWN).click()
     get_element(self.driver, currency_locator).click()
示例#9
0
 def send_form(self, first_name, last_name, email, telephone, password):
     get_element(self.driver, self.FIRST_NAME_FIELD).send_keys(first_name)
     get_element(self.driver, self.LAST_NAME_FIELD).send_keys(last_name)
     get_element(self.driver, self.EMAIL_FIELD).send_keys(email)
     get_element(self.driver, self.TELEPHONE_FIELD).send_keys(telephone)
     get_element(self.driver, self.PASSWORD_FIELD).send_keys(password)
     get_element(self.driver,
                 self.PASSWORD_CONFIRM_FIELD).send_keys(password)
     get_element(self.driver, self.AGREEMENT_CHECKBOX).click()
     get_element(self.driver, self.CONTINUE_BUTTON).click()
 def assert_success_notification(self):
     get_element(self.driver, self.SUCCESS_NOTIFICATION)
 def delete_last_product(self):
     get_element(self.driver, self.LAST_PRODUCT_CHECKBOX).click()
     get_element(self.driver, self.DELETE_BUTTON).click()
     self.driver.switch_to.alert.accept()
 def add_product(self):
     get_element(self.driver, self.ADD_PRODUCT_BUTTON).click()
示例#13
0
 def submit_form(self):
     get_element(self.driver, self.SAVE_BUTTON).click()
示例#14
0
 def open_sub_menu(self, submenu_locator):
     get_element(self.driver, submenu_locator).click()
示例#15
0
 def open_menu(self, menu_locator):
     get_element(self.driver, menu_locator).click()