diff --git a/pages/base_page.py b/pages/base_page.py index 270473d37f..3c4d7e9595 100644 --- a/pages/base_page.py +++ b/pages/base_page.py @@ -14,7 +14,7 @@ class BasePage: def __init__(self, driver, link=None): self.driver = driver self.link = link - self.timeout = 20 + self.timeout = 10 def open(self): with allure.step(f'Open page: {self.link}'): diff --git a/pages/header_page.py b/pages/header_page.py index 7565ebb257..3735d9d8bf 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -2,6 +2,8 @@ import time import allure import requests +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.wait import WebDriverWait as Wait from pages.base_page import BasePage from locators.header_page_locators import (HeaderUnauthorizedLocators, HeaderAuthorizedLocators, StartPagesLocators) @@ -32,7 +34,6 @@ def check_elements_visibility_on_1st_level_in_header(self): @allure.step("Get structure of the 2nd level of nesting the Header") def get_structure_of_2nd_level(self): - # tags = [element.tag_name for element in elements] return self.elements_are_present(self.locators.HEADER_SECOND_LEVEL_ELEMENTS) @allure.step("Check if elements of the 2nd level of nesting are visible") @@ -41,9 +42,8 @@ def check_elements_visibility_on_2nd_level_in_header(self): @allure.step("Get structure of the 3rd level of nesting the Header") def get_structure_of_3rd_level(self): - time.sleep(5) - # tags = [element.tag_name for element in elements] - return self.elements_are_present(self.locators.HEADER_THIRD_LEVEL_ELEMENTS) + return Wait(self.driver, 10).until( + EC.visibility_of_all_elements_located(self.locators.HEADER_THIRD_LEVEL_ELEMENTS)) @allure.step("Check if elements on the 3rd level of nesting are visible") def check_elements_visibility_on_3rd_level_in_header(self): @@ -51,7 +51,6 @@ def check_elements_visibility_on_3rd_level_in_header(self): @allure.step("Get structure of the 4th level of nesting the Header") def get_structure_of_4th_level(self): - # tags = [element.tag_name for element in elements] return self.elements_are_present(self.locators.HEADER_FOURTH_LEVEL_ELEMENTS) @allure.step("Check if elements on the 4th level of nesting are visible") @@ -60,7 +59,6 @@ def check_elements_visibility_on_4th_level_in_header(self): @allure.step("Get structure of the 5th level of nesting the Header") def get_structure_of_5th_level(self): - # tags = [element.tag_name for element in elements] return self.elements_are_present(self.locators.HEADER_FIFTH_LEVEL_ELEMENTS) @allure.step("Check if elements on the 5th level of nesting are visible") @@ -69,7 +67,6 @@ def check_elements_visibility_on_5th_level_in_header(self): @allure.step("Get structure of the 6th level of nesting the Header") def get_structure_of_6th_level(self): - # tags = [element.tag_name for element in elements] return self.elements_are_present(self.locators.HEADER_SIXTH_LEVEL_ELEMENTS) @allure.step("Check if elements on the 6th level of nesting are invisible") @@ -243,7 +240,6 @@ def check_buttons_auth_visibility(self): @allure.step("Get the list of 'ru' and 'en' buttons in the Header for unauthorized and authorized users") def get_list_of_ru_en_buttons(self): - # tags = [element.tag_name for element in elements] return self.elements_are_present(self.locators.RU_EN_BUTTONS) @allure.step("Check if 'ru' and 'en' buttons are visible for unauthorized and authorized users")