e2e for importing accounts
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
f645d3fbb5
commit
7b7f567361
|
@ -78,6 +78,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||||
|
|
||||||
sign_in_view.just_fyi("Start syncing in offline popup")
|
sign_in_view.just_fyi("Start syncing in offline popup")
|
||||||
sign_in_view.element_by_text("Start syncing").click()
|
sign_in_view.element_by_text("Start syncing").click()
|
||||||
|
sign_in_view.element_by_text_part(offline_banner_text).wait_for_invisibility_of_element(10)
|
||||||
if sign_in_view.element_by_text_part(offline_banner_text).is_element_displayed():
|
if sign_in_view.element_by_text_part(offline_banner_text).is_element_displayed():
|
||||||
self.driver.fail("Popup about offline history is shown")
|
self.driver.fail("Popup about offline history is shown")
|
||||||
|
|
||||||
|
|
|
@ -278,28 +278,27 @@ class TestWalletManagement(SingleDeviceTestCase):
|
||||||
|
|
||||||
@marks.testrail_id(6224)
|
@marks.testrail_id(6224)
|
||||||
@marks.critical
|
@marks.critical
|
||||||
def test_add_account_to_multiaccount_instance(self):
|
def test_add_account_to_multiaccount_instance_generate_new(self):
|
||||||
sign_in_view = SignInView(self.driver)
|
sign_in_view = SignInView(self.driver)
|
||||||
sign_in_view.create_user()
|
sign_in_view.create_user()
|
||||||
wallet_view = sign_in_view.wallet_button.click()
|
wallet_view = sign_in_view.wallet_button.click()
|
||||||
wallet_view.set_up_wallet()
|
wallet_view.set_up_wallet()
|
||||||
wallet_view.add_account_button.click()
|
wallet_view.add_account_button.click()
|
||||||
wallet_view.add_an_account_button.click()
|
wallet_view.generate_an_account_button.click()
|
||||||
wallet_view.generate_new_account_button.click()
|
wallet_view.add_account_generate_account_button.click()
|
||||||
wallet_view.generate_account_button.click()
|
|
||||||
if wallet_view.element_by_text('Account added').is_element_displayed():
|
|
||||||
self.driver.fail('Account is added without password')
|
|
||||||
wallet_view.enter_your_password_input.send_keys('000000')
|
|
||||||
wallet_view.generate_account_button.click()
|
|
||||||
if not wallet_view.element_by_text_part('Password seems to be incorrect').is_element_displayed():
|
|
||||||
self.driver.fail("Incorrect password validation is not performed")
|
|
||||||
wallet_view.enter_your_password_input.clear()
|
|
||||||
wallet_view.enter_your_password_input.send_keys(common_password)
|
|
||||||
wallet_view.generate_account_button.click()
|
|
||||||
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
||||||
wallet_view.account_name_input.send_keys(account_name)
|
wallet_view.account_name_input.send_keys(account_name)
|
||||||
wallet_view.account_color_button.select_color_by_position(1)
|
wallet_view.account_color_button.select_color_by_position(1)
|
||||||
wallet_view.finish_button.click()
|
if wallet_view.get_account_options_by_name(account_name).is_element_displayed():
|
||||||
|
self.driver.fail('Account is added without password')
|
||||||
|
wallet_view.enter_your_password_input.send_keys('000000')
|
||||||
|
wallet_view.add_account_generate_account_button.click()
|
||||||
|
# TODO: blocked due to #8567
|
||||||
|
# if not wallet_view.element_by_text_part('Password seems to be incorrect').is_element_displayed():
|
||||||
|
# self.driver.fail("Incorrect password validation is not performed")
|
||||||
|
wallet_view.enter_your_password_input.clear()
|
||||||
|
wallet_view.enter_your_password_input.send_keys(common_password)
|
||||||
|
wallet_view.add_account_generate_account_button.click()
|
||||||
account_button = wallet_view.get_account_by_name(account_name)
|
account_button = wallet_view.get_account_by_name(account_name)
|
||||||
if not account_button.is_element_displayed():
|
if not account_button.is_element_displayed():
|
||||||
self.driver.fail('Account was not added')
|
self.driver.fail('Account was not added')
|
||||||
|
@ -318,10 +317,9 @@ class TestWalletManagement(SingleDeviceTestCase):
|
||||||
wallet_view.add_account_button.click()
|
wallet_view.add_account_button.click()
|
||||||
wallet_view.add_watch_only_address_button.click()
|
wallet_view.add_watch_only_address_button.click()
|
||||||
wallet_view.enter_address_input.send_keys(basic_user['address'])
|
wallet_view.enter_address_input.send_keys(basic_user['address'])
|
||||||
wallet_view.next_button.click()
|
|
||||||
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
||||||
wallet_view.account_name_input.send_keys(account_name)
|
wallet_view.account_name_input.send_keys(account_name)
|
||||||
wallet_view.finish_button.click()
|
wallet_view.add_account_generate_account_button.click()
|
||||||
account_button = wallet_view.get_account_by_name(account_name)
|
account_button = wallet_view.get_account_by_name(account_name)
|
||||||
if not account_button.is_element_displayed():
|
if not account_button.is_element_displayed():
|
||||||
self.driver.fail('Account was not added')
|
self.driver.fail('Account was not added')
|
||||||
|
@ -357,6 +355,86 @@ class TestWalletManagement(SingleDeviceTestCase):
|
||||||
|
|
||||||
self.errors.verify_no_errors()
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
|
@marks.testrail_id(6271)
|
||||||
|
@marks.high
|
||||||
|
def test_add_account_to_multiaccount_instance_seed_phrase(self):
|
||||||
|
sign_in_view = SignInView(self.driver)
|
||||||
|
sign_in_view.create_user()
|
||||||
|
wallet_view = sign_in_view.wallet_button.click()
|
||||||
|
wallet_view.set_up_wallet()
|
||||||
|
|
||||||
|
wallet_view.just_fyi('Add account from seed phrase')
|
||||||
|
wallet_view.add_account_button.click()
|
||||||
|
wallet_view.enter_a_seed_phrase_button.click()
|
||||||
|
wallet_view.enter_your_password_input.send_keys(common_password)
|
||||||
|
|
||||||
|
wallet_view.enter_seed_phrase_input.set_value('')
|
||||||
|
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
||||||
|
wallet_view.account_name_input.send_keys(account_name)
|
||||||
|
wallet_view.add_account_generate_account_button.click()
|
||||||
|
if wallet_view.get_account_options_by_name(account_name).is_element_displayed():
|
||||||
|
self.driver.fail('Account is added without seed phrase')
|
||||||
|
wallet_view.enter_seed_phrase_input.set_value(str(wallet_users['C']['passphrase']).upper())
|
||||||
|
wallet_view.add_account_generate_account_button.click()
|
||||||
|
|
||||||
|
account_button = wallet_view.get_account_by_name(account_name)
|
||||||
|
if not account_button.is_element_displayed():
|
||||||
|
self.driver.fail('Account was not added')
|
||||||
|
|
||||||
|
wallet_view.just_fyi('Check that overall balance is changed after adding account')
|
||||||
|
for asset in ('ETHro', 'ADI'):
|
||||||
|
wallet_view.wait_balance_is_changed(asset)
|
||||||
|
|
||||||
|
wallet_view.just_fyi('Check account view and send option')
|
||||||
|
wallet_view.get_account_by_name(account_name).click()
|
||||||
|
if not wallet_view.send_transaction_button.is_element_displayed():
|
||||||
|
self.errors.append('Send button is not shown on account added with seed phrase')
|
||||||
|
wallet_view.receive_transaction_button.click()
|
||||||
|
if wallet_view.address_text.text[2:] != wallet_users['C']['address']:
|
||||||
|
self.errors.append(
|
||||||
|
'Wrong address %s is shown in "Receive" popup ' % wallet_view.address_text.text)
|
||||||
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
|
@marks.testrail_id(6272)
|
||||||
|
@marks.high
|
||||||
|
def test_add_account_to_multiaccount_instance_private_key(self):
|
||||||
|
sign_in_view = SignInView(self.driver)
|
||||||
|
sign_in_view.create_user()
|
||||||
|
wallet_view = sign_in_view.wallet_button.click()
|
||||||
|
wallet_view.set_up_wallet()
|
||||||
|
|
||||||
|
wallet_view.just_fyi('Add account from private key')
|
||||||
|
wallet_view.add_account_button.click()
|
||||||
|
wallet_view.enter_a_private_key_button.click()
|
||||||
|
wallet_view.enter_your_password_input.send_keys(common_password)
|
||||||
|
|
||||||
|
wallet_view.enter_a_private_key_input.set_value(wallet_users['C']['private_key'][0:9])
|
||||||
|
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
||||||
|
wallet_view.account_name_input.send_keys(account_name)
|
||||||
|
wallet_view.add_account_generate_account_button.click()
|
||||||
|
if wallet_view.get_account_options_by_name(account_name).is_element_displayed():
|
||||||
|
self.driver.fail('Account is added with wrong private key')
|
||||||
|
wallet_view.enter_a_private_key_input.set_value(wallet_users['C']['private_key'])
|
||||||
|
wallet_view.add_account_generate_account_button.click()
|
||||||
|
|
||||||
|
account_button = wallet_view.get_account_by_name(account_name)
|
||||||
|
if not account_button.is_element_displayed():
|
||||||
|
self.driver.fail('Account was not added')
|
||||||
|
|
||||||
|
wallet_view.just_fyi('Check that overall balance is changed after adding account')
|
||||||
|
for asset in ('ETHro', 'ADI'):
|
||||||
|
wallet_view.wait_balance_is_changed(asset)
|
||||||
|
|
||||||
|
wallet_view.just_fyi('Check individual account view, receive option')
|
||||||
|
wallet_view.get_account_by_name(account_name).click()
|
||||||
|
if not wallet_view.send_transaction_button.is_element_displayed():
|
||||||
|
self.errors.append('Send button is not shown on account added with private key')
|
||||||
|
wallet_view.receive_transaction_button.click()
|
||||||
|
if wallet_view.address_text.text[2:] != wallet_users['C']['address']:
|
||||||
|
self.errors.append(
|
||||||
|
'Wrong address %s is shown in "Receive" popup account ' % wallet_view.address_text.text)
|
||||||
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
|
|
||||||
@marks.testrail_id(5406)
|
@marks.testrail_id(5406)
|
||||||
@marks.critical
|
@marks.critical
|
||||||
|
|
|
@ -44,9 +44,10 @@ wallet_users['B']['public_key'] = "0x04f3c372522a087bd6895a67b669601e6b6825b2ee7
|
||||||
wallet_users['C'] = dict()
|
wallet_users['C'] = dict()
|
||||||
wallet_users['C']['passphrase'] = "purchase ensure mistake crystal person similar shaft family shield clog risk market"
|
wallet_users['C']['passphrase'] = "purchase ensure mistake crystal person similar shaft family shield clog risk market"
|
||||||
wallet_users['C']['username'] = "Mellow Virtual Nubiangoat"
|
wallet_users['C']['username'] = "Mellow Virtual Nubiangoat"
|
||||||
wallet_users['C']['address'] = "8dce052ccda2f6f6b555759cee6957e04a6ddf5b"
|
wallet_users['C']['address'] = "8DcE052cCda2F6F6B555759cEe6957e04A6dDf5B"
|
||||||
wallet_users['C']['public_key'] = "0x040e562b69362e7e57492bca50b6095acfa636c48b85eef2bc0e4180b6e99fc5e73f45c3" \
|
wallet_users['C']['public_key'] = "0x040e562b69362e7e57492bca50b6095acfa636c48b85eef2bc0e4180b6e99fc5e73f45c3" \
|
||||||
"40837da01728d4585695fda7f1de2ed193a1dd4080291d90812e1cae77"
|
"40837da01728d4585695fda7f1de2ed193a1dd4080291d90812e1cae77"
|
||||||
|
wallet_users['C']['private_key'] = '7800C28310576645BBF6BF6355F7AA4CEC659B1713AF7E7713E1A33097A3DDF6'
|
||||||
|
|
||||||
wallet_users['D'] = dict()
|
wallet_users['D'] = dict()
|
||||||
wallet_users['D']['passphrase'] = "hen mango since lottery laundry flag report whisper cycle rate festival carry"
|
wallet_users['D']['passphrase'] = "hen mango since lottery laundry flag report whisper cycle rate festival carry"
|
||||||
|
|
|
@ -268,50 +268,59 @@ class AddAccountButton(BaseButton):
|
||||||
self.locator = self.Locator.text_selector('Add account')
|
self.locator = self.Locator.text_selector('Add account')
|
||||||
|
|
||||||
|
|
||||||
class AddAnAccountButton(BaseButton):
|
class GenerateAnAccountButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(AddAnAccountButton, self).__init__(driver)
|
super(GenerateAnAccountButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.text_selector('Add an account')
|
self.locator = self.Locator.accessibility_id('add-account-sheet-generate')
|
||||||
|
|
||||||
class AddAWatchOnlyAddressButton(BaseButton):
|
class AddAWatchOnlyAddressButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(AddAWatchOnlyAddressButton, self).__init__(driver)
|
super(AddAWatchOnlyAddressButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.text_selector('Add a watch-only address')
|
self.locator = self.Locator.accessibility_id('add-account-sheet-watch')
|
||||||
|
|
||||||
|
class EnterASeedPhraseButton(BaseButton):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(EnterASeedPhraseButton, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.accessibility_id('add-account-sheet-seed')
|
||||||
|
|
||||||
|
class EnterAPrivateKeyButton(BaseButton):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(EnterAPrivateKeyButton, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.accessibility_id('add-account-sheet-private-key')
|
||||||
|
|
||||||
class EnterAddressInput(BaseEditBox):
|
class EnterAddressInput(BaseEditBox):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(EnterAddressInput, self).__init__(driver)
|
super(EnterAddressInput, self).__init__(driver)
|
||||||
self.locator = self.Locator.text_selector('Enter address')
|
self.locator = self.Locator.accessibility_id('add-account-enter-watch-address')
|
||||||
|
|
||||||
|
class EnterSeedPhraseInput(BaseEditBox):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(EnterSeedPhraseInput, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.accessibility_id('add-account-enter-seed')
|
||||||
|
|
||||||
|
class EnterPrivateKeyInput(BaseEditBox):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(EnterPrivateKeyInput, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.accessibility_id('add-account-enter-private-key')
|
||||||
|
|
||||||
class DeleteAccountButton(BaseButton):
|
class DeleteAccountButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(DeleteAccountButton, self).__init__(driver)
|
super(DeleteAccountButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.text_selector('Delete account')
|
self.locator = self.Locator.text_selector('Delete account')
|
||||||
|
|
||||||
class GenerateNewAccountButton(BaseButton):
|
|
||||||
def __init__(self, driver):
|
|
||||||
super(GenerateNewAccountButton, self).__init__(driver)
|
|
||||||
self.locator = self.Locator.text_selector('Generate keys')
|
|
||||||
|
|
||||||
|
|
||||||
class EnterYourPasswordInput(BaseEditBox):
|
class EnterYourPasswordInput(BaseEditBox):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(EnterYourPasswordInput, self).__init__(driver)
|
super(EnterYourPasswordInput, self).__init__(driver)
|
||||||
self.locator = self.Locator.xpath_selector(
|
self.locator = self.Locator.accessibility_id('add-account-enter-password')
|
||||||
"//android.widget.TextView[@text='Enter your password']/following-sibling::android.widget.EditText")
|
|
||||||
|
|
||||||
|
|
||||||
class GenerateAccountButton(BaseButton):
|
|
||||||
def __init__(self, driver):
|
|
||||||
super(GenerateAccountButton, self).__init__(driver)
|
|
||||||
self.locator = self.Locator.text_selector('Generate keys')
|
|
||||||
|
|
||||||
|
|
||||||
class AccountNameInput(BaseEditBox):
|
class AccountNameInput(BaseEditBox):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(AccountNameInput, self).__init__(driver)
|
super(AccountNameInput, self).__init__(driver)
|
||||||
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Account name']"
|
self.locator = self.Locator.accessibility_id('add-account-enter-account-name')
|
||||||
"/following-sibling::android.view.ViewGroup/android.widget.EditText")
|
|
||||||
|
|
||||||
|
|
||||||
class AccountColorButton(BaseButton):
|
class AccountColorButton(BaseButton):
|
||||||
|
@ -325,11 +334,11 @@ class AccountColorButton(BaseButton):
|
||||||
self.driver.find_element_by_xpath(
|
self.driver.find_element_by_xpath(
|
||||||
"//*[@text='Cancel']/../preceding-sibling::android.widget.ScrollView/*/*[%s]" % position).click()
|
"//*[@text='Cancel']/../preceding-sibling::android.widget.ScrollView/*/*[%s]" % position).click()
|
||||||
|
|
||||||
|
# Add account on Generate An Account screen
|
||||||
class FinishButton(BaseButton):
|
class AddAccountGenerateAnAccountButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(FinishButton, self).__init__(driver)
|
super(AddAccountGenerateAnAccountButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.text_selector('Finish')
|
self.locator = self.Locator.accessibility_id('add-account-add-account-button')
|
||||||
|
|
||||||
class AccountSettingsButton(BaseButton):
|
class AccountSettingsButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
|
@ -380,16 +389,18 @@ class WalletView(BaseView):
|
||||||
self.view_in_cryptokitties_button = ViewInCryptoKittiesButton(self.driver)
|
self.view_in_cryptokitties_button = ViewInCryptoKittiesButton(self.driver)
|
||||||
self.set_currency_button = SetCurrencyButton(self.driver)
|
self.set_currency_button = SetCurrencyButton(self.driver)
|
||||||
self.add_account_button = AddAccountButton(self.driver)
|
self.add_account_button = AddAccountButton(self.driver)
|
||||||
self.add_an_account_button = AddAnAccountButton(self.driver)
|
self.generate_an_account_button = GenerateAnAccountButton(self.driver)
|
||||||
self.add_watch_only_address_button = AddAWatchOnlyAddressButton(self.driver)
|
self.add_watch_only_address_button = AddAWatchOnlyAddressButton(self.driver)
|
||||||
|
self.enter_a_seed_phrase_button = EnterASeedPhraseButton(self.driver)
|
||||||
|
self.enter_a_private_key_button = EnterAPrivateKeyButton(self.driver)
|
||||||
self.enter_address_input = EnterAddressInput(self.driver)
|
self.enter_address_input = EnterAddressInput(self.driver)
|
||||||
|
self.enter_seed_phrase_input = EnterSeedPhraseInput(self.driver)
|
||||||
|
self.enter_a_private_key_input = EnterPrivateKeyInput(self.driver)
|
||||||
self.delete_account_button = DeleteAccountButton(self.driver)
|
self.delete_account_button = DeleteAccountButton(self.driver)
|
||||||
self.generate_new_account_button = GenerateNewAccountButton(self.driver)
|
|
||||||
self.enter_your_password_input = EnterYourPasswordInput(self.driver)
|
self.enter_your_password_input = EnterYourPasswordInput(self.driver)
|
||||||
self.generate_account_button = GenerateAccountButton(self.driver)
|
|
||||||
self.account_name_input = AccountNameInput(self.driver)
|
self.account_name_input = AccountNameInput(self.driver)
|
||||||
self.account_color_button = AccountColorButton(self.driver)
|
self.account_color_button = AccountColorButton(self.driver)
|
||||||
self.finish_button = FinishButton(self.driver)
|
self.add_account_generate_account_button = AddAccountGenerateAnAccountButton(self.driver)
|
||||||
|
|
||||||
# individual account settings
|
# individual account settings
|
||||||
self.account_settings_button = AccountSettingsButton(self.driver)
|
self.account_settings_button = AccountSettingsButton(self.driver)
|
||||||
|
@ -561,10 +572,7 @@ class WalletView(BaseView):
|
||||||
|
|
||||||
def add_account(self, account_name: str, password: str = common_password):
|
def add_account(self, account_name: str, password: str = common_password):
|
||||||
self.add_account_button.click()
|
self.add_account_button.click()
|
||||||
self.add_an_account_button.click()
|
self.generate_an_account_button.click()
|
||||||
self.generate_new_account_button.click()
|
|
||||||
self.generate_account_button.click()
|
|
||||||
self.enter_your_password_input.send_keys(password)
|
self.enter_your_password_input.send_keys(password)
|
||||||
self.generate_account_button.click()
|
|
||||||
self.account_name_input.send_keys(account_name)
|
self.account_name_input.send_keys(account_name)
|
||||||
self.finish_button.click()
|
self.add_account_generate_account_button.click()
|
||||||
|
|
Loading…
Reference in New Issue