added 'request transaction from wallet' test
This commit is contained in:
parent
19e180179c
commit
10da67a63f
|
@ -175,10 +175,12 @@ class TestMultiplyDevices(MultiplyDeviceTestCase):
|
|||
pytest.fail('Message is shown for the user which has been removed from the GroupChat', False)
|
||||
|
||||
@pytest.mark.transaction
|
||||
@pytest.mark.parametrize("test, recipient, sender", [('group_chat', transaction_users['A_USER'],
|
||||
transaction_users['B_USER']),
|
||||
('one_to_one_chat', transaction_users['B_USER'],
|
||||
transaction_users['A_USER'])])
|
||||
@pytest.mark.parametrize("test, recipient, sender", [('group_chat',
|
||||
transaction_users['A_USER'], transaction_users['B_USER']),
|
||||
('one_to_one_chat',
|
||||
transaction_users['B_USER'], transaction_users['A_USER'])],
|
||||
ids=['group_chat',
|
||||
'one_to_one_chat'])
|
||||
def test_send_funds_via_request(self, test, recipient, sender):
|
||||
device_1, device_2 = HomeView(self.driver_1), HomeView(self.driver_2)
|
||||
recover_access(device_1,
|
||||
|
|
|
@ -28,6 +28,34 @@ class TestWallet(SingleDeviceTestCase):
|
|||
wallet_view.find_full_text('Insufficient funds')
|
||||
|
||||
@pytest.mark.wallet
|
||||
def test_request_transaction_from_wallet(self):
|
||||
home = HomeView(self.driver)
|
||||
recover_access(home,
|
||||
transaction_users_wallet['A_USER']['passphrase'],
|
||||
transaction_users_wallet['A_USER']['password'],
|
||||
transaction_users_wallet['A_USER']['username'])
|
||||
chats = home.get_chats()
|
||||
chats.wait_for_syncing_complete()
|
||||
|
||||
recipient_key = transaction_users_wallet['B_USER']['public_key']
|
||||
|
||||
chats.plus_button.click()
|
||||
chats.add_new_contact.click()
|
||||
chats.public_key_edit_box.send_keys(recipient_key)
|
||||
chats.confirm()
|
||||
chats.confirm_public_key_button.click()
|
||||
|
||||
for _ in range(3):
|
||||
chats.back_button.click()
|
||||
wallet = chats.wallet_button.click()
|
||||
wallet.request_button.click()
|
||||
wallet.amount_edit_box.scroll_to_element()
|
||||
wallet.amount_edit_box.send_keys('0.1')
|
||||
wallet.send_request_button.click()
|
||||
user_contact = chats.element_by_text(transaction_users_wallet['B_USER']['username'], 'button')
|
||||
user_contact.click()
|
||||
chats.find_text_part('Requesting 0.1 ETH')
|
||||
|
||||
@pytest.mark.parametrize("test, recipient, sender", [('sign_now', 'A_USER', 'B_USER'),
|
||||
('sign_later', 'B_USER', 'A_USER')],
|
||||
ids=['sign_now',
|
||||
|
@ -86,7 +114,8 @@ class TestWallet(SingleDeviceTestCase):
|
|||
transaction = tr_view.transactions_table.find_transaction(amount=amount)
|
||||
details_view = transaction.click()
|
||||
transaction_hash = details_view.get_transaction_hash()
|
||||
verify_transaction_in_ropsten(address=transaction_users_wallet[sender]['address'], transaction_hash=transaction_hash)
|
||||
verify_transaction_in_ropsten(address=transaction_users_wallet[sender]['address'],
|
||||
transaction_hash=transaction_hash)
|
||||
|
||||
@pytest.mark.wallet
|
||||
def test_balance_and_eth_rate(self):
|
||||
|
|
|
@ -133,6 +133,13 @@ class StatusAppIcon(BaseButton):
|
|||
"//*[@text='Status']")
|
||||
|
||||
|
||||
class ChatsButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(ChatsButton, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector(
|
||||
"//*[@text='Chats']")
|
||||
|
||||
|
||||
class BaseViewObject(object):
|
||||
def __init__(self, driver):
|
||||
self.driver = driver
|
||||
|
@ -150,6 +157,7 @@ class BaseViewObject(object):
|
|||
self.contacts_button = ContactsButton(self.driver)
|
||||
self.wallet_button = WalletButton(self.driver)
|
||||
self.discover_button = DiscoverButton(self.driver)
|
||||
self.chats_button = ChatsButton(self.driver)
|
||||
|
||||
self.save_button = SaveButton(self.driver)
|
||||
|
||||
|
|
|
@ -11,6 +11,20 @@ class SendButton(BaseButton):
|
|||
self.locator = self.Locator.xpath_selector("//*[@text='SEND']")
|
||||
|
||||
|
||||
class RequestButton(BaseButton):
|
||||
|
||||
def __init__(self, driver):
|
||||
super(RequestButton, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector("//*[@text='REQUEST']")
|
||||
|
||||
|
||||
class SendRequestButton(BaseButton):
|
||||
|
||||
def __init__(self, driver):
|
||||
super(SendRequestButton, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector("//*[@text='SEND REQUEST']")
|
||||
|
||||
|
||||
class AmountEditBox(BaseEditBox, BaseButton):
|
||||
|
||||
def __init__(self, driver):
|
||||
|
@ -66,6 +80,8 @@ class WalletViewObject(BaseViewObject):
|
|||
self.transactions_button = TransactionsButton(self.driver)
|
||||
self.eth_asset = EthAssetText(self.driver)
|
||||
self.usd_total_value = UsdTotalValueText(self.driver)
|
||||
self.request_button = RequestButton(self.driver)
|
||||
self.send_request_button = SendRequestButton(self.driver)
|
||||
|
||||
def get_usd_total_value(self):
|
||||
return float(self.usd_total_value.text)
|
||||
|
|
Loading…
Reference in New Issue