e2e fix after new onboarding

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-07-11 18:44:12 +03:00
parent a2da4dec63
commit d92eb8374f
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
9 changed files with 20 additions and 24 deletions

View File

@ -88,18 +88,21 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.medium @marks.medium
def test_create_account_short_and_mismatch_password(self): def test_create_account_short_and_mismatch_password(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in.create_account_button.click() sign_in.get_started_button.click()
sign_in.password_input.set_value('12345') sign_in.generate_key_button.click()
sign_in.next_button.click()
sign_in.next_button.click()
sign_in.create_password_input.set_value('12345')
mismatch_error = "Passwords don't match" mismatch_error = "Passwords don't match"
sign_in.next_button.click() sign_in.next_button.click()
if sign_in.confirm_password_input.is_element_displayed(): if sign_in.confirm_your_password_input.is_element_displayed():
self.errors.append('Next button is clickable when password is less then 6 symbols') self.errors.append('Next button is clickable when password is less then 6 symbols')
sign_in.password_input.set_value('123456') sign_in.create_password_input.set_value('123456')
sign_in.next_button.click() sign_in.next_button.click()
sign_in.confirm_password_input.set_value('1234567') sign_in.confirm_your_password_input.set_value('1234567')
sign_in.next_button.click() sign_in.next_button.click()
if not sign_in.find_text_part(mismatch_error): if not sign_in.find_text_part(mismatch_error):

View File

@ -279,12 +279,11 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
username_1 = 'user_%s' % get_current_time() username_1 = 'user_%s' % get_current_time()
message_before_block_1, message_before_block_2 = "Before block from %s" % device_1.driver.number, "Before block from %s" % device_2.driver.number message_before_block_1, message_before_block_2 = "Before block from %s" % device_1.driver.number, "Before block from %s" % device_2.driver.number
message_after_block_2 = "After block from %s" % device_2.driver.number message_after_block_2 = "After block from %s" % device_2.driver.number
home_1, home_2 = device_1.create_user(username=username_1), device_2.recover_access(basic_user['passphrase']) home_1, home_2 = device_1.create_user(), device_2.recover_access(basic_user['passphrase'])
profile_1 = home_1.profile_button.click() profile_1 = home_1.profile_button.click()
default_username_1 = profile_1.default_username_text.text default_username_1 = profile_1.default_username_text.text
home_1 = profile_1.get_back_to_home_view() home_1 = profile_1.get_back_to_home_view()
# device 1, device 2: join to public chat and send several messages # device 1, device 2: join to public chat and send several messages
chat_name = device_1.get_public_chat_name() chat_name = device_1.get_public_chat_name()
for home in home_1, home_2: for home in home_1, home_2:

View File

@ -380,7 +380,7 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
chat.asset_by_name('ETHro').click() chat.asset_by_name('ETHro').click()
chat.send_as_keyevent(amount) chat.send_as_keyevent(amount)
send_transaction_view = chat.get_send_transaction_view() send_transaction_view = chat.get_send_transaction_view()
chat.send_message_button.click_until_presence_of_element(send_transaction_view.sign_transaction_button) chat.send_message_button.click_until_presence_of_element(send_transaction_view.sign_with_password)
# if not send_transaction_view.element_by_text(recipient['username']).is_element_displayed(): # if not send_transaction_view.element_by_text(recipient['username']).is_element_displayed():
# self.errors.append('Recipient name is not shown') # self.errors.append('Recipient name is not shown')

View File

@ -118,7 +118,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
username_1 = 'user_%s' % get_current_time() username_1 = 'user_%s' % get_current_time()
device_1_home, device_2_home = device_1.create_user(username=username_1), device_2.create_user() device_1_home, device_2_home = device_1.create_user(), device_2.create_user()
profile_1 = device_1_home.profile_button.click() profile_1 = device_1_home.profile_button.click()
default_username_1 = profile_1.default_username_text.text default_username_1 = profile_1.default_username_text.text
device_1_home = profile_1.get_back_to_home_view() device_1_home = profile_1.get_back_to_home_view()

View File

@ -115,7 +115,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.sign_with_password.click() send_transaction.sign_with_password.click()
send_transaction.enter_password_input.click() send_transaction.enter_password_input.click()
send_transaction.enter_password_input.send_keys('wrong_password') send_transaction.enter_password_input.send_keys('wrong_password')
send_transaction.sign_transaction_button.click() send_transaction.sign_button.click()
send_transaction.find_full_text('Wrong password', 20) send_transaction.find_full_text('Wrong password', 20)
@marks.testrail_id(1452) @marks.testrail_id(1452)
@ -384,7 +384,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
ropsten_txs = self.network_api.get_transactions(address) ropsten_txs = self.network_api.get_transactions(address)
ropsten_tokens = self.network_api.get_token_transactions(address) ropsten_tokens = self.network_api.get_token_transactions(address)
expected_txs_list = get_merged_txs_list(ropsten_txs, ropsten_tokens) expected_txs_list = get_merged_txs_list(ropsten_txs, ropsten_tokens)
signin_view = SignInView(self.driver) signin_view = SignInView(self.driver)
home_view = signin_view.recover_access(passphrase=passphrase) home_view = signin_view.recover_access(passphrase=passphrase)
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()

View File

@ -324,9 +324,8 @@ class BaseView(object):
def accept_agreements(self): def accept_agreements(self):
iterations = int() iterations = int()
from views.sign_in_view import CreateAccountButton, PasswordInput while iterations <= 2 and (self.ok_button.is_element_displayed(2) or
while iterations <= 3 and not (CreateAccountButton(self.driver).is_element_displayed(2) or PasswordInput( self.continue_button.is_element_displayed(2)):
self.driver).is_element_displayed(2)):
for button in self.ok_button, self.continue_button: for button in self.ok_button, self.continue_button:
try: try:
button.wait_for_element(3) button.wait_for_element(3)

View File

@ -78,21 +78,18 @@ class ChatMenuButton(BaseButton):
class MembersButton(BaseButton): class MembersButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(MembersButton, self).__init__(driver) super(MembersButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="action"])[1]') self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="action"])[1]')
class DeleteChatButton(BaseButton): class DeleteChatButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(DeleteChatButton, self).__init__(driver) super(DeleteChatButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="Delete chat"]') self.locator = self.Locator.xpath_selector('//*[@text="Delete chat"]')
class ClearHistoryButton(BaseButton): class ClearHistoryButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ClearHistoryButton, self).__init__(driver) super(ClearHistoryButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="Clear history"]') self.locator = self.Locator.xpath_selector('//*[@text="Clear history"]')
@ -109,27 +106,24 @@ class GroupInfoButton(BaseButton):
class LeaveChatButton(BaseButton): class LeaveChatButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(LeaveChatButton, self).__init__(driver) super(LeaveChatButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="Leave public chat"]') self.locator = self.Locator.xpath_selector('//*[@text="Leave public chat"]')
class ClearButton(BaseButton): class ClearButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ClearButton, self).__init__(driver) super(ClearButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="CLEAR"]') self.locator = self.Locator.xpath_selector('//*[@text="CLEAR"]')
class BlockButton(BaseButton):
class BlockButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(BlockButton, self).__init__(driver) super(BlockButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="BLOCK"]') self.locator = self.Locator.xpath_selector('//*[@text="BLOCK"]')
class LeaveButton(BaseButton): class LeaveButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(LeaveButton, self).__init__(driver) super(LeaveButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="LEAVE"]') self.locator = self.Locator.xpath_selector('//*[@text="LEAVE"]')
@ -223,11 +217,13 @@ class ProfileSendTransactionButton(BaseButton):
super(ProfileSendTransactionButton, self).__init__(driver) super(ProfileSendTransactionButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('send-transaction-button') self.locator = self.Locator.accessibility_id('send-transaction-button')
class ProfileBlockContactButton(BaseButton): class ProfileBlockContactButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ProfileBlockContactButton, self).__init__(driver) super(ProfileBlockContactButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('block-contact') self.locator = self.Locator.accessibility_id('block-contact')
class JoinChatButton(BaseButton): class JoinChatButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(JoinChatButton, self).__init__(driver) super(JoinChatButton, self).__init__(driver)
@ -276,7 +272,7 @@ class ChatElementByText(BaseText):
"@text='Not sent. Tap for options' or @text='Network mismatch']" "@text='Not sent. Tap for options' or @text='Network mismatch']"
self.locator = self.Locator.xpath_selector(parent_locator + text) self.locator = self.Locator.xpath_selector(parent_locator + text)
return StatusText(self.driver, self.locator.value) return StatusText(self.driver, self.locator.value).wait_for_element(10)
@property @property
def progress_bar(self): def progress_bar(self):

View File

@ -195,7 +195,7 @@ class HomeView(BaseView):
return ChatView(self.driver) return ChatView(self.driver)
def join_public_chat(self, chat_name: str): def join_public_chat(self, chat_name: str):
self.plus_button.click() self.plus_button.click_until_presence_of_element(self.join_public_chat_button)
self.join_public_chat_button.wait_for_visibility_of_element(5) self.join_public_chat_button.wait_for_visibility_of_element(5)
contacts_view = self.join_public_chat_button.click() contacts_view = self.join_public_chat_button.click()
contacts_view.chat_name_editbox.click() contacts_view.chat_name_editbox.click()

View File

@ -125,7 +125,7 @@ class OtherAccountsButton(BaseButton):
class PrivacyPolicyLink(BaseButton): class PrivacyPolicyLink(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(PrivacyPolicyLink, self).__init__(driver) super(PrivacyPolicyLink, self).__init__(driver)
self.locator = self.Locator.text_part_selector('Privacy Policy') self.locator = self.Locator.text_part_selector('privacy policy')
def navigate(self): def navigate(self):
from views.web_views.base_web_view import BaseWebView from views.web_views.base_web_view import BaseWebView