Skip to content

Issue_268_HEADER_structure #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/base_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'):
Expand Down
12 changes: 4 additions & 8 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand All @@ -41,17 +42,15 @@ 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):
return all(element.is_displayed() for element in self.get_structure_of_3rd_level())

@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")
Expand All @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down