Skip to content

Commit 9d56b3c

Browse files
Merge pull request #569 from Brain-up/issue_433
Issue_433_EXERCISES_WORDS_RU_PAGE_tests
2 parents 5487b8c + 3e9964e commit 9d56b3c

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

pages/exercises_ru_words_page.py

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,109 +22,88 @@ def check_visibility_of_page_content(self):
2222

2323
@allure.step("Get structure of the 1st level of nesting on the page")
2424
def get_structure_of_1st_level(self):
25-
elements = self.elements_are_present(self.locators.PAGE_FIRST_LEVEL_ELEMENTS)
26-
tags = [element.tag_name for element in elements]
27-
return elements
25+
# tags = [element.tag_name for element in elements]
26+
return self.elements_are_present(self.locators.PAGE_FIRST_LEVEL_ELEMENTS)
2827

2928
@allure.step("Check if elements of the 1st level of nesting are visible")
3029
def check_elements_visibility_on_1st_level(self):
3130
return all(element.is_displayed() for element in self.get_structure_of_1st_level())
3231

3332
@allure.step("Get structure of the 2nd level of nesting on the page")
3433
def get_structure_of_2nd_level(self):
35-
elements = self.elements_are_present(self.locators.PAGE_SECOND_LEVEL_ELEMENTS)
36-
tags = [element.tag_name for element in elements]
37-
return elements
34+
return self.elements_are_present(self.locators.PAGE_SECOND_LEVEL_ELEMENTS)
3835

3936
@allure.step("Check if elements of the 2nd level of nesting are visible")
4037
def check_elements_visibility_on_2nd_level(self):
4138
return all(element.is_displayed() for element in self.get_structure_of_2nd_level())
4239

4340
@allure.step("Get structure of the 3rd level of nesting on the page")
4441
def get_structure_of_3rd_level(self):
45-
elements = self.elements_are_present(self.locators.PAGE_THIRD_LEVEL_ELEMENTS)
46-
tags = [element.tag_name for element in elements]
47-
return elements
42+
return self.elements_are_present(self.locators.PAGE_THIRD_LEVEL_ELEMENTS)
4843

4944
@allure.step("Check if elements of the 3rd level of nesting are visible")
5045
def check_elements_visibility_on_3rd_level(self):
5146
return all(element.is_displayed() for element in self.get_structure_of_3rd_level())
5247

5348
@allure.step("Get structure of the 4th level of nesting on the page")
5449
def get_structure_of_4th_level(self):
55-
elements = self.elements_are_present(self.locators.PAGE_FOURTH_LEVEL_ELEMENTS)
56-
tags = [element.tag_name for element in elements]
57-
return elements
50+
return self.elements_are_present(self.locators.PAGE_FOURTH_LEVEL_ELEMENTS)
5851

5952
@allure.step("Check if elements of the 4th level of nesting are visible")
6053
def check_elements_visibility_on_4th_level(self):
6154
return all(element.is_displayed() for element in self.get_structure_of_4th_level())
6255

6356
@allure.step("Get structure of the 5th level of nesting on the page")
6457
def get_structure_of_5th_level(self):
65-
elements = self.elements_are_present(self.locators.PAGE_FIFTH_LEVEL_ELEMENTS)
66-
tags = [element.tag_name for element in elements]
67-
return elements
58+
return self.elements_are_present(self.locators.PAGE_FIFTH_LEVEL_ELEMENTS)
6859

6960
@allure.step("Check if elements of the 5th level of nesting are visible")
7061
def check_elements_visibility_on_5th_level(self):
7162
return all(element.is_displayed() for element in self.get_structure_of_5th_level())
7263

7364
@allure.step("Get structure of the 6th level of nesting on the page")
7465
def get_structure_of_6th_level(self):
75-
elements = self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)
76-
tags = [element.tag_name for element in elements]
77-
return elements
66+
return self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)
7867

7968
@allure.step("Check if elements of the 6th level of nesting are visible")
8069
def check_elements_visibility_on_6th_level(self):
8170
return all(element.is_displayed() for element in self.get_structure_of_6th_level())
8271

8372
@allure.step("Get structure of the 7th level of nesting on the page")
8473
def get_structure_of_7th_level(self):
85-
elements = self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS)
86-
tags = [element.tag_name for element in elements]
87-
return elements
74+
return self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS)
8875

8976
@allure.step("Check if elements of the 7th level of nesting are visible")
9077
def check_elements_visibility_on_7th_level(self):
9178
return all(element.is_displayed() for element in self.get_structure_of_7th_level())
9279

9380
@allure.step("Check the list1 on the 5th level of nesting is present on the page")
9481
def get_list1_of_breadcrumbs_links(self):
95-
elements = self.elements_are_present(self.locators.PAGE_LIST1)
96-
tags = [element.tag_name for element in elements]
97-
return elements
82+
return self.elements_are_present(self.locators.PAGE_LIST1)
9883

9984
@allure.step("Check the list1 is visible")
10085
def check_list1_visibility(self):
10186
return all(element.is_displayed() for element in self.get_list1_of_breadcrumbs_links())
10287

10388
@allure.step("Check the list2 on the 5th level of nesting is present on the page")
10489
def get_list2_of_group_links(self):
105-
elements = self.elements_are_present(self.locators.PAGE_LIST2)
106-
tags = [element.tag_name for element in elements]
107-
return elements
90+
return self.elements_are_present(self.locators.PAGE_LIST2)
10891

10992
@allure.step("Check the list2 is visible")
11093
def check_list2_visibility(self):
11194
return all(element.is_displayed() for element in self.get_list2_of_group_links())
11295

11396
@allure.step("Check the list3 on the 5th level of nesting is present on the page")
11497
def get_list3_of_subgroup_links(self):
115-
elements = self.elements_are_present(self.locators.PAGE_LIST3)
116-
tags = [element.tag_name for element in elements]
117-
return elements
98+
return self.elements_are_present(self.locators.PAGE_LIST3)
11899

119100
@allure.step("Check the list3 is visible")
120101
def check_list3_visibility(self):
121102
return all(element.is_displayed() for element in self.get_list3_of_subgroup_links())
122103

123104
@allure.step("Check the list4 on the 6th level of nesting is present on the page")
124105
def get_list4_of_links(self):
125-
elements = self.elements_are_present(self.locators.CARD_IMAGES_LIST4)
126-
tags = [element.tag_name for element in elements]
127-
return elements
106+
return self.elements_are_present(self.locators.CARD_IMAGES_LIST4)
128107

129108
@allure.step("Check the list4 is visible")
130109
def check_list4_visibility(self):

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ def auto_test_user_authorized(driver, main_page_open):
154154
page.element_is_visible(LoginPageLocators.INPUT_PASSWORD).send_keys(os.environ["PASSWORD"])
155155
page.element_is_present_and_clickable(LoginPageLocators.SIGN_IN_BUTTON).click()
156156
page.check_expected_link(MainPageLinks.URL_GROUPS_PAGE)
157-
print("Current URL:", driver.current_url) # Temporarily for debugging
158157
page = ProfilePage(driver)
159158
page.loader_checking()
160159

0 commit comments

Comments
 (0)