E2e nightly fixes

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-07-15 18:53:56 +03:00
parent 90fbcfab2b
commit 840fbfd2d7
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
11 changed files with 31 additions and 46 deletions

View File

@ -57,18 +57,7 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.high @marks.high
def test_home_view(self): def test_home_view(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in.accept_agreements() welcome_screen = sign_in.create_user()
sign_in.create_account_button.click()
sign_in.password_input.set_value(common_password)
sign_in.next_button.click()
sign_in.confirm_password_input.set_value(common_password)
sign_in.next_button.click()
sign_in.element_by_text_part('Display name').wait_for_element(30)
sign_in.name_input.send_keys('user_%s' % get_current_time())
sign_in.next_button.click()
welcome_screen = sign_in.get_home_view()
if not welcome_screen.welcome_image.is_element_displayed(): if not welcome_screen.welcome_image.is_element_displayed():
self.errors.append('Welcome image is not shown') self.errors.append('Welcome image is not shown')

View File

@ -71,7 +71,7 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
@marks.high @marks.high
def test_pass_phrase_validation(self): def test_pass_phrase_validation(self):
signin_view = SignInView(self.driver) signin_view = SignInView(self.driver)
recover_access_view = signin_view.i_have_account_button.click() recover_access_view = signin_view.access_key_button.click()
phrase_outside_the_mnemonic = 'one two three four five six seven eight nine ten eleven twelve' phrase_outside_the_mnemonic = 'one two three four five six seven eight nine ten eleven twelve'
validations = [ validations = [
{ {
@ -105,8 +105,8 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
for validation in validations: for validation in validations:
phrase, elm, msg = validation.get('phrase'), validation.get('element to check'), validation.get( phrase, elm, msg = validation.get('phrase'), validation.get('element to check'), validation.get(
'validation message') 'validation message')
if signin_view.i_have_account_button.is_element_displayed(): if signin_view.access_key_button.is_element_displayed():
signin_view.i_have_account_button.click() signin_view.access_key_button.click()
recover_access_view.send_as_keyevent(phrase) recover_access_view.send_as_keyevent(phrase)
recover_access_view.password_input.click() recover_access_view.password_input.click()
@ -114,9 +114,9 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
self.errors.append('"{}" message is not shown'.format(msg)) self.errors.append('"{}" message is not shown'.format(msg))
recover_access_view.click_system_back_button() recover_access_view.click_system_back_button()
signin_view.i_have_account_button.click() signin_view.access_key_button.click()
recover_access_view.send_as_keyevent(phrase_outside_the_mnemonic) recover_access_view.send_as_keyevent(phrase_outside_the_mnemonic)
recover_access_view.password_input.click() recover_access_view.recover_account_password_input.click()
recover_access_view.send_as_keyevent('123456') recover_access_view.send_as_keyevent('123456')
recover_access_view.sign_in_button.click() recover_access_view.sign_in_button.click()
recover_access_view.cancel_button.click() recover_access_view.cancel_button.click()
@ -125,9 +125,9 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
self.errors.append('Something went wrong. Probably, the confirmation pop up did not disappear') self.errors.append('Something went wrong. Probably, the confirmation pop up did not disappear')
recover_access_view.click_system_back_button() recover_access_view.click_system_back_button()
signin_view.i_have_account_button.click() signin_view.access_key_button.click()
recover_access_view.send_as_keyevent(phrase_outside_the_mnemonic) recover_access_view.send_as_keyevent(phrase_outside_the_mnemonic)
recover_access_view.password_input.click() recover_access_view.recover_account_password_input.click()
recover_access_view.send_as_keyevent('123456') recover_access_view.send_as_keyevent('123456')
recover_access_view.sign_in_button.click() recover_access_view.sign_in_button.click()
home_view = recover_access_view.confirm_phrase_button.click() home_view = recover_access_view.confirm_phrase_button.click()
@ -154,7 +154,7 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
passphrase = transaction_senders['A']['passphrase'] passphrase = transaction_senders['A']['passphrase']
capitalized_passphrase = passphrase.upper() capitalized_passphrase = passphrase.upper()
signin_view = SignInView(self.driver) signin_view = SignInView(self.driver)
recover_access_view = signin_view.i_have_account_button.click() recover_access_view = signin_view.access_key_button.click()
recover_access_view.passphrase_input.click() recover_access_view.passphrase_input.click()
recover_access_view.send_as_keyevent(capitalized_passphrase) recover_access_view.send_as_keyevent(capitalized_passphrase)
if recover_access_view.passphrase_input.text != passphrase: if recover_access_view.passphrase_input.text != passphrase:

View File

@ -37,7 +37,7 @@ class TestSignIn(SingleDeviceTestCase):
sign_in.ok_button.click() sign_in.ok_button.click()
sign_in.password_input.set_value(common_password + '1') sign_in.password_input.set_value(common_password + '1')
sign_in.sign_in_button.click() sign_in.sign_in_button.click()
sign_in.find_full_text('Wrong password') sign_in.find_full_text("Wrong password")
@marks.logcat @marks.logcat
@marks.testrail_id(5415) @marks.testrail_id(5415)

View File

@ -20,10 +20,8 @@ def return_made_admin_system_message(username):
return "*%s* has been made admin" % username return "*%s* has been made admin" % username
def create_users(driver_1, driver_2, username_1=None, username_2=None): def create_users(driver_1, driver_2):
device_1_sign_in, device_2_sign_in = SignInView(driver_1), SignInView(driver_2) device_1_sign_in, device_2_sign_in = SignInView(driver_1), SignInView(driver_2)
if username_1 is not None and username_2 is not None:
return device_1_sign_in.create_user(username_1), device_2_sign_in.create_user(username_1)
return device_1_sign_in.create_user(), device_2_sign_in.create_user() return device_1_sign_in.create_user(), device_2_sign_in.create_user()
@ -102,13 +100,12 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(5674) @marks.testrail_id(5674)
@marks.high @marks.high
def test_group_chat_system_messages(self): def test_group_chat_system_messages(self):
username_1 = 'user1_%s' % get_current_time()
username_2 = 'user2_%s' % get_current_time()
self.create_drivers(2) self.create_drivers(2)
device_1_home, device_2_home = create_users(self.drivers[0], self.drivers[1], username_1, username_2) device_1_home, device_2_home = create_users(self.drivers[0], self.drivers[1])
chat_name = device_1_home.get_public_chat_name() chat_name = device_1_home.get_public_chat_name()
device_1_default_username = get_username(device_1_home)
device_2_default_username = get_username(device_2_home) device_2_default_username = get_username(device_2_home)
device_1_chat, device_2_chat = create_and_join_group_chat(device_1_home, device_2_home, chat_name) device_1_chat, device_2_chat = create_and_join_group_chat(device_1_home, device_2_home, chat_name)
@ -119,7 +116,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
# device 1: check system messages in the group chat # device 1: check system messages in the group chat
system_messages = [ system_messages = [
return_created_chat_system_message(username_1, chat_name), return_created_chat_system_message(device_1_default_username, chat_name),
return_joined_chat_system_message(device_2_default_username), return_joined_chat_system_message(device_2_default_username),
return_left_chat_system_message(device_2_default_username) return_left_chat_system_message(device_2_default_username)
] ]
@ -164,7 +161,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
self.create_drivers(2) self.create_drivers(2)
# create accounts on each device # create accounts on each device
device_1_home, device_2_home = create_users(self.drivers[0], self.drivers[1], username_1, username_2) device_1_home, device_2_home = create_users(self.drivers[0], self.drivers[1])
chat_name = device_1_home.get_public_chat_name() chat_name = device_1_home.get_public_chat_name()
# device 2: get public key and default username # device 2: get public key and default username

View File

@ -592,7 +592,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
sigin_view = SignInView(self.driver) sigin_view = SignInView(self.driver)
home_view = sigin_view.recover_access(sender_passphrase) home_view = sigin_view.recover_access(sender_passphrase)
wallet = home_view.wallet_button.click() wallet = home_view.wallet_button.click()
# wallet.set_up_wallet() wallet.set_up_wallet()
wallet.get_back_to_home_view() wallet.get_back_to_home_view()

View File

@ -50,12 +50,7 @@ class TestDApps(SingleDeviceTestCase):
status_test_dapp.wait_for_d_aap_to_load() status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.assets_button.click() status_test_dapp.assets_button.click()
send_transaction_view = status_test_dapp.request_stt_button.click() send_transaction_view = status_test_dapp.request_stt_button.click()
wallet_view = send_transaction_view.get_wallet_view() send_transaction_view.ok_got_it_button.click()
wallet_view.done_button.click()
wallet_view.yes_button.click()
send_transaction_view.advanced_button.click()
send_transaction_view.transaction_fee_button.click()
send_transaction_view.done_button.click()
send_transaction_view.sign_transaction() send_transaction_view.sign_transaction()
if not status_test_dapp.assets_button.is_element_displayed(): if not status_test_dapp.assets_button.is_element_displayed():
self.driver.fail('Oops! Cannot proceed to use Status Test Dapp.') self.driver.fail('Oops! Cannot proceed to use Status Test Dapp.')

View File

@ -192,7 +192,6 @@ class TestTransactionDApp(SingleDeviceTestCase):
@marks.testrail_id(5380) @marks.testrail_id(5380)
@marks.high @marks.high
@marks.skip # No onboarding for now. TO re-enable once wallet onboarding done
def test_user_can_complete_tx_to_dapp_when_onboarding_via_dapp_completed(self): def test_user_can_complete_tx_to_dapp_when_onboarding_via_dapp_completed(self):
user = transaction_recipients['G'] user = transaction_recipients['G']
signin_view = SignInView(self.driver) signin_view = SignInView(self.driver)

View File

@ -21,6 +21,7 @@ class TestPerformance(SingleDeviceTestCase):
@marks.testrail_id(6216) @marks.testrail_id(6216)
@marks.high @marks.high
@marks.performance @marks.performance
@marks.skip
def test_time_to_load_sign_in_screen(self): def test_time_to_load_sign_in_screen(self):
app_started = ':init/app-started' app_started = ':init/app-started'

View File

@ -280,6 +280,16 @@ class OpenInStatusButton(BaseButton):
self.wait_for_element().click() self.wait_for_element().click()
class OkGotItButton(BaseButton):
def __init__(self,driver):
super(OkGotItButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='OK, got it']")
def click(self):
self.wait_for_element().click()
self.wait_for_invisibility_of_element()
class BaseView(object): class BaseView(object):
def __init__(self, driver): def __init__(self, driver):
self.driver = driver self.driver = driver
@ -308,6 +318,7 @@ class BaseView(object):
self.cross_icon = CrossIcon(self.driver) self.cross_icon = CrossIcon(self.driver)
self.show_roots_button = ShowRoots(self.driver) self.show_roots_button = ShowRoots(self.driver)
self.get_started_button = GetStartedButton(self.driver) self.get_started_button = GetStartedButton(self.driver)
self.ok_got_it_button = OkGotItButton(self.driver)
# external browser # external browser
self.open_in_status_button = OpenInStatusButton(self.driver) self.open_in_status_button = OpenInStatusButton(self.driver)

View File

@ -224,8 +224,7 @@ class SendTransactionView(BaseView):
if self.onboarding_message.is_element_displayed(): if self.onboarding_message.is_element_displayed():
from views.wallet_view import WalletView from views.wallet_view import WalletView
wallet_view = WalletView(self.driver) wallet_view = WalletView(self.driver)
wallet_view.done_button.click() wallet_view.ok_got_it_button.click()
self.yes_button.click()
def sign_transaction(self, sender_password: str = common_password): def sign_transaction(self, sender_password: str = common_password):
self.sign_with_password.click() self.sign_with_password.click()

View File

@ -1,6 +1,7 @@
import time import time
from views.base_view import BaseView from views.base_view import BaseView
from views.base_element import BaseButton, BaseText from views.base_element import BaseButton, BaseText
from selenium.common.exceptions import NoSuchElementException
class SendRequestButton(BaseButton): class SendRequestButton(BaseButton):
@ -191,12 +192,6 @@ class AccountsStatusAccount(BaseButton):
self.locator = self.Locator.xpath_selector("//android.widget.HorizontalScrollView//*[@text='Status account']") self.locator = self.Locator.xpath_selector("//android.widget.HorizontalScrollView//*[@text='Status account']")
class OkGotItButton(BaseButton):
def __init__(self,driver):
super(OkGotItButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='OK, got it']")
class SendTransactionButton(BaseButton): class SendTransactionButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
@ -254,7 +249,6 @@ class WalletView(BaseView):
self.accounts_status_account = AccountsStatusAccount(self.driver) self.accounts_status_account = AccountsStatusAccount(self.driver)
self.collectibles_button = CollectiblesButton(self.driver) self.collectibles_button = CollectiblesButton(self.driver)
self.set_currency_button = SetCurrencyButton(self.driver) self.set_currency_button = SetCurrencyButton(self.driver)
self.ok_got_it_button = OkGotItButton(self.driver)
def get_usd_total_value(self): def get_usd_total_value(self):
import re import re