Skip to content

Commit

Permalink
e2e fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
antdanchenko authored and flexsurfer committed Jun 12, 2019
1 parent 7de2941 commit d1b991f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/status_im/ui/screens/signing/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@
(defn signing-view [tx window-height]
(let [bottom-anim-value (anim/create-value (- window-height))
alpha-value (anim/create-value 0)
clear-timeout (atom nil)
current-tx (reagent/atom nil)
update? (reagent/atom nil)]
(reagent/create-class
{:component-will-update (fn [_ [_ tx _]]
(when @clear-timeout (js/clearTimeout @clear-timeout))
(cond
@update?
(do (reset! update? false)
Expand All @@ -183,7 +185,7 @@
(show-panel-anim bottom-anim-value alpha-value))

:else
(do (js/setTimeout #(reset! current-tx nil) 500)
(do (reset! clear-timeout (js/setTimeout #(reset! current-tx nil) 500))
(hide-panel-anim bottom-anim-value alpha-value (- window-height)))))
:reagent-render (fn []
(when @current-tx
Expand Down
1 change: 1 addition & 0 deletions test/appium/tests/atomic/chats/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def test_network_mismatch_for_send_request_commands(self):

@marks.testrail_id(5306)
@marks.critical
@marks.skip
def test_send_eth_in_1_1_chat(self):
recipient = transaction_recipients['A']
sender = transaction_senders['A']
Expand Down
11 changes: 3 additions & 8 deletions test/appium/tests/atomic/transactions/test_daaps_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ def test_send_transaction_from_daap(self):
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.assets_button.click()
send_transaction_view = status_test_dapp.request_stt_button.click()
wallet_view = send_transaction_view.get_wallet_view()
wallet_view.done_button.click()
wallet_view.yes_button.click()
send_transaction_view.sign_transaction()
self.network_api.verify_balance_is_updated(initial_balance, address)

Expand All @@ -39,10 +36,8 @@ def test_sign_message_from_daap(self):
status_test_dapp.transactions_button.click()
send_transaction_view = status_test_dapp.sign_message_button.click()
send_transaction_view.find_full_text('Test message')
send_transaction_view.sign_transaction_button.click_until_presence_of_element(
send_transaction_view.enter_password_input)
send_transaction_view.enter_password_input.send_keys(password)
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_button.click()

@marks.testrail_id(5333)
@marks.critical
Expand Down Expand Up @@ -75,7 +70,7 @@ def test_sign_typed_message(self):
status_test_dapp.transactions_button.click()
send_transaction_view = status_test_dapp.sign_typed_message_button.click()
send_transaction_view.enter_password_input.send_keys(common_password)
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_button.click()
status_test_dapp.find_text_part('0xde3048417e5881acc9ca8466ab0b3e2f9f965a70acabbda2d140e95a28b13d2d'
'2d38eba6c0a5bfdc50e5d59e0ed3226c749732fd4a9374b57f34121eaff2a5081c')

Expand Down Expand Up @@ -148,7 +143,7 @@ def test_logcat_sign_message_from_daap(self):
send_transaction_view.sign_transaction_button.click_until_presence_of_element(
send_transaction_view.enter_password_input)
send_transaction_view.enter_password_input.send_keys(unique_password)
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_button.click()
send_transaction_view.check_no_values_in_logcat(password=unique_password)

@marks.testrail_id(5372)
Expand Down
10 changes: 10 additions & 0 deletions test/appium/tests/atomic/transactions/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_send_eth_from_wallet_to_contact(self):
recent_recipient = send_transaction.element_by_text(recipient['username'])
send_transaction.recent_recipients_button.click_until_presence_of_element(recent_recipient)
recent_recipient.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(sender['address'], transaction_amount)

Expand All @@ -55,6 +56,7 @@ def test_send_eth_from_wallet_to_address(self):
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(sender['address'], transaction_amount)

Expand Down Expand Up @@ -82,6 +84,7 @@ def test_send_stt_from_wallet(self):
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount, token=True)

Expand Down Expand Up @@ -132,6 +135,7 @@ def test_transaction_appears_in_history(self):
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(recipient['address'], transaction_amount)
transactions_view = wallet_view.transaction_history_button.click()
Expand Down Expand Up @@ -178,6 +182,7 @@ def test_logcat_send_transaction_from_wallet(self):
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction(unique_password)
send_transaction.check_no_values_in_logcat(password=unique_password)

Expand Down Expand Up @@ -205,6 +210,7 @@ def test_send_token_with_7_decimals(self):
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount, token=True, decimals=7)

Expand Down Expand Up @@ -260,6 +266,7 @@ def test_send_valid_amount_after_insufficient_funds_error(self):
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(basic_user['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(sender['address'], valid_amount)

Expand Down Expand Up @@ -314,6 +321,7 @@ def test_insufficient_funds_wallet_positive_balance(self):

@marks.testrail_id(5359)
@marks.critical
@marks.skip
def test_modify_transaction_fee_values(self):
sender = transaction_senders['U']
sign_in_view = SignInView(self.driver)
Expand Down Expand Up @@ -362,6 +370,7 @@ def test_modify_transaction_fee_values(self):
send_transaction.gas_price_input.set_value(gas_price)
send_transaction.total_fee_input.click()
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(sender['address'], amount)

Expand Down Expand Up @@ -432,6 +441,7 @@ def test_transaction_message_sending_from_wallet(self):
send_transaction.chose_recipient_button.click()
send_transaction.recent_recipients_button.click()
send_transaction.element_by_text_part(recipient['username']).click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()

wallet_1.home_button.click()
Expand Down
2 changes: 1 addition & 1 deletion test/appium/views/chat_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def send_transaction_in_1_1_chat(self, asset, amount, password=common_password,
wallet_view.done_button.click()
wallet_view.yes_button.click()
else:
self.send_message_button.click_until_presence_of_element(send_transaction_view.sign_transaction_button)
self.send_message_button.click_until_presence_of_element(send_transaction_view.sign_with_password)
if kwargs.get('sign_transaction', True):
send_transaction_view.sign_transaction(password)
chat_elem = self.chat_element_by_text(amount)
Expand Down
23 changes: 19 additions & 4 deletions test/appium/views/send_transaction_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ def __init__(self, driver):
self.not_enough_eth_for_gas = NotEnoughEthForGas(driver)


class SignWithPasswordButton(BaseButton):

def __init__(self, driver):
super(SignWithPasswordButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="Sign with password"]')


class SignButton(BaseButton):

def __init__(self, driver):
super(SignButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="Sign"]')


class SendTransactionView(BaseView):
def __init__(self, driver):
super(SendTransactionView, self).__init__(driver)
Expand All @@ -182,6 +196,8 @@ def __init__(self, driver):

self.cancel_button = CancelButton(self.driver)
self.sign_transaction_button = SignTransactionButton(self.driver)
self.sign_with_password = SignWithPasswordButton(self.driver)
self.sign_button = SignButton(self.driver)
self.sign_in_phrase_text = SignInPhraseText(self.driver)
self.password_input = PasswordInput(self.driver)
self.enter_password_input = EnterPasswordInput(self.driver)
Expand All @@ -205,11 +221,10 @@ def complete_onboarding(self):
self.yes_button.click()

def sign_transaction(self, sender_password: str = common_password):
self.sign_transaction_button.click_until_presence_of_element(self.enter_password_input)
self.sign_with_password.click()
self.enter_password_input.send_keys(sender_password)
self.sign_transaction_button.click_until_presence_of_element(self.got_it_button)
self.progress_bar.wait_for_invisibility_of_element(20)
self.got_it_button.click()
self.sign_button.click()
self.ok_button.click()

def get_transaction_fee_total(self):
return self.transaction_fee_total_value.text.split()[0]
Expand Down

0 comments on commit d1b991f

Please sign in to comment.