Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2019-08-02 11:28:59 +02:00
parent f633e168ad
commit 7f05c09632
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
4 changed files with 67 additions and 2 deletions

View File

@ -3,8 +3,9 @@ import pytest
from tests import marks, bootnode_address, mailserver_address, camera_access_error_text, \
photos_access_error_text
from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase
from tests.users import transaction_senders, basic_user
from tests.users import transaction_senders, basic_user, ens_user
from views.sign_in_view import SignInView
from views.dapps_view import DappsView
@marks.all
@ -104,6 +105,38 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
self.errors.append('Wallet address was not copied')
self.verify_no_errors()
@marks.testrail_id(5502)
@marks.critical
def test_can_add_existing_ens(self):
sign_in = SignInView(self.driver)
home = sign_in.recover_access(ens_user['passphrase'])
profile = home.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
home.profile_button.click()
profile.element_by_text('ENS usernames').click()
dapp_view = DappsView(self.driver)
# check if your name can be added via "ENS usernames" dapp in Profile
dapp_view.element_by_text('Get started').click()
dapp_view.ens_name.set_value(ens_user['ens'])
if not dapp_view.element_by_text_part('is owned by you').is_element_displayed():
self.errors.append('Owned username is not shown in ENS Dapp.')
dapp_view.check_ens_name.click()
dapp_view.check_ens_name.click()
if not dapp_view.element_by_text_part('Username added').is_element_displayed():
self.errors.append('No message "Username added" after resolving own username')
dapp_view.element_by_text('Ok, got it').click()
# check that after adding username is shown in "ENS usernames" and profile
if not dapp_view.element_by_text(ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own "ENS usernames" after adding')
dapp_view.back_button.click()
if not dapp_view.element_by_text('@%s' % ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own profile after adding')
if not dapp_view.element_by_text('%s.stateofus.eth' % ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own profile after adding')
self.verify_no_errors()
@marks.testrail_id(5475)
@marks.low
def test_change_profile_picture_several_times(self):

View File

@ -9,7 +9,7 @@ from selenium.common.exceptions import TimeoutException
from tests import marks, get_current_time
from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase
from tests.users import transaction_senders, transaction_recipients, basic_user
from tests.users import transaction_senders, transaction_recipients, basic_user, ens_user
from views.sign_in_view import SignInView
@ -716,3 +716,15 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat.swipe_left()
chat.sticker_icon.click()
chat.chat_item.is_element_displayed()
@marks.testrail_id(5403)
@marks.critical
def test_start_chat_with_ens(self):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
profile = home.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
chat = home.add_contact(ens_user['ens'])
if not chat.element_by_text(ens_user['username']).is_element_displayed():
self.driver.fail('Wrong user is resolved from username when starting 1-1 chat.')

View File

@ -6,6 +6,13 @@ basic_user['public_key'] = "0x040d3400f0ba80b2f6017a9021a66e042abc33cf7051ddf98a
basic_user['address'] = "f184747445c3B85CEb147DfB136067CB93d95F1D"
basic_user['special_chars_password'] = " !\"#$Á%Ö&'()*+Í, -./:ä;<=>?@[\\]^_`{|}~ "
ens_user = dict()
ens_user['passphrase'] = "husband rough hotel obey annual you member reopen struggle air evoke taxi"
ens_user['username'] = "Wan Sharp Bettong"
ens_user['public_key'] = "0x042d693dc861dbd1da8542c9614dbea58a488dc3da822759a539279cdf9234de987342ca17009dcc97fbabf" \
"00a606b770d92c3932e484a2b868eef2915982a24c6"
ens_user['ens'] = 'autotester'
wallet_users = dict()
wallet_users['A'] = dict()

View File

@ -30,6 +30,15 @@ class BrowserEntry(ChatElement):
super(BrowserEntry, self).__init__(driver, name)
self.locator = self.Locator.xpath_selector('//*[@text="%s"]/..' % name)
class EnsName(BaseEditBox):
def __init__(self, driver):
super(EnsName, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//android.widget.EditText')
class EnsCheckName(BaseButton):
def __init__(self, driver):
super(EnsCheckName, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//android.widget.EditText//following-sibling::android.view.ViewGroup[1]')
class DappsView(BaseView):
@ -40,6 +49,10 @@ class DappsView(BaseView):
self.open_button = OpenButton(self.driver)
self.enter_url_editbox = EnterUrlEditbox(self.driver)
#ens dapp
self.ens_name = EnsName(self.driver)
self.check_ens_name = EnsCheckName(self.driver)
def open_url(self, url):
self.enter_url_editbox.click()
self.enter_url_editbox.send_keys(url)