Skip to content
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

ref_TC_13.01.19,_TC_13.01.20_Transfer_the_locator_to_the_test #339

Merged
merged 1 commit into from
Oct 8, 2023
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
12 changes: 3 additions & 9 deletions pages/main_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ def check_element_image_is_visible(self, element):
def check_image_src(self, element):
return element.get_attribute("src")

@allure.step("Get the element text")
def get_element_text(self, element):
return element.text
# @allure.step("Get the element text")
# def get_element_text(self, element):
# return element.text

@allure.step("Check the image in section 2 block 5 'home-eco' is correct in the Promo Block")
def check_image_in_section2_block5(self):
Expand Down Expand Up @@ -290,12 +290,6 @@ def check_info_block_title_in_section2_block5(self):
info_block_title = self.find_element(self.locators.SECTION_2_BLOCK_5_INFO_BLOCK_TITLE).text
return info_block_title

@allure.step("Check the text of info block in section 2 block 1 'home-pants' in the Promo Block is correct")
def check_info_block_text_in_section2_block1(self):
"""Checks the text of info-block in block 1 'home-pants'"""
info_block_text = self.find_element(self.locators.SECTION_2_BLOCK_1_INFO_BLOCK_TEXT).text
return info_block_text

@allure.step("Check the text of info block in section 2 block 2 'home-t-shirts' in the Promo Block is correct")
def check_info_block_text_in_section2_block2(self):
"""Checks the text of info-block in block 2 'home-t-shirts'"""
Expand Down
7 changes: 3 additions & 4 deletions tests/test_main_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ def test_tc_13_01_18_check_info_block_title_in_section2_block1(self, driver):
@allure.title("TC 13.01.19 - Check the display of the text in block 1 'home-pants' in the Promo Block")
def test_tc_13_01_19_check_info_block_text_in_section2_block1(self, driver):
"""This test checks if the info block text in section 2 block 1 'home-pants' is correct
in the Promo Block under header on the main page"""
in the Promo Block under header on the Main Page"""
page = PromoBlock(driver, MAIN_PAGE_URL)
page.open()
actual_text = page.check_info_block_text_in_section2_block1()
actual_text = page.get_text(self.locators.SECTION_2_BLOCK_1_INFO_BLOCK_TEXT)
expected_text = PromoBlockElementsText.SECTION_2_BLOCK_1_INFO_BLOCK_TEXT
assert actual_text == expected_text, f"Actual text '{actual_text}' in info block in section 2 block 1 " \
f"'home-pants' of Promo Block doesn't match expected '{expected_text}'"
Expand All @@ -290,8 +290,7 @@ def test_tc_13_01_20_check_info_block_sign_in_section2_block1(self, driver):
in the Promo Block under header on the Main Page"""
page = PromoBlock(driver, MAIN_PAGE_URL)
page.open()
section2_block1_sign = page.find_element(self.locators.SECTION_2_BLOCK_1_INFO_BLOCK_SIGN)
actual_text = page.get_element_text(section2_block1_sign)
actual_text = page.get_text(self.locators.SECTION_2_BLOCK_1_INFO_BLOCK_SIGN)
expected_text = PromoBlockElementsText.SECTION_2_BLOCK_1_INFO_BLOCK_SIGN
assert actual_text == expected_text, f"Actual sign '{actual_text}' in info block in section 2 block 1 " \
f"'home-pants' of Promo Block doesn't match expected '{expected_text}'"
Expand Down
Loading