예제 #1
0
    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()
예제 #2
0
 def setUp(self):
     """Setup of myaccount"""
     super(MyAccountTestCase, self).setUp()
     # Creating user for each test to not mess with default user
     user = User(login=gen_alpha(), password='******')
     # copying missing id because create returns only password's hash once
     # it is not stored in plain text for security reason
     user.id = user.create().id
     self.account_user = user