Skip to content

Commit 02bb2cc

Browse files
Merge pull request #554 from Brain-up/issue_268
Issue_268_HEADER_structure
2 parents a462ae9 + 829be07 commit 02bb2cc

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

pages/base_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BasePage:
1414
def __init__(self, driver, link=None):
1515
self.driver = driver
1616
self.link = link
17-
self.timeout = 20
17+
self.timeout = 10
1818

1919
def open(self):
2020
with allure.step(f'Open page: {self.link}'):

pages/header_page.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import time
33
import allure
44
import requests
5+
from selenium.webdriver.support import expected_conditions as EC
6+
from selenium.webdriver.support.wait import WebDriverWait as Wait
57
from pages.base_page import BasePage
68
from locators.header_page_locators import (HeaderUnauthorizedLocators, HeaderAuthorizedLocators,
79
StartPagesLocators)
@@ -32,7 +34,6 @@ def check_elements_visibility_on_1st_level_in_header(self):
3234

3335
@allure.step("Get structure of the 2nd level of nesting the Header")
3436
def get_structure_of_2nd_level(self):
35-
# tags = [element.tag_name for element in elements]
3637
return self.elements_are_present(self.locators.HEADER_SECOND_LEVEL_ELEMENTS)
3738

3839
@allure.step("Check if elements of the 2nd level of nesting are visible")
@@ -41,17 +42,15 @@ def check_elements_visibility_on_2nd_level_in_header(self):
4142

4243
@allure.step("Get structure of the 3rd level of nesting the Header")
4344
def get_structure_of_3rd_level(self):
44-
time.sleep(5)
45-
# tags = [element.tag_name for element in elements]
46-
return self.elements_are_present(self.locators.HEADER_THIRD_LEVEL_ELEMENTS)
45+
return Wait(self.driver, 10).until(
46+
EC.visibility_of_all_elements_located(self.locators.HEADER_THIRD_LEVEL_ELEMENTS))
4747

4848
@allure.step("Check if elements on the 3rd level of nesting are visible")
4949
def check_elements_visibility_on_3rd_level_in_header(self):
5050
return all(element.is_displayed() for element in self.get_structure_of_3rd_level())
5151

5252
@allure.step("Get structure of the 4th level of nesting the Header")
5353
def get_structure_of_4th_level(self):
54-
# tags = [element.tag_name for element in elements]
5554
return self.elements_are_present(self.locators.HEADER_FOURTH_LEVEL_ELEMENTS)
5655

5756
@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):
6059

6160
@allure.step("Get structure of the 5th level of nesting the Header")
6261
def get_structure_of_5th_level(self):
63-
# tags = [element.tag_name for element in elements]
6462
return self.elements_are_present(self.locators.HEADER_FIFTH_LEVEL_ELEMENTS)
6563

6664
@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):
6967

7068
@allure.step("Get structure of the 6th level of nesting the Header")
7169
def get_structure_of_6th_level(self):
72-
# tags = [element.tag_name for element in elements]
7370
return self.elements_are_present(self.locators.HEADER_SIXTH_LEVEL_ELEMENTS)
7471

7572
@allure.step("Check if elements on the 6th level of nesting are invisible")
@@ -243,7 +240,6 @@ def check_buttons_auth_visibility(self):
243240

244241
@allure.step("Get the list of 'ru' and 'en' buttons in the Header for unauthorized and authorized users")
245242
def get_list_of_ru_en_buttons(self):
246-
# tags = [element.tag_name for element in elements]
247243
return self.elements_are_present(self.locators.RU_EN_BUTTONS)
248244

249245
@allure.step("Check if 'ru' and 'en' buttons are visible for unauthorized and authorized users")

0 commit comments

Comments
 (0)