Skip to content

Commit 81805ac

Browse files
Merge pull request #562 from Brain-up/issue_227
Issue_227_CONTACTS_PAGE_tests
2 parents 366c202 + 076f888 commit 81805ac

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

pages/contacts_page.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,69 +19,56 @@ def check_visibility_of_page_content(self):
1919

2020
@allure.step("Get structure of the 1st level of nesting in the section 1")
2121
def get_structure_of_1st_level_in_section1(self):
22-
elements = self.elements_are_present(self.locators.SECTION_1_FIRST_LEVEL_ELEMENTS)
2322
# tags = [element.tag_name for element in elements]
24-
return elements
23+
return self.elements_are_present(self.locators.SECTION_1_FIRST_LEVEL_ELEMENTS)
2524

2625
@allure.step("Check if elements of the 1st level of nesting are visible in the section 1")
2726
def check_elements_visibility_on_1st_level_in_section1(self):
2827
return all(element.is_displayed() for element in self.get_structure_of_1st_level_in_section1())
2928

3029
@allure.step("Get structure of the 1st level of nesting in the section 2")
3130
def get_structure_of_1st_level_in_section2(self):
32-
elements = self.elements_are_present(self.locators.SECTION_2_FIRST_LEVEL_ELEMENTS)
33-
# tags = [element.tag_name for element in elements]
34-
return elements
31+
return self.elements_are_present(self.locators.SECTION_2_FIRST_LEVEL_ELEMENTS)
3532

3633
@allure.step("Check if elements of the 1st level of nesting are visible in the section 2")
3734
def check_elements_visibility_on_1st_level_in_section2(self):
3835
return all(element.is_displayed() for element in self.get_structure_of_1st_level_in_section2())
3936

4037
@allure.step("Get structure of the 2nd level of nesting in the section 2")
4138
def get_structure_of_2nd_level_in_section2(self):
42-
elements = self.elements_are_present(self.locators.SECTION_2_SECOND_LEVEL_ELEMENTS)
43-
# tags = [element.tag_name for element in elements]
44-
return elements
39+
return self.elements_are_present(self.locators.SECTION_2_SECOND_LEVEL_ELEMENTS)
4540

4641
@allure.step("Check if elements of the 2nd level of nesting are visible in the section 2")
4742
def check_elements_visibility_on_2nd_level_in_section2(self):
4843
return all(element.is_displayed() for element in self.get_structure_of_2nd_level_in_section2())
4944

5045
@allure.step("Get structure of the 3rd level of nesting in the section 2")
5146
def get_structure_of_3rd_level_in_section2(self):
52-
elements = self.elements_are_present(self.locators.SECTION_2_THIRD_LEVEL_ELEMENTS)
53-
# tags = [element.tag_name for element in elements]
54-
return elements
47+
return self.elements_are_present(self.locators.SECTION_2_THIRD_LEVEL_ELEMENTS)
5548

5649
@allure.step("Check if elements of the 3rd level of nesting are visible in the section 2")
5750
def check_visibility_of_elements_on_3rd_level_in_section2(self):
5851
return all(element.is_displayed() for element in self.get_structure_of_3rd_level_in_section2())
5952

6053
@allure.step("Get structure of the 4th level of nesting in the section 2")
6154
def get_structure_of_4th_level_in_section2(self):
62-
elements = self.elements_are_present(self.locators.SECTION_2_FOURTH_LEVEL_ELEMENTS)
63-
# tags = [element.tag_name for element in elements]
64-
return elements
55+
return self.elements_are_present(self.locators.SECTION_2_FOURTH_LEVEL_ELEMENTS)
6556

6657
@allure.step("Check if elements of the 4th level of nesting are visible in the section 2")
6758
def check_visibility_of_elements_on_4th_level_in_section2(self):
6859
return all(element.is_displayed() for element in self.get_structure_of_4th_level_in_section2())
6960

7061
@allure.step("Get structure of the 5th level of nesting in the section 2")
7162
def get_structure_of_5th_level_in_section2(self):
72-
elements = self.elements_are_present(self.locators.SECTION_2_FIFTH_LEVEL_ELEMENTS)
73-
# tags = [element.tag_name for element in elements]
74-
return elements
63+
return self.elements_are_present(self.locators.SECTION_2_FIFTH_LEVEL_ELEMENTS)
7564

7665
@allure.step("Check if elements of the 5th level of nesting are visible in the section 2")
7766
def check_visibility_of_elements_on_5th_level_in_section2(self):
7867
return all(element.is_displayed() for element in self.get_structure_of_5th_level_in_section2())
7968

8069
@allure.step("Get structure of the page")
8170
def get_page_structure(self):
82-
elements = self.elements_are_present(self.locators.PAGE_STRUCTURE)
83-
# tags = [element.tag_name for element in elements]
84-
return elements
71+
return self.elements_are_present(self.locators.PAGE_STRUCTURE)
8572

8673
@allure.step("Check if elements of the 1st level of nesting are visible")
8774
def check_visibility_of_structural_elements(self):
@@ -93,8 +80,7 @@ def get_amount_of_sections(self):
9380

9481
@allure.step("Check if sections are visible")
9582
def check_visibility_of_sections(self):
96-
sections = self.elements_are_present(self.locators.PAGE_SECTIONS)
97-
return all(element.is_displayed() for element in sections)
83+
return all(element.is_displayed() for element in self.elements_are_present(self.locators.PAGE_SECTIONS))
9884

9985
@allure.step("Check if the dividing line is present on the page")
10086
def check_presence_of_dividing_line(self):

0 commit comments

Comments
 (0)