From 4cd85154a32d497e8c98cb8a3a14e324a591d000 Mon Sep 17 00:00:00 2001 From: yevh-berdnyk Date: Thu, 26 Apr 2018 18:05:53 +0300 Subject: [PATCH] Fixed transaction tests and account recovery method Signed-off-by: Anton Danchenko --- test/appium/tests/test_transaction.py | 4 ++-- test/appium/views/base_view.py | 10 +++++++--- test/appium/views/sign_in_view.py | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/test/appium/tests/test_transaction.py b/test/appium/tests/test_transaction.py index 75d7aacb93..64969f87c1 100644 --- a/test/appium/tests/test_transaction.py +++ b/test/appium/tests/test_transaction.py @@ -178,8 +178,8 @@ class TestTransaction(SingleDeviceTestCase): @pytest.mark.pr def test_send_eth_from_wallet_sign_now(self): - sender = transaction_users_wallet['A_USER'] - recipient = transaction_users_wallet['B_USER'] + sender = transaction_users['F_USER'] + recipient = transaction_users['E_USER'] sign_in_view = SignInView(self.driver) sign_in_view.recover_access(sender['passphrase'], sender['password']) home_view = sign_in_view.get_home_view() diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index 6bb3d8ebc0..ef19df00c2 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -202,15 +202,19 @@ class BaseView(object): keys = {'0': 7, '1': 8, '2': 9, '3': 10, '4': 11, '5': 12, '6': 13, '7': 14, '8': 15, '9': 16, ',': 55, '-': 69, '+': 81, '.': 56, '/': 76, '\\': 73, ';': 74, ' ': 62, - '[': 71, ']': 72, '=': 70, '\n': 66, + '[': 71, ']': 72, '=': 70, '\n': 66, '_': [69, 5], 'a': 29, 'b': 30, 'c': 31, 'd': 32, 'e': 33, 'f': 34, 'g': 35, 'h': 36, 'i': 37, 'j': 38, 'k': 39, 'l': 40, 'm': 41, 'n': 42, 'o': 43, 'p': 44, 'q': 45, 'r': 46, 's': 47, 't': 48, 'u': 49, 'v': 50, 'w': 51, 'x': 52, 'y': 53, 'z': 54} + time.sleep(3) for i in string: info("Tap '%s' on native keyboard" % i) - time.sleep(1) - self.driver.press_keycode(keys[i]) + if type(keys[i]) is list: + keycode, metastate = keys[i][0], keys[i][1] + else: + keycode, metastate = keys[i], None + self.driver.press_keycode(keycode=keycode, metastate=metastate) def find_full_text(self, text, wait_time=60): info("Looking for full text: '%s'" % text) diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index f3cf1909d0..5a0e51d074 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -111,9 +111,10 @@ class SignInView(BaseView): def recover_access(self, passphrase, password): recover_access_view = self.i_have_account_button.click() - recover_access_view.passphrase_input.set_value(passphrase) + recover_access_view.passphrase_input.click() + recover_access_view.send_as_keyevent(passphrase) recover_access_view.password_input.click() - recover_access_view.password_input.set_value(password) + recover_access_view.send_as_keyevent(password) recover_access_view.sign_in_button.click() self.do_not_share.wait_for_element(10) self.do_not_share.click_until_presence_of_element(self.home_button)