def test_positive_update_language(self): """Update Language in My Account :id: 87604475-3a8e-4cb1-ace4-ea874b1d9e72 :Steps: Update current User with all different Language options :expectedresults: Current User is updated :CaseImportance: Critical """ for lang, locale in LANGUAGES.items(): with self.subTest(lang): user = User(login=gen_alpha(), password='******') user.id = user.create().id with Session(self.browser, user.login, user.password): self.my_account.navigate_to_entity() self.my_account.select( locators['users.language_dropdown'], lang ) self.my_account.click(common_locators['submit']) self.my_account.navigate_to_entity() option = self.my_account.wait_until_element_exists( locators['users.selected_lang']) # Cant use directly lang because its value changes # after updating current language self.assertEqual( locale, option.get_attribute('value') ) user.delete()
def class_user_reader(self, class_user_password, class_org, class_location): try: reader_role = RoleEntity().search(query={'search': 'name="Discovery Reader"'})[0] except IndexError: pytest.fail('Discovery Manager role was not found, setup cannot continue') user = UserEntity( organization=[class_org], location=[class_location], password=class_user_password, role=[reader_role], ).create() yield user try: user.delete() except HTTPError: logger.exception('Exception while deleting class scope user entity in teardown')