def test_verify_type_of_entry_and_detailing_start_enrollment(self, app, enrollment): with pytest.allure.step('Assert type of entry and datailing start of fields'): field_type_of_entry = app.enrollments_main_page.get_type_of_entry() field_detailing_start = app.enrollments_main_page.get_detailing_start_menu() common_methods = CommonMethods(app.driver) actual_value_type_of_entry = common_methods.get_value_from_select(field_type_of_entry) actual_value_detailing_start = common_methods.get_value_from_select(field_detailing_start) try: assert actual_value_type_of_entry == enrollment.type_of_entry assert actual_value_detailing_start == enrollment.detailing_start except AssertionError: allure.attach('screenshot', app.enrollments_page.driver.get_screenshot_as_png(), type=AttachmentType.PNG) raise
def read_in_address_page(self, person_new): """ Method read the data on the address persons page :param person_new: persons model in Person format :return: """ common_methods = CommonMethods(self.driver) self.is_this_page self.wait_until_page_generate() # reading birth place for place in self.driver.find_elements(*self.FULL_BIRTH_PLACE_TEXT): person_new.burn_place.append(place.text) # reading registration address for place in self.driver.find_elements(*self.FULL_BIRTH_REGISTRATION_TEXT): person_new.registration_place["area"].append(place.text) person_new.registration_place["index"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.INDEX_INPUT)) person_new.registration_place["type"] = self.address_type_chooser().text person_new.registration_place["street"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.STREET_INPUT)).encode('cp1251') person_new.registration_place["house"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.HOUSE_INPUT)) person_new.registration_place["apartment"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.APARTMENT_INPUT)) person_new.registration_place["is_addresses_match"] = is_checkbox_checked( self.driver.find_element(*self.IS_ADDRESSES_MATCH)) if person_new.registration_place["is_addresses_match"]: person_new.post_registration_place["index"] = person_new.registration_place["index"] person_new.post_registration_place["type"] = person_new.registration_place["type"] person_new.post_registration_place["street"] = person_new.registration_place["street"] person_new.post_registration_place["house"] = person_new.registration_place["house"] person_new.post_registration_place["apartment"] = person_new.registration_place["apartment"] return person_new # reading post address for place in self.driver.find_elements(*self.FULL_BIRTH_POST_REGISTRATION_TEXT): person_new.post_registration_place["area"].append(place.text) person_new.post_registration_place["index"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.INDEX_POST_INPUT)) person_new.post_registration_place["type"] = common_methods.get_value_from_select(self.driver.find_element(*self.ADDRESS_TYPE_POST_CHOOSER)).encode('cp1251') person_new.post_registration_place["street"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.STREET_POST_INPUT)).encode('cp1251') person_new.post_registration_place["house"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.HOUSE_POST_INPUT)).encode('cp1251') person_new.post_registration_place["apartment"] = common_methods.get_value_from_text_field(self.driver.find_element(*self.APARTMENT_POST_INPUT)) return person_new