2
2
import time
3
3
import allure
4
4
import requests
5
+ from selenium .webdriver .support import expected_conditions as EC
6
+ from selenium .webdriver .support .wait import WebDriverWait as Wait
5
7
from pages .base_page import BasePage
6
8
from locators .header_page_locators import (HeaderUnauthorizedLocators , HeaderAuthorizedLocators ,
7
9
StartPagesLocators )
@@ -32,7 +34,6 @@ def check_elements_visibility_on_1st_level_in_header(self):
32
34
33
35
@allure .step ("Get structure of the 2nd level of nesting the Header" )
34
36
def get_structure_of_2nd_level (self ):
35
- # tags = [element.tag_name for element in elements]
36
37
return self .elements_are_present (self .locators .HEADER_SECOND_LEVEL_ELEMENTS )
37
38
38
39
@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):
41
42
42
43
@allure .step ("Get structure of the 3rd level of nesting the Header" )
43
44
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 ))
47
47
48
48
@allure .step ("Check if elements on the 3rd level of nesting are visible" )
49
49
def check_elements_visibility_on_3rd_level_in_header (self ):
50
50
return all (element .is_displayed () for element in self .get_structure_of_3rd_level ())
51
51
52
52
@allure .step ("Get structure of the 4th level of nesting the Header" )
53
53
def get_structure_of_4th_level (self ):
54
- # tags = [element.tag_name for element in elements]
55
54
return self .elements_are_present (self .locators .HEADER_FOURTH_LEVEL_ELEMENTS )
56
55
57
56
@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):
60
59
61
60
@allure .step ("Get structure of the 5th level of nesting the Header" )
62
61
def get_structure_of_5th_level (self ):
63
- # tags = [element.tag_name for element in elements]
64
62
return self .elements_are_present (self .locators .HEADER_FIFTH_LEVEL_ELEMENTS )
65
63
66
64
@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):
69
67
70
68
@allure .step ("Get structure of the 6th level of nesting the Header" )
71
69
def get_structure_of_6th_level (self ):
72
- # tags = [element.tag_name for element in elements]
73
70
return self .elements_are_present (self .locators .HEADER_SIXTH_LEVEL_ELEMENTS )
74
71
75
72
@allure .step ("Check if elements on the 6th level of nesting are invisible" )
@@ -243,7 +240,6 @@ def check_buttons_auth_visibility(self):
243
240
244
241
@allure .step ("Get the list of 'ru' and 'en' buttons in the Header for unauthorized and authorized users" )
245
242
def get_list_of_ru_en_buttons (self ):
246
- # tags = [element.tag_name for element in elements]
247
243
return self .elements_are_present (self .locators .RU_EN_BUTTONS )
248
244
249
245
@allure .step ("Check if 'ru' and 'en' buttons are visible for unauthorized and authorized users" )
0 commit comments