Exemplo n.º 1
0
 def test_cart_in_header_add_from_catalog(self):
     header_cart = HeaderPage(self.driver)
     catalog = CatalogPage(self.driver)
     self.driver.get(TEST_URL + project_page.get('category'))
     catalog.click_first_buy_button()
     assert catalog.check_present_button_in_cart
     assert '1' == header_cart.text_digit_cart_header
     assert header_cart.text_cart_price in catalog.text_first_price
Exemplo n.º 2
0
 def __init__(self):
     self.driver = webdriver.Chrome()  #Chrome  Ie  Firefox
     self.catalog_page = CatalogPage(self.driver)
     self.general_page = GenaralPage(self.driver)
     self.info_page = InfoPage(self.driver)
     self.prices_page = PricesPage(self.driver)
     self.login = Login(self.driver)
     self.product = Product(self)
     self.supporting = Supporting(self.driver)
Exemplo n.º 3
0
 def __init__(self, browser):
     if browser == "chrome":
         self.driver = webdriver.Chrome()
     elif browser == "firefox":
         self.driver = webdriver.Firefox()
     time.sleep(1.3)
     self.driver.maximize_window()
     self.driver.implicitly_wait(10)
     self.driver.set_page_load_timeout(20)
     self.base = BasePage(self.driver)
     self.catalog = CatalogPage(self.driver)
Exemplo n.º 4
0
 def __init__(self):
     self.driver = webdriver.Chrome()
     self.driver.maximize_window()
     self.home_page = HomePage(self.driver)
     self.create_account_page = CreateAccountPage(self.driver)
     self.admin_panel_login_page = AdminPanelLoginPage(self.driver)
     self.admin_page = AdminPage(self.driver)
     self.customer_list_page = CustomerListPage(self.driver)
     self.countries_page = CountriesPage(self.driver)
     self.geo_zones_page = GeoZonesPage(self.driver)
     self.catalog_page = CatalogPage(self.driver)
Exemplo n.º 5
0
 def test_full_search_result_click_category(self, current_language, side):
     main = MainPage(self.driver)
     full_search_result = FullSearchResultPage(self.driver)
     category = CatalogPage(self.driver)
     self.driver.get(TEST_URL)
     self.change_language(self.driver, current_language)
     main.click_search_field()
     main.fill_search_field(self.brand)
     expected_category_name = f"{full_search_result.text_first_category(side).upper()} {self.brand.upper()}"
     expected_category_url = full_search_result.url_first_category(side)
     full_search_result.click_first_category(side)
     assert category.check_title(expected_category_name)
     assert expected_category_url == self.driver.current_url
Exemplo n.º 6
0
 def test_full_search_result_click_group(self, current_language):
     main = MainPage(self.driver)
     full_search_result = FullSearchResultPage(self.driver)
     group = CatalogPage(self.driver)
     self.driver.get(TEST_URL)
     self.change_language(self.driver, current_language)
     main.click_search_field()
     main.fill_search_field(self.brand)
     expected_group_name = full_search_result.text_first_group.strip()
     expected_group_url = full_search_result.url_first_group
     full_search_result.click_first_group()
     assert group.check_title(expected_group_name.upper())
     assert expected_group_url == self.driver.current_url
Exemplo n.º 7
0
    def test_search_categories(self, current_language):

        search_category = {
            'RU': 'жидкости охлаждающие и сопутствующие товары',
            'UA': 'рідини охолоджуючі та супутні товари',
            'EN': 'liquid cooling and related products'}

        self.driver.get(TEST_URL + project_page.get('section'))
        self.change_language(self.driver, current_language)
        section = CatalogPage(self.driver)
        section.fill_search_field(search_category.get(current_language))
        section.click_category_in_search_result()
        url = f"{TEST_URL}{language_to_url.get(current_language)}{project_page.get('category')}"
        assert url == self.driver.current_url
Exemplo n.º 8
0
    def __init__(self, browser, base_url):
        if browser == "firefox":
            self.wd = webdriver.Firefox()
        elif browser == "chrome":
            self.wd = webdriver.Chrome()
        elif browser == "ie":
            self.wd = webdriver.Ie()
        else:
            raise ValueError("Unrecognized browser %s" % browser)
#        self.wd.implicitly_wait(5)
        self.session = SessionHelper(self)
        #       self.group = GroupHelper(self)
        self.base_url = base_url
        self.catalog_page = CatalogPage(self.wd)
Exemplo n.º 9
0
 def test_comparison_info_cart_vs_catalog(self):
     module_cart = ModulePage(self.driver)
     header_cart = HeaderPage(self.driver)
     cart = CartPage(self.driver)
     catalog = CatalogPage(self.driver)
     self.driver.get(TEST_URL + project_page.get('category'))
     page_info = catalog.set_product_info()
     catalog.click_first_buy_button()
     catalog.click_first_in_cart_button()
     assert self.driver.current_url == (TEST_URL + project_page.get('cart'))
     cart_info = cart.set_product_info()
     # self.close_draggable(self.driver)
     header_cart.click_cart()
     assert module_cart.check_cart_module_info_loaded('грн')
     cart_module_info = module_cart.set_product_info()
     assert page_info == cart_info
     assert page_info == cart_module_info
Exemplo n.º 10
0
def test_catalog_page(browser):

    CatalogPage(browser).check_elements_exist_on_page()
    CatalogPage(browser).check_product_thumbs()
def catalog_page(browser: webdriver, page_logging) -> CatalogPage:
    catalog_page = CatalogPage(driver=browser, logging_enabled=page_logging)
    catalog_page.open_page()
    return catalog_page
Exemplo n.º 12
0
 def test_category_block_all_type_model(self, current_language):
     catalog = CatalogPage(self.driver)
     self.driver.get(TEST_URL + project_page.get('catalog_with_car_model'))
     self.change_language(self.driver, current_language)
     assert catalog.text_title_all_type_models == all_type_models.get(
         current_language)
Exemplo n.º 13
0
 def test_seo_text_in_category_page(self, current_language):
     seo_category_page = CatalogPage(self.driver)
     self.driver.get(TEST_URL + project_page.get('category'))
     self.change_language(self.driver, current_language)
     assert change_symbols(seo_category_page.text_seo_our_cities, '\n', '') == \
            change_symbols(seo_text_our_cities.get(current_language), '\n ', '')
def catalog_page(browser: webdriver, base_class_logging: bool) -> CatalogPage:
    catalog_page = CatalogPage(driver=browser,
                               logging_enabled=base_class_logging)
    catalog_page.open_page()
    return catalog_page
Exemplo n.º 15
0
 def __init__(self, app):
     self.app = app
     self.driver = app.driver
     self.catalog_actions = CatalogPage(driver=self.driver)
Exemplo n.º 16
0
def catalog_page(request, driver, url):
    catalog_page = CatalogPage(driver, url, request.param)
    catalog_page.open()
    return catalog_page