From bc6ed1957901d87834f534a8e4c4ef5766721cb1 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Wed, 14 Jul 2021 16:49:27 +0200 Subject: [PATCH] e2e: reset password + fix Signed-off-by: Churikova Tetiana --- .../atomic/account_management/test_profile.py | 38 +++++++++++++++++++ .../tests/atomic/chats/test_communities.py | 3 +- .../tests/atomic/chats/test_one_to_one.py | 2 +- test/appium/views/chat_view.py | 4 +- test/appium/views/profile_view.py | 6 +++ 5 files changed, 49 insertions(+), 4 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index ed3b8e6a4c..570cbb8eea 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -147,6 +147,44 @@ class TestProfileSingleDevice(SingleDeviceTestCase): self.errors.verify_no_errors() + @marks.testrail_id(695850) + @marks.medium + def test_can_reset_password(self): + sign_in = SignInView(self.driver) + home = sign_in.create_user() + new_password = basic_user['special_chars_password'] + profile = home.profile_button.click() + profile.privacy_and_security_button.click() + + profile.just_fyi("Check that can not reset password when entering wrong current password") + profile.reset_password_button.click() + profile.current_password_edit_box.send_keys(common_password + '1') + profile.new_password_edit_box.set_value(new_password) + profile.confirm_new_password_edit_box.set_value(new_password) + profile.next_button.click() + if not profile.current_password_wrong_text.is_element_displayed(): + self.errors.append("Validation error for wrong current password is not shown") + + profile.just_fyi("Check that can not procced if did not confirm new password") + profile.current_password_edit_box.clear() + profile.current_password_edit_box.set_value(common_password) + profile.new_password_edit_box.set_value(new_password) + profile.confirm_new_password_edit_box.set_value(new_password+'1') + profile.next_button.click() + + profile.just_fyi("Delete last symbol and check that can reset password") + profile.confirm_new_password_edit_box.delete_last_symbols(1) + profile.next_button.click() + profile.element_by_translation_id("password-reset-success").wait_for_element(30) + profile.element_by_translation_id("okay").click() + + profile.just_fyi("Login with new password") + sign_in.sign_in(password=new_password) + if not sign_in.home_button.is_element_displayed(): + self.errors.append("Could not sign in with new password after reset") + + self.errors.verify_no_errors() + @marks.testrail_id(6296) @marks.high def test_recover_account_from_new_user_seedphrase(self): diff --git a/test/appium/tests/atomic/chats/test_communities.py b/test/appium/tests/atomic/chats/test_communities.py index 6b701f85d6..1e8bfeb605 100644 --- a/test/appium/tests/atomic/chats/test_communities.py +++ b/test/appium/tests/atomic/chats/test_communities.py @@ -32,7 +32,7 @@ class TestCommunitiesMultipleDevices(MultipleDeviceTestCase): home_2.just_fyi("Tapping on community link and request membership") pub_2 = home_2.join_public_chat(pub_chat_name) # TODO: due to #12271 - pub_2.element_by_text(community_name).wait_for_element(180) + pub_2.element_by_text(community_name).wait_for_element(300) community_message_2 = pub_2.get_community_link_preview_by_text(community_link_text) if community_message_2.community_description != community_description: self.errors.append("Community description '%s' does not match expected" % community_message_2.community_description) @@ -48,6 +48,7 @@ class TestCommunitiesMultipleDevices(MultipleDeviceTestCase): community_1 = home_1.get_chat(community_name, community=True).click() community_1.community_options_button.click() community_1.community_info_button.click() + community_1.community_membership_request_value.wait_for_element(60) if community_1.community_membership_request_value.text != '1': self.drivers[0].fail("Membership request value '%s' is not equal expected" % community_1.community_membership_request_value) diff --git a/test/appium/tests/atomic/chats/test_one_to_one.py b/test/appium/tests/atomic/chats/test_one_to_one.py index fb287dac4a..f67ae98471 100644 --- a/test/appium/tests/atomic/chats/test_one_to_one.py +++ b/test/appium/tests/atomic/chats/test_one_to_one.py @@ -934,7 +934,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase): wallet_view.home_button.click() if 'dapp' in key: home_view.open_in_status_button.click() - if not chat_view.allow_button.is_element_displayed(): + if not (chat_view.allow_button.is_element_displayed() or chat_view.element_by_text("Can't find web3 library").is_element_displayed()): self.errors.append('No allow button is shown in case of navigating to Status dapp!') chat_view.dapp_tab_button.click() chat_view.home_button.click() diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index 807f26a2b2..df36051d3b 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -621,11 +621,11 @@ class ChatView(BaseView): return IncomingTransaction(self.driver, account, transaction_value) def get_preview_message_by_text(self, text=None) -> object: - self.driver.info('**Getting preview message for link:%s**' % text) + self.driver.info('**Getting preview message for link:** %s' % text) return PreviewMessage(self.driver, text) def get_community_link_preview_by_text(self, text=None) -> object: - self.driver.info('**Getting community preview message for link:%s**' % text) + self.driver.info('**Getting community preview message for link:** %s' % text) return CommunityLinkPreviewMessage(self.driver, text) def delete_chat(self): diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index a52b7b2a41..2066ac852f 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -202,6 +202,12 @@ class ProfileView(BaseView): self.privacy_and_security_button = Button(self.driver, accessibility_id="privacy-and-security-settings-button") self.accept_new_chats_from = Button(self.driver, accessibility_id="accept-new-chats-from") self.accept_new_chats_from_contacts_only = Button(self.driver, translation_id="contacts") + self.reset_password_button = Button(self.driver, accessibility_id="reset-password") + self.current_password_edit_box = EditBox(self.driver, accessibility_id="current-password") + self.new_password_edit_box = EditBox(self.driver, accessibility_id="new-password") + self.confirm_new_password_edit_box = EditBox(self.driver, accessibility_id="confirm-new-password") + self.current_password_wrong_text = Text(self.driver, accessibility_id="current-password-error") + # Appearance self.appearance_button = Button(self.driver, accessibility_id="appearance-settings-button") self.show_profile_pictures_of = Button(self.driver, accessibility_id="show-profile-pictures")