Add tests for send tx in Dapp

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-02-18 10:12:55 +02:00
parent 9a5707583e
commit 8def565664
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
4 changed files with 71 additions and 2 deletions

View File

@ -61,6 +61,48 @@ class TestTransactionDApp(SingleDeviceTestCase):
if not status_test_dapp.element_by_text(text).is_element_displayed(120):
pytest.fail('Contract was not created')
@marks.testrail_id(5743)
@marks.high
def test_send_two_transactions_in_batch_in_dapp(self):
sender = transaction_senders['W']
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(sender['passphrase'])
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
status_test_dapp = home_view.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click()
send_transaction_view = status_test_dapp.send_two_tx_in_batch_button.click()
send_transaction_view.sign_transaction()
# Check that second 'Send transaction' screen appears
if not send_transaction_view.element_by_text('SIGN TRANSACTION').is_element_displayed(10):
pytest.fail('Second send transaction screen did not appear!')
send_transaction_view.sign_transaction()
@marks.testrail_id(5744)
@marks.high
def test_send_two_transactions_one_after_another_in_dapp(self):
sender = transaction_senders['Z']
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(sender['passphrase'])
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
status_test_dapp = home_view.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click()
send_transaction_view = status_test_dapp.send_two_tx_one_by_one_button.click()
send_transaction_view.sign_transaction()
# Check that second 'Send transaction' screen appears
if not send_transaction_view.element_by_text('SIGN TRANSACTION').is_element_displayed(20):
pytest.fail('Second send transaction screen did not appear!')
send_transaction_view.sign_transaction()
@marks.logcat
@marks.testrail_id(5418)
@marks.critical

View File

@ -232,6 +232,13 @@ transaction_senders['Y']['address'] = "0x2a5ed44a7092404ae08369ffde6e54ce47e3761
transaction_senders['Y']['public_key'] = "0x04a6515d7f2a1659948429487ba3b747cc1860c29e304a5482492226ab65056c1c6ba6a" \
"5def258316d22882e43dd2b1b98b0f8d2488a7a5a967ac6d86c2a1088e2"
transaction_senders['Z'] = dict()
transaction_senders['Z']['passphrase'] = "congress club image core lens hope clever transfer tiny true alien favorite"
transaction_senders['Z']['username'] = "Plastic Alienated Neonblueguppy"
transaction_senders['Z']['address'] = "29ff033fa04f5ba4192823ddbf23f8397809995c"
transaction_senders['Z']['public_key'] = "0x04c731338a65f130b04c727c4135d0a6e2e9d0df180390d57156fdcc7b541b0681e4be56" \
"d48186c36892a97c627899520b9b89bc6c1521d6c89746f5419460ea9b"
transaction_recipients = dict()
transaction_recipients['A'] = dict()

View File

@ -207,8 +207,8 @@ class SendTransactionView(BaseView):
def sign_transaction(self, sender_password: str = common_password):
self.sign_transaction_button.click_until_presence_of_element(self.enter_password_input)
self.enter_password_input.send_keys(sender_password)
self.sign_transaction_button.click_until_presence_of_element(self.progress_bar)
self.progress_bar.wait_for_invisibility_of_element(60)
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()
def get_transaction_fee_total(self):

View File

@ -46,6 +46,24 @@ class TransactionsButton(BaseButton):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
class SendTwoTxOneByOneButton(BaseButton):
def __init__(self, driver):
super(TransactionsButton.SendTwoTxOneByOneButton, self).__init__(driver)
self.locator = self.Locator.text_selector('Send two Txs, one after another, 0.00001 and 0.00002 ETH')
def navigate(self):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
class SendTwoTxInBatchButton(BaseButton):
def __init__(self, driver):
super(TransactionsButton.SendTwoTxInBatchButton, self).__init__(driver)
self.locator = self.Locator.text_selector('Send two Txs in batch, 0.00001 and 0.00002 ETH')
def navigate(self):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
class TestFiltersButton(BaseButton):
def __init__(self, driver):
super(TransactionsButton.TestFiltersButton, self).__init__(driver)
@ -88,6 +106,8 @@ class StatusTestDAppView(BaseWebView):
self.sign_message_button = TransactionsButton.SignMessageButton(self.driver)
self.deploy_contract_button = TransactionsButton.DeployContractButton(self.driver)
self.send_one_tx_in_batch_button = SendOneTransactionInBatchButton(self.driver)
self.send_two_tx_one_by_one_button = TransactionsButton.SendTwoTxOneByOneButton(self.driver)
self.send_two_tx_in_batch_button = TransactionsButton.SendTwoTxInBatchButton(self.driver)
self.test_filters_button = TransactionsButton.TestFiltersButton(self.driver)
self.status_api_button = StatusAPIButton(self.driver)