e2e: removed deprecated metods usage

This commit is contained in:
Yevheniia Berdnyk 2023-09-06 06:07:12 +03:00
parent 726b76a290
commit 69aeffd943
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
26 changed files with 160 additions and 159 deletions

View File

@ -95,7 +95,7 @@ class AppiumContainer:
# Wi-Fi stats # Wi-Fi stats
wifi_stats = self.exec_run(['adb', 'shell', 'dumpsys', 'batterystats', 'im.status.ethereum', '|', 'grep', wifi_stats = self.exec_run(['adb', 'shell', 'dumpsys', 'batterystats', 'im.status.ethereum', '|', 'grep',
'Wi-Fi\ total']).output.decode('utf-8') 'Wi-Fi total']).output.decode('utf-8')
stats.wifi_received = wifi_stats.split()[3].replace(',', '') stats.wifi_received = wifi_stats.split()[3].replace(',', '')
stats.wifi_sent = wifi_stats.split()[5] stats.wifi_sent = wifi_stats.split()[5]

View File

@ -12,14 +12,14 @@ from support.appium_container import AppiumContainer
from support.test_data import TestSuiteData from support.test_data import TestSuiteData
async def start_threads(test_name: str, quantity: int, func: type, returns: dict, *args): async def start_threads(test_name: str, quantity: int, func: type, returns: dict, **kwargs):
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
# from tests.conftest import sauce # from tests.conftest import sauce
# for _ in range(60): # for _ in range(60):
# if 16 - len([job for job in sauce.jobs.get_user_jobs() if job['status'] == 'in progress']) < quantity: # if 16 - len([job for job in sauce.jobs.get_user_jobs() if job['status'] == 'in progress']) < quantity:
# time.sleep(10) # time.sleep(10)
for i in range(quantity): for i in range(quantity):
returns[i] = loop.run_in_executor(None, func, *args) returns[i] = loop.run_in_executor(None, functools.partial(func, **kwargs))
for k in returns: for k in returns:
for _ in range(3): for _ in range(3):
try: try:

View File

@ -10,6 +10,7 @@ from http.client import RemoteDisconnected
import pytest import pytest
import requests import requests
from appium import webdriver from appium import webdriver
from appium.options.common import AppiumOptions
from appium.webdriver.common.mobileby import MobileBy from appium.webdriver.common.mobileby import MobileBy
from sauceclient import SauceException from sauceclient import SauceException
from selenium.common.exceptions import NoSuchElementException, TimeoutException, WebDriverException from selenium.common.exceptions import NoSuchElementException, TimeoutException, WebDriverException
@ -26,6 +27,8 @@ executor_local = 'http://localhost:4723/wd/hub'
implicit_wait = 5 implicit_wait = 5
app_package = 'im.status.ethereum'
def get_capabilities_local(): def get_capabilities_local():
desired_caps = dict() desired_caps = dict()
@ -88,13 +91,16 @@ def get_capabilities_sauce_lab():
caps['sauce:options']['maxDuration'] = 3600 caps['sauce:options']['maxDuration'] = 3600
caps['sauce:options']['idleTimeout'] = 1000 caps['sauce:options']['idleTimeout'] = 1000
return caps options = AppiumOptions()
options.load_capabilities(caps)
return options
def update_capabilities_sauce_lab(new_capabilities: dict): # def update_capabilities_sauce_lab(new_capabilities: dict):
caps = get_capabilities_sauce_lab().copy() # caps = get_capabilities_sauce_lab().copy()
caps.update(new_capabilities) # caps.update(new_capabilities)
return caps # return caps
def get_app_path(): def get_app_path():
@ -256,12 +262,11 @@ class SauceMultipleDeviceTestCase(AbstractTestCase):
self.errors = Errors() self.errors = Errors()
def create_drivers(self, quantity=2, max_duration=1800, custom_implicitly_wait=None): def create_drivers(self, quantity=2, max_duration=1800, custom_implicitly_wait=None):
capabilities = {'maxDuration': max_duration}
self.drivers = self.loop.run_until_complete(start_threads(quantity, self.drivers = self.loop.run_until_complete(start_threads(quantity,
Driver, Driver,
self.drivers, self.drivers,
executor_sauce_lab, executor_sauce_lab,
update_capabilities_sauce_lab(capabilities))) get_capabilities_sauce_lab()))
for driver in range(quantity): for driver in range(quantity):
test_suite_data.current_test.testruns[-1].jobs[self.drivers[driver].session_id] = driver + 1 test_suite_data.current_test.testruns[-1].jobs[self.drivers[driver].session_id] = driver + 1
self.drivers[driver].implicitly_wait( self.drivers[driver].implicitly_wait(
@ -301,15 +306,14 @@ def create_shared_drivers(quantity):
else: else:
loop = asyncio.new_event_loop() loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop) asyncio.set_event_loop(loop)
capabilities = {'maxDuration': 3600}
print('SC Executor: %s' % executor_sauce_lab) print('SC Executor: %s' % executor_sauce_lab)
try: try:
drivers = loop.run_until_complete(start_threads(test_suite_data.current_test.name, drivers = loop.run_until_complete(start_threads(test_suite_data.current_test.name,
quantity, quantity,
Driver, Driver,
drivers, drivers,
executor_sauce_lab, command_executor=executor_sauce_lab,
update_capabilities_sauce_lab(capabilities))) options=get_capabilities_sauce_lab()))
for i in range(quantity): for i in range(quantity):
test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1 test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
drivers[i].implicitly_wait(implicit_wait) drivers[i].implicitly_wait(implicit_wait)

View File

@ -276,7 +276,7 @@ def should_save_device_stats(config):
return all(db_args) return all(db_args)
@pytest.mark.hookwrapper @pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call): def pytest_runtest_makereport(item, call):
outcome = yield outcome = yield
report = outcome.get_result() report = outcome.get_result()

View File

@ -7,7 +7,7 @@ from _pytest.outcomes import Failed
from selenium.common.exceptions import TimeoutException, NoSuchElementException from selenium.common.exceptions import TimeoutException, NoSuchElementException
from tests import marks, common_password, run_in_parallel, transl from tests import marks, common_password, run_in_parallel, transl
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers, app_package
from tests.users import transaction_senders, basic_user, ens_user, ens_user_message_sender from tests.users import transaction_senders, basic_user, ens_user, ens_user_message_sender
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -43,7 +43,7 @@ class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
send_transaction.get_username_in_transaction_bottom_sheet_button(self.recipient_username).click() send_transaction.get_username_in_transaction_bottom_sheet_button(self.recipient_username).click()
if send_transaction.scan_qr_code_button.is_element_displayed(): if send_transaction.scan_qr_code_button.is_element_displayed():
self.drivers[0].fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat') self.drivers[0].fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat')
send_transaction.amount_edit_box.set_value(amount) send_transaction.amount_edit_box.send_keys(amount)
send_transaction.confirm() send_transaction.confirm()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
sender_message = self.chat_1.get_outgoing_transaction(self.account_name_1) sender_message = self.chat_1.get_outgoing_transaction(self.account_name_1)
@ -118,7 +118,7 @@ class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.chat_1.commands_button.click() self.chat_1.commands_button.click()
send_transaction = self.chat_1.send_command.click() send_transaction = self.chat_1.send_command.click()
amount = self.chat_1.get_unique_amount() amount = self.chat_1.get_unique_amount()
send_transaction.amount_edit_box.set_value(amount) send_transaction.amount_edit_box.send_keys(amount)
send_transaction.confirm() send_transaction.confirm()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
chat_1_sender_message = self.chat_1.get_outgoing_transaction() chat_1_sender_message = self.chat_1.get_outgoing_transaction()
@ -138,7 +138,7 @@ class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
request_amount = self.chat_1.get_unique_amount() request_amount = self.chat_1.get_unique_amount()
self.chat_1.commands_button.click() self.chat_1.commands_button.click()
request_transaction = self.chat_1.request_command.click() request_transaction = self.chat_1.request_command.click()
request_transaction.amount_edit_box.set_value(request_amount) request_transaction.amount_edit_box.send_keys(request_amount)
request_transaction.confirm() request_transaction.confirm()
request_transaction.request_transaction_button.click() request_transaction.request_transaction_button.click()
chat_1_request_message = self.chat_1.get_incoming_transaction() chat_1_request_message = self.chat_1.get_incoming_transaction()
@ -162,13 +162,13 @@ class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.wallet_2.home_button.click() self.wallet_2.home_button.click()
self.home_1.wallet_button.double_click() self.home_1.wallet_button.double_click()
initial_amount_stt = self.wallet_1.get_asset_amount_by_name('STT') initial_amount_stt = self.wallet_1.get_asset_amount_by_name('STT')
self.home_1.driver.close_app() self.home_1.driver.terminate_app(app_package)
self.home_2.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % amount) self.home_2.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % amount)
chat_2 = self.home_2.get_chat(username=self.sender['username']).click() chat_2 = self.home_2.get_chat(username=self.sender['username']).click()
chat_2.commands_button.click() chat_2.commands_button.click()
request_transaction = chat_2.request_command.click() request_transaction = chat_2.request_command.click()
request_transaction.amount_edit_box.set_value(amount) request_transaction.amount_edit_box.send_keys(amount)
request_transaction.confirm() request_transaction.confirm()
asset_button = request_transaction.asset_by_name(asset_name) asset_button = request_transaction.asset_by_name(asset_name)
request_transaction.select_asset_button.click_until_presence_of_element(asset_button) request_transaction.select_asset_button.click_until_presence_of_element(asset_button)
@ -179,7 +179,7 @@ class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.drivers[1].fail('No incoming transaction in 1-1 chat is shown for recipient after requesting STT') self.drivers[1].fail('No incoming transaction in 1-1 chat is shown for recipient after requesting STT')
self.home_1.just_fyi('Check that transaction message is fetched from offline and sign transaction') self.home_1.just_fyi('Check that transaction message is fetched from offline and sign transaction')
self.device_1.driver.launch_app() self.device_1.driver.activate_app(app_package)
self.device_1.sign_in() self.device_1.sign_in()
self.home_1.connection_offline_icon.wait_for_invisibility_of_element(30) self.home_1.connection_offline_icon.wait_for_invisibility_of_element(30)
self.home_1.get_chat(self.recipient_username).click() self.home_1.get_chat(self.recipient_username).click()
@ -325,7 +325,7 @@ class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTe
send_transaction.get_username_in_transaction_bottom_sheet_button(self.default_username_2).click() send_transaction.get_username_in_transaction_bottom_sheet_button(self.default_username_2).click()
if send_transaction.scan_qr_code_button.is_element_displayed(): if send_transaction.scan_qr_code_button.is_element_displayed():
self.chat_1.driver.fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat') self.chat_1.driver.fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat')
send_transaction.amount_edit_box.set_value(amount) send_transaction.amount_edit_box.send_keys(amount)
send_transaction.confirm() send_transaction.confirm()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
sender_message = self.chat_1.get_outgoing_transaction() sender_message = self.chat_1.get_outgoing_transaction()
@ -542,11 +542,11 @@ class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTe
self.device_2.manage_keys_and_storage_button.click() self.device_2.manage_keys_and_storage_button.click()
self.device_2.move_keystore_file_option.click() self.device_2.move_keystore_file_option.click()
self.device_2.enter_seed_phrase_next_button.click() self.device_2.enter_seed_phrase_next_button.click()
self.device_2.seedphrase_input.set_value(self.recovery_phrase) self.device_2.seedphrase_input.send_keys(self.recovery_phrase)
self.device_2.choose_storage_button.click() self.device_2.choose_storage_button.click()
self.device_2.keycard_required_option.click() self.device_2.keycard_required_option.click()
self.device_2.confirm_button.click() self.device_2.confirm_button.click()
self.device_2.migration_password_input.set_value(common_password) self.device_2.migration_password_input.send_keys(common_password)
self.device_2.confirm_button.click() self.device_2.confirm_button.click()
from views.keycard_view import KeycardView from views.keycard_view import KeycardView
keycard = KeycardView(self.device_2.driver) keycard = KeycardView(self.device_2.driver)
@ -628,7 +628,7 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.chat_1.just_fyi("Check sending assets to ENS name from sender side") self.chat_1.just_fyi("Check sending assets to ENS name from sender side")
send_message = self.chat_1.send_command.click() send_message = self.chat_1.send_command.click()
send_message.amount_edit_box.set_value(amount) send_message.amount_edit_box.send_keys(amount)
send_message.confirm() send_message.confirm()
send_message.next_button.click() send_message.next_button.click()
from views.send_transaction_view import SendTransactionView from views.send_transaction_view import SendTransactionView
@ -790,14 +790,14 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Validation: invalid public key and invalid ENS") self.home_1.just_fyi("Validation: invalid public key and invalid ENS")
for invalid_chat_key in (basic_user['public_key'][:-1], ens_user_message_sender['ens'][:-2]): for invalid_chat_key in (basic_user['public_key'][:-1], ens_user_message_sender['ens'][:-2]):
chat.public_key_edit_box.clear() chat.public_key_edit_box.clear()
chat.public_key_edit_box.set_value(invalid_chat_key) chat.public_key_edit_box.send_keys(invalid_chat_key)
chat.confirm() chat.confirm()
if not self.home_1.element_by_translation_id("profile-not-found").is_element_displayed(): if not self.home_1.element_by_translation_id("profile-not-found").is_element_displayed():
self.errors.append('Error is not shown for invalid public key') self.errors.append('Error is not shown for invalid public key')
self.home_1.just_fyi("Check that valid ENS is resolved") self.home_1.just_fyi("Check that valid ENS is resolved")
chat.public_key_edit_box.clear() chat.public_key_edit_box.clear()
chat.public_key_edit_box.set_value(ens_user_message_sender['ens']) chat.public_key_edit_box.send_keys(ens_user_message_sender['ens'])
resolved_ens = '%s.stateofus.eth' % ens_user_message_sender['ens'] resolved_ens = '%s.stateofus.eth' % ens_user_message_sender['ens']
if not chat.element_by_text(resolved_ens).is_element_displayed(10): if not chat.element_by_text(resolved_ens).is_element_displayed(10):
self.errors.append('ENS name is not resolved after pasting chat key') self.errors.append('ENS name is not resolved after pasting chat key')
@ -1371,7 +1371,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUiTwo(MultipleSharedDeviceTestCase
for home in self.homes: for home in self.homes:
home.toggle_airplane_mode() home.toggle_airplane_mode()
if not home.chats_tab.is_element_displayed() and not home.chat_floating_screen.is_element_displayed(): if not home.chats_tab.is_element_displayed() and not home.chat_floating_screen.is_element_displayed():
home.driver.launch_app() home.driver.activate_app(app_package)
SignInView(home.driver).sign_in() SignInView(home.driver).sign_in()
# Not implemented yet # Not implemented yet
@ -1397,7 +1397,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUiTwo(MultipleSharedDeviceTestCase
for i, home in enumerate(self.homes): for i, home in enumerate(self.homes):
home.toggle_airplane_mode() home.toggle_airplane_mode()
if not home.chats_tab.is_element_displayed() and not home.chat_floating_screen.is_element_displayed(): if not home.chats_tab.is_element_displayed() and not home.chat_floating_screen.is_element_displayed():
home.driver.launch_app() home.driver.activate_app(app_package)
SignInView(home.driver).sign_in() SignInView(home.driver).sign_in()
home.chats_tab.click() home.chats_tab.click()
home.get_chat(self.username_2 if i == 0 else self.username_1).click() home.get_chat(self.username_2 if i == 0 else self.username_1).click()

View File

@ -5,7 +5,7 @@ from _pytest.outcomes import Failed
from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.common.exceptions import NoSuchElementException, TimeoutException
from tests import marks, run_in_parallel, transl from tests import marks, run_in_parallel, transl
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers, app_package
from views.chat_view import ChatView from views.chat_view import ChatView
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -428,7 +428,7 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
self.homes[0].click_system_back_button() self.homes[0].click_system_back_button()
# workaround for app closed after opening notifications # workaround for app closed after opening notifications
if not self.homes[0].chats_tab.is_element_displayed(): if not self.homes[0].chats_tab.is_element_displayed():
self.drivers[0].launch_app() self.drivers[0].activate_app(app_package)
SignInView(self.drivers[0]).sign_in() SignInView(self.drivers[0]).sign_in()
self.homes[0].chats_tab.click() self.homes[0].chats_tab.click()
self.homes[0].get_chat(self.chat_name).click() self.homes[0].get_chat(self.chat_name).click()

View File

@ -107,10 +107,10 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
recovery_phrase = profile.get_recovery_phrase() recovery_phrase = profile.get_recovery_phrase()
profile.next_button.click() profile.next_button.click()
word_number = profile.recovery_phrase_word_number.number word_number = profile.recovery_phrase_word_number.number
profile.recovery_phrase_word_input.set_value(recovery_phrase[word_number]) profile.recovery_phrase_word_input.send_keys(recovery_phrase[word_number])
profile.next_button.click() profile.next_button.click()
word_number_1 = profile.recovery_phrase_word_number.number word_number_1 = profile.recovery_phrase_word_number.number
profile.recovery_phrase_word_input.set_value(recovery_phrase[word_number_1]) profile.recovery_phrase_word_input.send_keys(recovery_phrase[word_number_1])
profile.done_button.click() profile.done_button.click()
profile.yes_button.click() profile.yes_button.click()
profile.ok_got_it_button.click() profile.ok_got_it_button.click()
@ -129,10 +129,10 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.access_key_button.click() self.sign_in.access_key_button.click()
self.sign_in.enter_seed_phrase_button.click() self.sign_in.enter_seed_phrase_button.click()
self.sign_in.seedphrase_input.click() self.sign_in.seedphrase_input.click()
self.sign_in.seedphrase_input.set_value(' '.join(recovery_phrase.values())) self.sign_in.seedphrase_input.send_keys(' '.join(recovery_phrase.values()))
self.sign_in.next_button.click() self.sign_in.next_button.click()
self.sign_in.element_by_translation_id(translation_id="unlock", uppercase=True).click() self.sign_in.element_by_translation_id(translation_id="unlock", uppercase=True).click()
self.sign_in.password_input.set_value(self.password) self.sign_in.password_input.send_keys(self.password)
self.sign_in.sign_in_button.click() self.sign_in.sign_in_button.click()
self.home.plus_button.wait_and_click() self.home.plus_button.wait_and_click()
if not self.home.start_new_chat_button.is_element_displayed(): if not self.home.start_new_chat_button.is_element_displayed():
@ -149,12 +149,12 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
if self.sign_in.ok_button.is_element_displayed(): if self.sign_in.ok_button.is_element_displayed():
self.sign_in.ok_button.click() self.sign_in.ok_button.click()
self.sign_in.multi_account_on_login_button.click() self.sign_in.multi_account_on_login_button.click()
self.sign_in.password_input.set_value(common_password) self.sign_in.password_input.send_keys(common_password)
self.sign_in.sign_in_button.click() self.sign_in.sign_in_button.click()
self.sign_in.element_by_translation_id("wrong-password").wait_for_visibility_of_element(20) self.sign_in.element_by_translation_id("wrong-password").wait_for_visibility_of_element(20)
if not self.sign_in.element_by_text(self.username).is_element_displayed(): if not self.sign_in.element_by_text(self.username).is_element_displayed():
self.errors.append('Username is not shown while login') self.errors.append('Username is not shown while login')
self.sign_in.password_input.set_value(self.password) self.sign_in.password_input.send_keys(self.password)
self.sign_in.sign_in_button.click() self.sign_in.sign_in_button.click()
if not self.sign_in.home_button.is_element_displayed(10): if not self.sign_in.home_button.is_element_displayed(10):
self.errors.append('User is not logged in') self.errors.append('User is not logged in')
@ -207,8 +207,8 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.confirm_your_password_input.send_keys('1234567') self.sign_in.confirm_your_password_input.send_keys('1234567')
if not self.sign_in.element_by_translation_id("password_error1").is_element_displayed(): if not self.sign_in.element_by_translation_id("password_error1").is_element_displayed():
self.errors.append("'%s' is not shown" % self.sign_in.get_translation_by_key("password_error1")) self.errors.append("'%s' is not shown" % self.sign_in.get_translation_by_key("password_error1"))
self.sign_in.create_password_input.set_value(common_password) self.sign_in.create_password_input.send_keys(common_password)
self.sign_in.confirm_your_password_input.set_value(common_password) self.sign_in.confirm_your_password_input.send_keys(common_password)
self.sign_in.next_button.click() self.sign_in.next_button.click()
[element.wait_and_click(10) for element in (self.sign_in.maybe_later_button, self.sign_in.start_button)] [element.wait_and_click(10) for element in (self.sign_in.maybe_later_button, self.sign_in.start_button)]
@ -261,7 +261,7 @@ class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase):
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.amount_edit_box.click() send_transaction.amount_edit_box.click()
send_transaction.amount_edit_box.set_value("0") send_transaction.amount_edit_box.send_keys("0")
send_transaction.set_recipient_address("0x" + basic_user['address']) send_transaction.set_recipient_address("0x" + basic_user['address'])
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
@ -282,7 +282,7 @@ class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase):
wallet.wallet_button.click() wallet.wallet_button.click()
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.amount_edit_box.set_value('0') send_transaction.amount_edit_box.send_keys('0')
send_transaction.set_recipient_address('0x%s' % basic_user['address']) send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.next_button.click_until_presence_of_element(send_transaction.sign_transaction_button) send_transaction.next_button.click_until_presence_of_element(send_transaction.sign_transaction_button)
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
@ -348,7 +348,7 @@ class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.access_key_button.click() self.sign_in.access_key_button.click()
if self.sign_in.enter_seed_phrase_button.is_element_displayed(): if self.sign_in.enter_seed_phrase_button.is_element_displayed():
self.sign_in.enter_seed_phrase_button.click() self.sign_in.enter_seed_phrase_button.click()
self.sign_in.seedphrase_input.set_value(phrase) self.sign_in.seedphrase_input.send_keys(phrase)
if msg: if msg:
if not self.sign_in.element_by_text(msg).is_element_displayed(): if not self.sign_in.element_by_text(msg).is_element_displayed():
@ -410,17 +410,17 @@ class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.move_keystore_file_option.click() self.sign_in.move_keystore_file_option.click()
self.sign_in.reset_database_checkbox.click() self.sign_in.reset_database_checkbox.click()
self.sign_in.enter_seed_phrase_next_button.click() self.sign_in.enter_seed_phrase_next_button.click()
self.sign_in.seedphrase_input.set_value(transaction_senders['A']['passphrase']) self.sign_in.seedphrase_input.send_keys(transaction_senders['A']['passphrase'])
self.sign_in.choose_storage_button.click() self.sign_in.choose_storage_button.click()
if not self.sign_in.element_by_translation_id("seed-key-uid-mismatch").is_element_displayed(): if not self.sign_in.element_by_translation_id("seed-key-uid-mismatch").is_element_displayed():
self.driver.fail("Can proceed with seed phrase of another user") self.driver.fail("Can proceed with seed phrase of another user")
self.sign_in.element_by_translation_id("try-again").click() self.sign_in.element_by_translation_id("try-again").click()
self.sign_in.seedphrase_input.set_value(self.user['passphrase'][:-1]) self.sign_in.seedphrase_input.send_keys(self.user['passphrase'][:-1])
self.sign_in.choose_storage_button.click() self.sign_in.choose_storage_button.click()
if not self.sign_in.custom_seed_phrase_label.is_element_displayed(): if not self.sign_in.custom_seed_phrase_label.is_element_displayed():
self.driver.fail("Can proceed with invalid seed phrase") self.driver.fail("Can proceed with invalid seed phrase")
self.sign_in.cancel_button.click() self.sign_in.cancel_button.click()
self.sign_in.seedphrase_input.set_value(self.user['passphrase']) self.sign_in.seedphrase_input.send_keys(self.user['passphrase'])
self.sign_in.choose_storage_button.click() self.sign_in.choose_storage_button.click()
if not self.sign_in.get_keycard_banner.is_element_displayed(): if not self.sign_in.get_keycard_banner.is_element_displayed():
self.errors.append("Get a keycard banner is not shown on Key management screen") self.errors.append("Get a keycard banner is not shown on Key management screen")

View File

@ -10,7 +10,7 @@ from dateutil import parser
from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.common.exceptions import NoSuchElementException, TimeoutException
from tests import marks, test_dapp_name, test_dapp_url, run_in_parallel, pytest_config_global, transl from tests import marks, test_dapp_name, test_dapp_url, run_in_parallel, pytest_config_global, transl
from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase, app_package
from views.chat_view import CommunityView from views.chat_view import CommunityView
from views.dbs.waku_backup import user as waku_user from views.dbs.waku_backup import user as waku_user
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -134,7 +134,7 @@ class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase):
@marks.testrail_id(700739) @marks.testrail_id(700739)
def test_public_chat_open_using_deep_link(self): def test_public_chat_open_using_deep_link(self):
self.drivers[0].close_app() self.drivers[0].terminate_app(app_package)
chat_name = self.home.get_random_chat_name() chat_name = self.home.get_random_chat_name()
deep_link = 'status-im://%s' % chat_name deep_link = 'status-im://%s' % chat_name
self.sign_in.open_weblink_and_login(deep_link) self.sign_in.open_weblink_and_login(deep_link)
@ -831,7 +831,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
for key, data in preview_urls.items(): for key, data in preview_urls.items():
self.home_2.just_fyi("Checking %s preview case" % key) self.home_2.just_fyi("Checking %s preview case" % key)
url = data['url'] url = data['url']
self.channel_2.chat_message_input.set_value(url) self.channel_2.chat_message_input.send_keys(url)
self.channel_2.url_preview_composer.wait_for_element(20) self.channel_2.url_preview_composer.wait_for_element(20)
shown_title = self.channel_2.url_preview_composer_text.text shown_title = self.channel_2.url_preview_composer_text.text
if shown_title != data['title']: if shown_title != data['title']:
@ -923,7 +923,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
# workaround for app closed after airplane mode # workaround for app closed after airplane mode
if not self.home_1.chats_tab.is_element_displayed() and \ if not self.home_1.chats_tab.is_element_displayed() and \
not self.chat_1.chat_floating_screen.is_element_displayed(): not self.chat_1.chat_floating_screen.is_element_displayed():
self.device_1.driver.launch_app() self.device_1.driver.activate_app(app_package)
self.device_1.sign_in() self.device_1.sign_in()
self.home_2.just_fyi('Send message to public chat while device 1 is offline') self.home_2.just_fyi('Send message to public chat while device 1 is offline')

View File

@ -68,7 +68,7 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.just_fyi("Checking signing message") self.wallet.just_fyi("Checking signing message")
status_test_dapp.transactions_button.click() status_test_dapp.transactions_button.click()
send_transaction = status_test_dapp.sign_message_button.click() send_transaction = status_test_dapp.sign_message_button.click()
send_transaction.enter_password_input.set_value(common_password) send_transaction.enter_password_input.send_keys(common_password)
send_transaction.sign_button.click() send_transaction.sign_button.click()
if not status_test_dapp.element_by_text_part('Signed message').is_element_displayed(): if not status_test_dapp.element_by_text_part('Signed message').is_element_displayed():
self.errors.append('Message was not signed') self.errors.append('Message was not signed')
@ -129,7 +129,7 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
send_tx.eth_asset_in_select_asset_bottom_sheet_button) send_tx.eth_asset_in_select_asset_bottom_sheet_button)
asset_button.click() asset_button.click()
send_tx.amount_edit_box.click() send_tx.amount_edit_box.click()
send_tx.amount_edit_box.set_value(self.amount_eth) send_tx.amount_edit_box.send_keys(self.amount_eth)
send_tx.set_recipient_address(self.recipient_address) send_tx.set_recipient_address(self.recipient_address)
send_tx.sign_transaction_button.click() send_tx.sign_transaction_button.click()
if self.wallet.sign_in_phrase.is_element_displayed(): if self.wallet.sign_in_phrase.is_element_displayed():
@ -185,10 +185,10 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
wallet.just_fyi("Check that can't send to invalid address") wallet.just_fyi("Check that can't send to invalid address")
send_tr.amount_edit_box.click() send_tr.amount_edit_box.click()
send_tr.amount_edit_box.set_value(send_tr.get_unique_amount()) send_tr.amount_edit_box.send_keys(send_tr.get_unique_amount())
send_tr.chose_recipient_button.click() send_tr.chose_recipient_button.click()
for address in (basic_user['public_key'], '0xDE709F2102306220921060314715629080E2fB77'): for address in (basic_user['public_key'], '0xDE709F2102306220921060314715629080E2fB77'):
send_tr.enter_recipient_address_input.set_value(address) send_tr.enter_recipient_address_input.send_keys(address)
send_tr.enter_recipient_address_input.click() send_tr.enter_recipient_address_input.click()
send_tr.done_button.click() send_tr.done_button.click()
if send_tr.set_max_button.is_element_displayed(): if send_tr.set_max_button.is_element_displayed():
@ -377,7 +377,7 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.recover_with_keycard_button.click() self.sign_in.recover_with_keycard_button.click()
keycard = self.sign_in.begin_recovery_button.click() keycard = self.sign_in.begin_recovery_button.click()
keycard.connect_pairing_card_button.click() keycard.connect_pairing_card_button.click()
keycard.pair_code_input.set_value(pair_code) keycard.pair_code_input.send_keys(pair_code)
self.sign_in.pair_to_this_device_button.click() self.sign_in.pair_to_this_device_button.click()
keycard.enter_default_pin() keycard.enter_default_pin()
self.sign_in.maybe_later_button.click_until_presence_of_element(self.sign_in.start_button) self.sign_in.maybe_later_button.click_until_presence_of_element(self.sign_in.start_button)
@ -450,7 +450,7 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.access_key_button.click() self.sign_in.access_key_button.click()
self.sign_in.enter_seed_phrase_button.click() self.sign_in.enter_seed_phrase_button.click()
self.sign_in.seedphrase_input.click() self.sign_in.seedphrase_input.click()
self.sign_in.seedphrase_input.set_value(seed_phrase) self.sign_in.seedphrase_input.send_keys(seed_phrase)
self.sign_in.next_button.click() self.sign_in.next_button.click()
self.sign_in.element_by_translation_id("unlock", uppercase=True).click() self.sign_in.element_by_translation_id("unlock", uppercase=True).click()
keycard_flow.enter_default_pin() keycard_flow.enter_default_pin()

View File

@ -198,13 +198,13 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.add_account_button.click() self.wallet.add_account_button.click()
self.wallet.enter_a_private_key_button.click() self.wallet.enter_a_private_key_button.click()
self.wallet.enter_your_password_input.send_keys(common_password) self.wallet.enter_your_password_input.send_keys(common_password)
self.wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key'][0:9]) self.wallet.enter_a_private_key_input.send_keys(wallet_users['C']['private_key'][0:9])
account_name_private = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10)) account_name_private = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
self.wallet.account_name_input.send_keys(account_name_private) self.wallet.account_name_input.send_keys(account_name_private)
self.wallet.add_account_generate_account_button.click() self.wallet.add_account_generate_account_button.click()
if self.wallet.get_account_by_name(account_name_private).is_element_displayed(): if self.wallet.get_account_by_name(account_name_private).is_element_displayed():
self.driver.fail('Account is added with wrong private key') self.driver.fail('Account is added with wrong private key')
self.wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key']) self.wallet.enter_a_private_key_input.send_keys(wallet_users['C']['private_key'])
self.wallet.add_account_generate_account_button.click() self.wallet.add_account_generate_account_button.click()
account_button = self.wallet.get_account_by_name(account_name_private) account_button = self.wallet.get_account_by_name(account_name_private)
if not account_button.is_element_displayed(): if not account_button.is_element_displayed():
@ -264,18 +264,18 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.home.just_fyi('Check basic validation when adding account from seed phrase') self.home.just_fyi('Check basic validation when adding account from seed phrase')
self.wallet.enter_your_password_input.send_keys(common_password) self.wallet.enter_your_password_input.send_keys(common_password)
self.wallet.enter_seed_phrase_input.set_value('') self.wallet.enter_seed_phrase_input.send_keys('')
self.wallet.account_name_input.send_keys(account_seed_collectibles) self.wallet.account_name_input.send_keys(account_seed_collectibles)
self.wallet.add_account_generate_account_button.click() self.wallet.add_account_generate_account_button.click()
if self.wallet.get_account_by_name(account_seed_collectibles).is_element_displayed(): if self.wallet.get_account_by_name(account_seed_collectibles).is_element_displayed():
self.wallet.driver.fail('Account is added without seed phrase') self.wallet.driver.fail('Account is added without seed phrase')
self.wallet.enter_seed_phrase_input.set_value(str(wallet_users['D']['passphrase']).upper()) self.wallet.enter_seed_phrase_input.send_keys(str(wallet_users['D']['passphrase']).upper())
self.wallet.add_account_generate_account_button.click() self.wallet.add_account_generate_account_button.click()
if self.wallet.get_account_by_name(account_seed_collectibles).is_element_displayed(): if self.wallet.get_account_by_name(account_seed_collectibles).is_element_displayed():
self.wallet.driver.fail('Same account was added twice') self.wallet.driver.fail('Same account was added twice')
self.wallet.enter_your_password_input.send_keys(common_password) self.wallet.enter_your_password_input.send_keys(common_password)
self.wallet.enter_seed_phrase_input.set_value(str(user['passphrase']).upper()) self.wallet.enter_seed_phrase_input.send_keys(str(user['passphrase']).upper())
self.wallet.account_name_input.send_keys(account_seed_collectibles) self.wallet.account_name_input.send_keys(account_seed_collectibles)
self.wallet.add_account_generate_account_button.click() self.wallet.add_account_generate_account_button.click()
account_button = self.wallet.get_account_by_name(account_seed_collectibles) account_button = self.wallet.get_account_by_name(account_seed_collectibles)
@ -298,7 +298,7 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.just_fyi('Checking insufficient_balance errors') self.sign_in.just_fyi('Checking insufficient_balance errors')
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.amount_edit_box.set_value(round(eth_value + 1)) send_transaction.amount_edit_box.send_keys(round(eth_value + 1))
error_text = send_transaction.element_by_text('Insufficient funds') error_text = send_transaction.element_by_text('Insufficient funds')
if not error_text.is_element_displayed(): if not error_text.is_element_displayed():
self.errors.append( self.errors.append(
@ -307,7 +307,7 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
send_transaction.select_asset_button.click() send_transaction.select_asset_button.click()
send_transaction.asset_by_name('STT').scroll_to_element() send_transaction.asset_by_name('STT').scroll_to_element()
send_transaction.asset_by_name('STT').click() send_transaction.asset_by_name('STT').click()
send_transaction.amount_edit_box.set_value(round(stt_value + 1)) send_transaction.amount_edit_box.send_keys(round(stt_value + 1))
if not error_text.is_element_displayed(): if not error_text.is_element_displayed():
self.errors.append( self.errors.append(
"'Insufficient funds' error is not shown when sending %s STT from wallet with balance %s" % ( "'Insufficient funds' error is not shown when sending %s STT from wallet with balance %s" % (

View File

@ -248,7 +248,7 @@ class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase):
chat.public_key_edit_box.click() chat.public_key_edit_box.click()
chat.public_key_edit_box.send_keys(users[key]['contact_code']) chat.public_key_edit_box.send_keys(users[key]['contact_code'])
if 'nickname' in users[key]: if 'nickname' in users[key]:
chat.nickname_input_field.set_value(users[key]['nickname']) chat.nickname_input_field.send_keys(users[key]['nickname'])
chat.confirm_until_presence_of_element(profile.add_new_contact_button) chat.confirm_until_presence_of_element(profile.add_new_contact_button)
if not profile.element_by_text(users[key]['username']).is_element_displayed(): if not profile.element_by_text(users[key]['username']).is_element_displayed():
self.errors.append('In %s case username not found in contact view after scanning' % key) self.errors.append('In %s case username not found in contact view after scanning' % key)
@ -447,17 +447,17 @@ class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase):
profile.just_fyi("Check that can not reset password when entering wrong current password") profile.just_fyi("Check that can not reset password when entering wrong current password")
profile.reset_password_button.click() profile.reset_password_button.click()
profile.current_password_edit_box.send_keys(common_password + '1') profile.current_password_edit_box.send_keys(common_password + '1')
profile.new_password_edit_box.set_value(new_password) profile.new_password_edit_box.send_keys(new_password)
profile.confirm_new_password_edit_box.set_value(new_password) profile.confirm_new_password_edit_box.send_keys(new_password)
profile.next_button.click() profile.next_button.click()
if not profile.current_password_wrong_text.is_element_displayed(): if not profile.current_password_wrong_text.is_element_displayed():
self.errors.append("Validation error for wrong current password is not shown") self.errors.append("Validation error for wrong current password is not shown")
profile.just_fyi("Check that can not procced if did not confirm new password") profile.just_fyi("Check that can not procced if did not confirm new password")
profile.current_password_edit_box.clear() profile.current_password_edit_box.clear()
profile.current_password_edit_box.set_value(common_password) profile.current_password_edit_box.send_keys(common_password)
profile.new_password_edit_box.set_value(new_password) profile.new_password_edit_box.send_keys(new_password)
profile.confirm_new_password_edit_box.set_value(new_password + '1') profile.confirm_new_password_edit_box.send_keys(new_password + '1')
profile.next_button.click() profile.next_button.click()
profile.just_fyi("Delete last symbol and check that can reset password") profile.just_fyi("Delete last symbol and check that can reset password")

View File

@ -6,7 +6,7 @@ import pytest
from tests import bootnode_address, mailserver_address, mailserver_ams, used_fleet, background_service_message from tests import bootnode_address, mailserver_address, mailserver_ams, used_fleet, background_service_message
from tests import marks from tests import marks
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers, app_package
from tests.users import transaction_senders, ens_user from tests.users import transaction_senders, ens_user
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -147,16 +147,16 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared
self.profile_1.advanced_button.click() self.profile_1.advanced_button.click()
self.profile_1.bootnodes_button.click() self.profile_1.bootnodes_button.click()
self.profile_1.add_bootnode_button.click() self.profile_1.add_bootnode_button.click()
self.profile_1.specify_name_input.set_value('test') self.profile_1.specify_name_input.send_keys('test')
# TODO: blocked as validation is missing for bootnodes (rechecked 04.10.22, valid) # TODO: blocked as validation is missing for bootnodes (rechecked 04.10.22, valid)
# profile_1.bootnode_address_input.set_value('invalid_bootnode_address') # profile_1.bootnode_address_input.send_keys('invalid_bootnode_address')
# if not profile_1.element_by_text_part('Invalid format').is_element_displayed(): # if not profile_1.element_by_text_part('Invalid format').is_element_displayed():
# self.errors.append('Validation message about invalid format of bootnode is not shown') # self.errors.append('Validation message about invalid format of bootnode is not shown')
# profile_1.save_button.click() # profile_1.save_button.click()
# if profile_1.add_bootnode_button.is_element_displayed(): # if profile_1.add_bootnode_button.is_element_displayed():
# self.errors.append('User was navigated to another screen when tapped on disabled "Save" button') # self.errors.append('User was navigated to another screen when tapped on disabled "Save" button')
# profile_1.bootnode_address_input.clear() # profile_1.bootnode_address_input.clear()
self.profile_1.bootnode_address_input.set_value(bootnode_address) self.profile_1.bootnode_address_input.send_keys(bootnode_address)
self.profile_1.save_button.click() self.profile_1.save_button.click()
self.profile_1.enable_bootnodes.click() self.profile_1.enable_bootnodes.click()
self.profile_1.home_button.double_click() self.profile_1.home_button.double_click()
@ -237,8 +237,8 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared
self.profile_1.mail_server_auto_selection_button.click() self.profile_1.mail_server_auto_selection_button.click()
self.profile_1.plus_button.click() self.profile_1.plus_button.click()
server_name = 'a_test' server_name = 'a_test'
self.profile_1.specify_name_input.set_value(server_name) self.profile_1.specify_name_input.send_keys(server_name)
self.profile_1.mail_server_address_input.set_value('%s%s' % (mailserver_address[:-3], '553')) self.profile_1.mail_server_address_input.send_keys('%s%s' % (mailserver_address[:-3], '553'))
self.profile_1.save_button.click() self.profile_1.save_button.click()
self.profile_1.mail_server_by_name(server_name).click() self.profile_1.mail_server_by_name(server_name).click()
self.profile_1.mail_server_connect_button.wait_and_click() self.profile_1.mail_server_connect_button.wait_and_click()
@ -890,7 +890,7 @@ class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase):
self.home_1.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % self.amount) self.home_1.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % self.amount)
self.chat_1.commands_button.click() self.chat_1.commands_button.click()
request_transaction = self.chat_1.request_command.click() request_transaction = self.chat_1.request_command.click()
request_transaction.amount_edit_box.set_value(self.amount) request_transaction.amount_edit_box.send_keys(self.amount)
request_transaction.confirm() request_transaction.confirm()
asset_button = request_transaction.asset_by_name(self.asset_name) asset_button = request_transaction.asset_by_name(self.asset_name)
request_transaction.select_asset_button.click_until_presence_of_element(asset_button) request_transaction.select_asset_button.click_until_presence_of_element(asset_button)
@ -1000,7 +1000,7 @@ class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase):
self.device_1.just_fyi("reopen app and check that messages from blocked user are not fetched") self.device_1.just_fyi("reopen app and check that messages from blocked user are not fetched")
self.device_1.click_system_home_button() self.device_1.click_system_home_button()
self.device_1.driver.launch_app() self.device_1.driver.activate_app(app_package)
self.device_1.sign_in(keycard=True) self.device_1.sign_in(keycard=True)
if blocked_chat_user.is_element_displayed(): if blocked_chat_user.is_element_displayed():
self.errors.append("Chat with blocked user is reappeared after fetching new messages from offline") self.errors.append("Chat with blocked user is reappeared after fetching new messages from offline")

View File

@ -333,7 +333,7 @@ class TestPermissionsScanQrOneDevice(MultipleSharedDeviceTestCase):
wallet.accounts_status_account.click_until_presence_of_element(wallet.send_transaction_button) wallet.accounts_status_account.click_until_presence_of_element(wallet.send_transaction_button)
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.set_recipient_address('0x%s' % basic_user['address']) send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.amount_edit_box.set_value("0") send_transaction.amount_edit_box.send_keys("0")
send_transaction.confirm() send_transaction.confirm()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
wallet.set_up_wallet_when_sending_tx() wallet.set_up_wallet_when_sending_tx()

View File

@ -72,7 +72,7 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
profile_1.just_fyi('Check profile image it is not in mentions because user not in contacts yet') profile_1.just_fyi('Check profile image it is not in mentions because user not in contacts yet')
one_to_one_chat_2 = self.home_2.get_chat(self.default_username_1).click() one_to_one_chat_2 = self.home_2.get_chat(self.default_username_1).click()
one_to_one_chat_2.chat_message_input.set_value('@' + self.default_username_1) one_to_one_chat_2.chat_message_input.send_keys('@' + self.default_username_1)
one_to_one_chat_2.chat_message_input.click() one_to_one_chat_2.chat_message_input.click()
if one_to_one_chat_2.user_profile_image_in_mentions_list( if one_to_one_chat_2.user_profile_image_in_mentions_list(
self.default_username_1).is_element_image_similar_to_template(logo_default): self.default_username_1).is_element_image_similar_to_template(logo_default):
@ -81,7 +81,7 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
profile_1.just_fyi('Check profile image is in mentions because now user was added in contacts') profile_1.just_fyi('Check profile image is in mentions because now user was added in contacts')
one_to_one_chat_2.add_to_contacts.click() one_to_one_chat_2.add_to_contacts.click()
one_to_one_chat_2.send_message("hey") one_to_one_chat_2.send_message("hey")
one_to_one_chat_2.chat_message_input.set_value('@' + self.default_username_1) one_to_one_chat_2.chat_message_input.send_keys('@' + self.default_username_1)
one_to_one_chat_2.chat_message_input.click() one_to_one_chat_2.chat_message_input.click()
if not one_to_one_chat_2.user_profile_image_in_mentions_list( if not one_to_one_chat_2.user_profile_image_in_mentions_list(
self.default_username_1).is_element_image_similar_to_template(logo_default): self.default_username_1).is_element_image_similar_to_template(logo_default):
@ -143,7 +143,7 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
if not sign_in_1.get_multiaccount_by_position(1).account_logo.is_element_image_similar_to_template( if not sign_in_1.get_multiaccount_by_position(1).account_logo.is_element_image_similar_to_template(
logo_default): logo_default):
self.errors.append('User profile picture was not updated on account login view') self.errors.append('User profile picture was not updated on account login view')
sign_in_1.password_input.set_value(common_password) sign_in_1.password_input.send_keys(common_password)
sign_in_1.sign_in_button.click() sign_in_1.sign_in_button.click()
profile_1.just_fyi('Remove user from contact and check there is no profile image displayed') profile_1.just_fyi('Remove user from contact and check there is no profile image displayed')

View File

@ -24,7 +24,7 @@ class TestChatManagement(SingleDeviceTestCase):
sign_in.recover_with_keycard_button.click() sign_in.recover_with_keycard_button.click()
keycard_view = sign_in.begin_recovery_button.click() keycard_view = sign_in.begin_recovery_button.click()
keycard_view.connect_pairing_card_button.click() keycard_view.connect_pairing_card_button.click()
keycard_view.pair_code_input.set_value(pair_code) keycard_view.pair_code_input.send_keys(pair_code)
keycard_view.confirm() keycard_view.confirm()
keycard_view.enter_default_pin() keycard_view.enter_default_pin()
sign_in.maybe_later_button.click_until_presence_of_element(sign_in.start_button) sign_in.maybe_later_button.click_until_presence_of_element(sign_in.start_button)
@ -224,7 +224,7 @@ class TestChatManagement(SingleDeviceTestCase):
sign_in.access_key_button.click() sign_in.access_key_button.click()
sign_in.enter_seed_phrase_button.click() sign_in.enter_seed_phrase_button.click()
sign_in.seedphrase_input.click() sign_in.seedphrase_input.click()
sign_in.seedphrase_input.set_value(basic_user['passphrase']) sign_in.seedphrase_input.send_keys(basic_user['passphrase'])
sign_in.next_button.click() sign_in.next_button.click()
sign_in.reencrypt_your_key_button.click() sign_in.reencrypt_your_key_button.click()
keycard_flow = sign_in.keycard_storage_button.click() keycard_flow = sign_in.keycard_storage_button.click()
@ -325,13 +325,13 @@ class TestChatManagement(SingleDeviceTestCase):
if not home.element_by_translation_id("keycard-is-frozen-title").is_element_displayed(30): if not home.element_by_translation_id("keycard-is-frozen-title").is_element_displayed(30):
self.driver.fail("No reset card flow is shown for frozen card") self.driver.fail("No reset card flow is shown for frozen card")
home.element_by_translation_id("keycard-is-frozen-factory-reset").click() home.element_by_translation_id("keycard-is-frozen-factory-reset").click()
sign_in.seedphrase_input.set_value(transaction_senders['A']['passphrase']) sign_in.seedphrase_input.send_keys(transaction_senders['A']['passphrase'])
sign_in.next_button.click() sign_in.next_button.click()
if not home.element_by_translation_id("seed-key-uid-mismatch").is_element_displayed(): if not home.element_by_translation_id("seed-key-uid-mismatch").is_element_displayed():
self.driver.fail("No popup about mismatch in seed phrase is shown!") self.driver.fail("No popup about mismatch in seed phrase is shown!")
home.element_by_translation_id("try-again").click() home.element_by_translation_id("try-again").click()
sign_in.seedphrase_input.clear() sign_in.seedphrase_input.clear()
sign_in.seedphrase_input.set_value(seed) sign_in.seedphrase_input.send_keys(seed)
sign_in.next_button.click() sign_in.next_button.click()
keycard.begin_setup_button.click() keycard.begin_setup_button.click()
keycard.yes_button.click() keycard.yes_button.click()
@ -353,7 +353,7 @@ class TestChatManagement(SingleDeviceTestCase):
self.driver.fail("No popup about frozen keycard is shown!") self.driver.fail("No popup about frozen keycard is shown!")
sign_in.element_by_translation_id("keycard-is-frozen-factory-reset").click() sign_in.element_by_translation_id("keycard-is-frozen-factory-reset").click()
sign_in.seedphrase_input.set_value(seed) sign_in.seedphrase_input.send_keys(seed)
sign_in.next_button.click() sign_in.next_button.click()
keycard.begin_setup_button.click() keycard.begin_setup_button.click()
keycard.yes_button.click() keycard.yes_button.click()
@ -407,7 +407,7 @@ class TestChatManagement(SingleDeviceTestCase):
keycard.element_by_translation_id("keycard-is-blocked-title").wait_for_element(30) keycard.element_by_translation_id("keycard-is-blocked-title").wait_for_element(30)
keycard.element_by_translation_id("keycard-recover").click() keycard.element_by_translation_id("keycard-recover").click()
keycard.yes_button.click() keycard.yes_button.click()
sign_in.seedphrase_input.set_value(seed) sign_in.seedphrase_input.send_keys(seed)
sign_in.next_button.click() sign_in.next_button.click()
keycard.begin_setup_button.click() keycard.begin_setup_button.click()
keycard.yes_button.click() keycard.yes_button.click()
@ -441,7 +441,7 @@ class TestChatManagement(SingleDeviceTestCase):
wallet.add_account_button.click() wallet.add_account_button.click()
wallet.enter_a_seed_phrase_button.click() wallet.enter_a_seed_phrase_button.click()
wallet.enter_your_password_input.send_keys(common_password) wallet.enter_your_password_input.send_keys(common_password)
wallet.enter_seed_phrase_input.set_value(receiver['passphrase']) wallet.enter_seed_phrase_input.send_keys(receiver['passphrase'])
wallet.account_name_input.send_keys(account_name) wallet.account_name_input.send_keys(account_name)
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
account_button = wallet.get_account_by_name(account_name) account_button = wallet.get_account_by_name(account_name)
@ -513,14 +513,14 @@ class TestChatManagement(SingleDeviceTestCase):
adi_button.click() adi_button.click()
send_transaction.amount_edit_box.click() send_transaction.amount_edit_box.click()
amount = '0.000%s' % str(random.randint(100000, 999999)) + '1' amount = '0.000%s' % str(random.randint(100000, 999999)) + '1'
send_transaction.amount_edit_box.set_value(amount) send_transaction.amount_edit_box.send_keys(amount)
if not send_transaction.element_by_text( if not send_transaction.element_by_text(
errors['send_transaction_screen']['too_precise']).is_element_displayed(): errors['send_transaction_screen']['too_precise']).is_element_displayed():
self.errors.append(warning % (errors['send_transaction_screen']['too_precise'], screen)) self.errors.append(warning % (errors['send_transaction_screen']['too_precise'], screen))
sign_in.just_fyi('Checking %s on %s' % (errors['send_transaction_screen']['insufficient_funds'], screen)) sign_in.just_fyi('Checking %s on %s' % (errors['send_transaction_screen']['insufficient_funds'], screen))
send_transaction.amount_edit_box.clear() send_transaction.amount_edit_box.clear()
send_transaction.amount_edit_box.set_value(str(initial_amount_adi) + '1') send_transaction.amount_edit_box.send_keys(str(initial_amount_adi) + '1')
if not send_transaction.element_by_text( if not send_transaction.element_by_text(
errors['send_transaction_screen']['insufficient_funds']).is_element_displayed(): errors['send_transaction_screen']['insufficient_funds']).is_element_displayed():
self.errors.append(warning % (errors['send_transaction_screen']['insufficient_funds'], screen)) self.errors.append(warning % (errors['send_transaction_screen']['insufficient_funds'], screen))
@ -533,7 +533,7 @@ class TestChatManagement(SingleDeviceTestCase):
wallet.add_account(account_name) wallet.add_account(account_name)
wallet.get_account_by_name(account_name).click() wallet.get_account_by_name(account_name).click()
wallet.send_transaction_button.click() wallet.send_transaction_button.click()
send_transaction.amount_edit_box.set_value('0') send_transaction.amount_edit_box.send_keys('0')
send_transaction.set_recipient_address(ens_user_message_sender['ens']) send_transaction.set_recipient_address(ens_user_message_sender['ens'])
send_transaction.next_button.click() send_transaction.next_button.click()
wallet.ok_got_it_button.wait_and_click(30) wallet.ok_got_it_button.wait_and_click(30)
@ -571,7 +571,7 @@ class TestChatManagement(SingleDeviceTestCase):
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
amount = '0.000%s' % str(random.randint(100000, 999999)) + '1' amount = '0.000%s' % str(random.randint(100000, 999999)) + '1'
self.value = send_transaction.amount_edit_box.set_value(amount) self.value = send_transaction.amount_edit_box.send_keys(amount)
send_transaction.set_recipient_address(ens_user_message_sender['ens']) send_transaction.set_recipient_address(ens_user_message_sender['ens'])
send_transaction.next_button.click() send_transaction.next_button.click()
wallet.ok_got_it_button.wait_and_click(30) wallet.ok_got_it_button.wait_and_click(30)
@ -611,7 +611,7 @@ class TestChatManagement(SingleDeviceTestCase):
if not send_transaction.element_by_translation_id(values[field][key]).is_element_displayed(10): if not send_transaction.element_by_translation_id(values[field][key]).is_element_displayed(10):
self.errors.append("%s is not shown for %s" % (values[field][key], field.accessibility_id)) self.errors.append("%s is not shown for %s" % (values[field][key], field.accessibility_id))
field.clear() field.clear()
field.set_value(values[field]['value']) field.send_keys(values[field]['value'])
wallet.just_fyi("Set custom fee and check that it will be applied") wallet.just_fyi("Set custom fee and check that it will be applied")
send_transaction.save_fee_button.scroll_and_click() send_transaction.save_fee_button.scroll_and_click()
@ -642,12 +642,12 @@ class TestChatManagement(SingleDeviceTestCase):
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click_until_presence_of_element(send_transaction.amount_edit_box) send_transaction = wallet.send_transaction_button.click_until_presence_of_element(send_transaction.amount_edit_box)
send_transaction.amount_edit_box.set_value(0) send_transaction.amount_edit_box.send_keys(0)
send_transaction.set_recipient_address(ens_user_message_sender['ens']) send_transaction.set_recipient_address(ens_user_message_sender['ens'])
send_transaction.next_button.click() send_transaction.next_button.click()
wallet.element_by_translation_id("network-fee").click() wallet.element_by_translation_id("network-fee").click()
send_transaction.gas_limit_input.clear() send_transaction.gas_limit_input.clear()
send_transaction.gas_limit_input.set_value(default_limit) send_transaction.gas_limit_input.send_keys(default_limit)
send_transaction.per_gas_price_limit_input.clear() send_transaction.per_gas_price_limit_input.clear()
send_transaction.per_gas_price_limit_input.click() send_transaction.per_gas_price_limit_input.click()
send_transaction.per_gas_price_limit_input.send_keys('0.00000000000001') send_transaction.per_gas_price_limit_input.send_keys('0.00000000000001')
@ -664,7 +664,7 @@ class TestChatManagement(SingleDeviceTestCase):
wallet.just_fyi("Check can change tip to higher value and sign transaction") wallet.just_fyi("Check can change tip to higher value and sign transaction")
wallet.element_by_translation_id("network-fee").click() wallet.element_by_translation_id("network-fee").click()
send_transaction.gas_limit_input.clear() send_transaction.gas_limit_input.clear()
send_transaction.gas_limit_input.set_value(default_limit) send_transaction.gas_limit_input.send_keys(default_limit)
send_transaction.per_gas_price_limit_input.clear() send_transaction.per_gas_price_limit_input.clear()
send_transaction.per_gas_price_limit_input.click() send_transaction.per_gas_price_limit_input.click()
send_transaction.per_gas_price_limit_input.send_keys('0.00000000000001') send_transaction.per_gas_price_limit_input.send_keys('0.00000000000001')
@ -683,9 +683,9 @@ class TestChatManagement(SingleDeviceTestCase):
wallet.just_fyi('Check gas limit price is calculated in case of signing contract address') wallet.just_fyi('Check gas limit price is calculated in case of signing contract address')
wallet.send_transaction_button.click_until_presence_of_element(send_transaction.amount_edit_box) wallet.send_transaction_button.click_until_presence_of_element(send_transaction.amount_edit_box)
send_transaction.amount_edit_box.set_value(0) send_transaction.amount_edit_box.send_keys(0)
send_transaction.chose_recipient_button.click() send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_input.set_value('0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6') send_transaction.enter_recipient_address_input.send_keys('0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6')
send_transaction.element_by_translation_id("warning-sending-to-contract-descr").wait_for_visibility_of_element() send_transaction.element_by_translation_id("warning-sending-to-contract-descr").wait_for_visibility_of_element()
send_transaction.ok_button.click() send_transaction.ok_button.click()
send_transaction.enter_recipient_address_input.click() send_transaction.enter_recipient_address_input.click()
@ -705,7 +705,7 @@ class TestChatManagement(SingleDeviceTestCase):
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click_until_presence_of_element(send_transaction.amount_edit_box) send_transaction = wallet.send_transaction_button.click_until_presence_of_element(send_transaction.amount_edit_box)
send_transaction.amount_edit_box.set_value(0) send_transaction.amount_edit_box.send_keys(0)
send_transaction.set_recipient_address(ens_user_message_sender['ens']) send_transaction.set_recipient_address(ens_user_message_sender['ens'])
send_transaction.next_button.click() send_transaction.next_button.click()
wallet.element_by_translation_id("network-fee").click() wallet.element_by_translation_id("network-fee").click()
@ -795,12 +795,12 @@ class TestChatManagement(SingleDeviceTestCase):
send_tx = wallet.send_transaction_from_main_screen.click() send_tx = wallet.send_transaction_from_main_screen.click()
from views.send_transaction_view import SendTransactionView from views.send_transaction_view import SendTransactionView
send_tx = SendTransactionView(self.driver) send_tx = SendTransactionView(self.driver)
send_tx.amount_edit_box.set_value('0') send_tx.amount_edit_box.send_keys('0')
send_tx.set_recipient_address(transaction_senders['ETH_7']['address']) send_tx.set_recipient_address(transaction_senders['ETH_7']['address'])
send_tx.next_button.click() send_tx.next_button.click()
send_tx.set_up_wallet_when_sending_tx() send_tx.set_up_wallet_when_sending_tx()
send_tx.advanced_button.click() send_tx.advanced_button.click()
send_tx.nonce_input.set_value('0') send_tx.nonce_input.send_keys('0')
send_tx.nonce_save_button.click() send_tx.nonce_save_button.click()
error_text = send_tx.sign_transaction(error=True) error_text = send_tx.sign_transaction(error=True)
if error_text != 'nonce too low': if error_text != 'nonce too low':
@ -836,7 +836,7 @@ class TestChatManagement(SingleDeviceTestCase):
dapp = profile.connect_existing_ens(ens_main) dapp = profile.connect_existing_ens(ens_main)
profile.element_by_translation_id("ens-add-username").wait_and_click() profile.element_by_translation_id("ens-add-username").wait_and_click()
dapp.ens_name_input.set_value(ens_second) dapp.ens_name_input.send_keys(ens_second)
dapp.check_ens_name.click_until_presence_of_element(dapp.element_by_translation_id("ens-got-it")) dapp.check_ens_name.click_until_presence_of_element(dapp.element_by_translation_id("ens-got-it"))
dapp.element_by_translation_id("ens-got-it").wait_and_click() dapp.element_by_translation_id("ens-got-it").wait_and_click()
@ -909,12 +909,12 @@ class TestChatManagement(SingleDeviceTestCase):
profile.submit_bug_button.click() profile.submit_bug_button.click()
signin.just_fyi("Checking bug submitting form") signin.just_fyi("Checking bug submitting form")
profile.bug_description_edit_box.set_value('1234') profile.bug_description_edit_box.send_keys('1234')
profile.bug_submit_button.click() profile.bug_submit_button.click()
if not profile.element_by_translation_id("bug-report-too-short-description").is_element_displayed(): if not profile.element_by_translation_id("bug-report-too-short-description").is_element_displayed():
self.errors.append("Can submit big with too short description!") self.errors.append("Can submit big with too short description!")
profile.bug_description_edit_box.clear() profile.bug_description_edit_box.clear()
[field.set_value("Something wrong happened!!") for field in [field.send_keys("Something wrong happened!!") for field in
(profile.bug_description_edit_box, profile.bug_steps_edit_box)] (profile.bug_description_edit_box, profile.bug_steps_edit_box)]
profile.bug_submit_button.click() profile.bug_submit_button.click()
if not profile.element_by_text_part("Welcome to Gmail").is_element_displayed(30): if not profile.element_by_text_part("Welcome to Gmail").is_element_displayed(30):
@ -978,9 +978,9 @@ class TestChatManagement(SingleDeviceTestCase):
sign_in.generate_new_key_button.click() sign_in.generate_new_key_button.click()
sign_in.next_button.click() sign_in.next_button.click()
sign_in.next_button.click() sign_in.next_button.click()
sign_in.create_password_input.set_value(common_password) sign_in.create_password_input.send_keys(common_password)
sign_in.next_button.click() sign_in.next_button.click()
sign_in.confirm_your_password_input.set_value(common_password) sign_in.confirm_your_password_input.send_keys(common_password)
sign_in.next_button.click() sign_in.next_button.click()
sign_in.maybe_later_button.click_until_presence_of_element(sign_in.start_button) sign_in.maybe_later_button.click_until_presence_of_element(sign_in.start_button)
sign_in.start_button.click() sign_in.start_button.click()
@ -995,7 +995,7 @@ class TestChatManagement(SingleDeviceTestCase):
profile.delete_profile_button.click() profile.delete_profile_button.click()
if profile.element_by_translation_id("profile-deleted-title").is_element_displayed(): if profile.element_by_translation_id("profile-deleted-title").is_element_displayed():
self.driver.fail('Profile is deleted without confirmation with password') self.driver.fail('Profile is deleted without confirmation with password')
profile.delete_my_profile_password_input.set_value(common_password) profile.delete_my_profile_password_input.send_keys(common_password)
profile.delete_profile_button.click_until_presence_of_element( profile.delete_profile_button.click_until_presence_of_element(
profile.element_by_translation_id("profile-deleted-title")) profile.element_by_translation_id("profile-deleted-title"))
profile.ok_button.click() profile.ok_button.click()
@ -1005,7 +1005,7 @@ class TestChatManagement(SingleDeviceTestCase):
sign_in.profile_button.click() sign_in.profile_button.click()
profile.privacy_and_security_button.click() profile.privacy_and_security_button.click()
profile.delete_my_profile_button.scroll_and_click() profile.delete_my_profile_button.scroll_and_click()
profile.delete_my_profile_password_input.set_value(common_password) profile.delete_my_profile_password_input.send_keys(common_password)
profile.delete_profile_button.click() profile.delete_profile_button.click()
profile.ok_button.click() profile.ok_button.click()
if not sign_in.get_started_button.is_element_displayed(20): if not sign_in.get_started_button.is_element_displayed(20):
@ -1101,7 +1101,7 @@ class TestChatManagement(SingleDeviceTestCase):
profile = home_view.profile_button.click() profile = home_view.profile_button.click()
profile.privacy_and_security_button.click() profile.privacy_and_security_button.click()
profile.delete_my_profile_button.scroll_and_click() profile.delete_my_profile_button.scroll_and_click()
profile.delete_my_profile_password_input.set_value(unique_password) profile.delete_my_profile_password_input.send_keys(unique_password)
profile.delete_profile_button.click() profile.delete_profile_button.click()
profile.ok_button.click() profile.ok_button.click()
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -1125,7 +1125,7 @@ class TestChatManagement(SingleDeviceTestCase):
self.profile.ens_usernames_button.wait_and_click() self.profile.ens_usernames_button.wait_and_click()
self.dapp = self.home.get_dapp_view() self.dapp = self.home.get_dapp_view()
self.dapp.get_started_ens.click() self.dapp.get_started_ens.click()
self.dapp.ens_name_input.set_value(self.ens_name) self.dapp.ens_name_input.send_keys(self.ens_name)
self.dapp.check_ens_name.click_until_presence_of_element(self.dapp.register_ens_button) self.dapp.check_ens_name.click_until_presence_of_element(self.dapp.register_ens_button)
self.dapp.agree_on_terms_ens.scroll_and_click() self.dapp.agree_on_terms_ens.scroll_and_click()
if not self.dapp.element_by_text(self.chat_key).is_element_displayed(): if not self.dapp.element_by_text(self.chat_key).is_element_displayed():

View File

@ -58,7 +58,7 @@ class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
amount = chat.get_unique_amount() amount = chat.get_unique_amount()
send_message = chat.send_command.click() send_message = chat.send_command.click()
send_message.amount_edit_box.set_value(amount) send_message.amount_edit_box.send_keys(amount)
send_message.confirm() send_message.confirm()
send_message.next_button.click() send_message.next_button.click()
@ -118,8 +118,8 @@ class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
keycard = profile.change_pairing_code_button.click() keycard = profile.change_pairing_code_button.click()
keycard.enter_default_pin() keycard.enter_default_pin()
self.sign_in.create_password_input.wait_for_element() self.sign_in.create_password_input.wait_for_element()
self.sign_in.create_password_input.set_value(common_password) self.sign_in.create_password_input.send_keys(common_password)
self.sign_in.confirm_your_password_input.set_value(common_password + "1") self.sign_in.confirm_your_password_input.send_keys(common_password + "1")
if not keycard.element_by_translation_id("pairing-code_error1").is_element_displayed(): if not keycard.element_by_translation_id("pairing-code_error1").is_element_displayed():
self.errors.append("No error is shown when pairing codes don't match") self.errors.append("No error is shown when pairing codes don't match")
self.sign_in.confirm_your_password_input.delete_last_symbols(1) self.sign_in.confirm_your_password_input.delete_last_symbols(1)
@ -138,7 +138,7 @@ class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.home.just_fyi("Checking backing up keycard") self.home.just_fyi("Checking backing up keycard")
profile.create_keycard_backup_button.scroll_to_element() profile.create_keycard_backup_button.scroll_to_element()
keycard = profile.create_keycard_backup_button.click() keycard = profile.create_keycard_backup_button.click()
self.sign_in.seedphrase_input.set_value(self.user['passphrase']) self.sign_in.seedphrase_input.send_keys(self.user['passphrase'])
self.sign_in.next_button.click() self.sign_in.next_button.click()
keycard.return_card_to_factory_settings_checkbox.enable() keycard.return_card_to_factory_settings_checkbox.enable()
keycard.begin_setup_button.click() keycard.begin_setup_button.click()
@ -159,9 +159,9 @@ class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.sign_in.generate_new_key_button.click() self.sign_in.generate_new_key_button.click()
self.sign_in.next_button.click() self.sign_in.next_button.click()
self.sign_in.next_button.click() self.sign_in.next_button.click()
self.sign_in.create_password_input.set_value(common_password) self.sign_in.create_password_input.send_keys(common_password)
self.sign_in.next_button.click() self.sign_in.next_button.click()
self.sign_in.confirm_your_password_input.set_value(common_password) self.sign_in.confirm_your_password_input.send_keys(common_password)
self.sign_in.next_button.click() self.sign_in.next_button.click()
self.sign_in.maybe_later_button.click_until_presence_of_element(self.sign_in.start_button) self.sign_in.maybe_later_button.click_until_presence_of_element(self.sign_in.start_button)
self.sign_in.start_button.click() self.sign_in.start_button.click()
@ -173,7 +173,7 @@ class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
wallet.enter_your_password_input.send_keys(common_password) wallet.enter_your_password_input.send_keys(common_password)
account_name = 'subacc' account_name = 'subacc'
wallet.account_name_input.send_keys(account_name) wallet.account_name_input.send_keys(account_name)
wallet.enter_seed_phrase_input.set_value(self.user['passphrase']) wallet.enter_seed_phrase_input.send_keys(self.user['passphrase'])
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
wallet.get_account_by_name(account_name).click() wallet.get_account_by_name(account_name).click()
@ -404,7 +404,7 @@ class TestWalletTestDappMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase
self.wallet.toggle_airplane_mode() self.wallet.toggle_airplane_mode()
send_transaction = self.wallet.send_transaction_from_main_screen.click() send_transaction = self.wallet.send_transaction_from_main_screen.click()
send_transaction.set_recipient_address('0x%s' % basic_user['address']) send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.amount_edit_box.set_value("0") send_transaction.amount_edit_box.send_keys("0")
send_transaction.confirm() send_transaction.confirm()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
if send_transaction.sign_with_password.is_element_displayed(): if send_transaction.sign_with_password.is_element_displayed():

View File

@ -367,10 +367,6 @@ class EditBox(BaseElement):
self.find_element().send_keys(value) self.find_element().send_keys(value)
self.driver.info("Type `%s` to `%s`" % (self.exclude_emoji(value), self.name)) self.driver.info("Type `%s` to `%s`" % (self.exclude_emoji(value), self.name))
def set_value(self, value):
self.find_element().set_value(value)
self.driver.info("Set `%s` value for `%s`" % (self.exclude_emoji(value), self.name))
def clear(self): def clear(self):
self.find_element().clear() self.find_element().clear()
self.driver.info("Clear text in `%s`" % self.name) self.driver.info("Clear text in `%s`" % self.name)

View File

@ -11,6 +11,7 @@ from selenium.common.exceptions import NoSuchElementException, TimeoutException
from selenium.webdriver.support import expected_conditions from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support.wait import WebDriverWait
from base_test_case import app_package
from support.device_apps import start_web_browser from support.device_apps import start_web_browser
from tests import common_password, pytest_config_global, transl from tests import common_password, pytest_config_global, transl
from views.base_element import Button, BaseElement, EditBox, Text, CheckBox from views.base_element import Button, BaseElement, EditBox, Text, CheckBox
@ -196,7 +197,7 @@ class EnterQRcodeEditBox(EditBox):
super().__init__(driver, translation_id="type-a-message") super().__init__(driver, translation_id="type-a-message")
def scan_qr(self, value): def scan_qr(self, value):
self.set_value(value) self.send_keys(value)
base_view = BaseView(self.driver) base_view = BaseView(self.driver)
base_view.ok_button.click() base_view.ok_button.click()
@ -643,8 +644,8 @@ class BaseView(object):
self.element_by_text(text).click() self.element_by_text(text).click()
def reopen_app(self, password=common_password, sign_in=True): def reopen_app(self, password=common_password, sign_in=True):
self.driver.close_app() self.driver.terminate_app(app_package)
self.driver.launch_app() self.driver.activate_app(app_package)
if sign_in: if sign_in:
sign_in_view = self.get_sign_in_view() sign_in_view = self.get_sign_in_view()
sign_in_view.sign_in(password) sign_in_view.sign_in(password)
@ -745,7 +746,7 @@ class BaseView(object):
def upgrade_app(self): def upgrade_app(self):
self.driver.info("Upgrading apk to apk_upgrade") self.driver.info("Upgrading apk to apk_upgrade")
self.driver.install_app(pytest_config_global['apk_upgrade'], replace=True) self.driver.install_app(pytest_config_global['apk_upgrade'], replace=True)
self.app = self.driver.launch_app() self.app = self.driver.activate_app(app_package)
def search_by_keyword(self, keyword): def search_by_keyword(self, keyword):
self.driver.info('Search for `%s`' % keyword) self.driver.info('Search for `%s`' % keyword)

View File

@ -417,7 +417,7 @@ class CommunityView(HomeView):
self.driver.info("Joining community") self.driver.info("Joining community")
self.join_button.click() self.join_button.click()
self.join_community_button.scroll_and_click() self.join_community_button.scroll_and_click()
self.password_input.set_value(password) self.password_input.send_keys(password)
Button(self.driver, Button(self.driver,
xpath="//*[@content-desc='password-input']/../following-sibling::*//*[@text='Join Community']").click() xpath="//*[@content-desc='password-input']/../following-sibling::*//*[@text='Join Community']").click()
if open_community: if open_community:
@ -432,8 +432,8 @@ class CommunityView(HomeView):
self.driver.info("Adding channel in community") self.driver.info("Adding channel in community")
self.plus_button.click() self.plus_button.click()
self.community_create_a_channel_button.wait_and_click() self.community_create_a_channel_button.wait_and_click()
self.channel_name_edit_box.set_value(name) self.channel_name_edit_box.send_keys(name)
self.channel_descripton.set_value(description) self.channel_descripton.send_keys(description)
chat_view = ChatView(self.driver) chat_view = ChatView(self.driver)
chat_view.confirm_create_in_community_button.click() chat_view.confirm_create_in_community_button.click()
self.get_chat(name).click() self.get_chat(name).click()
@ -930,7 +930,7 @@ class ChatView(BaseView):
self.chat_options.click() self.chat_options.click()
self.group_info.click() self.group_info.click()
self.edit_group_chat_name_button.click() self.edit_group_chat_name_button.click()
self.edit_group_chat_name_edit_box.set_value(new_chat_name) self.edit_group_chat_name_edit_box.send_keys(new_chat_name)
self.done_button.click() self.done_button.click()
def get_group_invite_via_group_info(self): def get_group_invite_via_group_info(self):
@ -942,7 +942,7 @@ class ChatView(BaseView):
def request_membership_for_group_chat(self, intro_message): def request_membership_for_group_chat(self, intro_message):
self.driver.info("Requesting membership to group chat") self.driver.info("Requesting membership to group chat")
self.introduce_yourself_edit_box.set_value(intro_message) self.introduce_yourself_edit_box.send_keys(intro_message)
self.request_membership_button.click_until_presence_of_element(self.element_by_text('Request pending…')) self.request_membership_button.click_until_presence_of_element(self.element_by_text('Request pending…'))
def get_username_checkbox(self, username: str, state_on=False): def get_username_checkbox(self, username: str, state_on=False):
@ -1133,7 +1133,7 @@ class ChatView(BaseView):
def select_mention_from_suggestion_list(self, username_in_list, typed_search_pattern=''): def select_mention_from_suggestion_list(self, username_in_list, typed_search_pattern=''):
self.driver.info("Selecting '%s' from suggestion list by '%s'" % (username_in_list, typed_search_pattern)) self.driver.info("Selecting '%s' from suggestion list by '%s'" % (username_in_list, typed_search_pattern))
self.chat_message_input.set_value('@' + typed_search_pattern) self.chat_message_input.send_keys('@' + typed_search_pattern)
self.chat_message_input.click() self.chat_message_input.click()
self.search_user_in_mention_suggestion_list(username_in_list).wait_for_visibility_of_element(10).click() self.search_user_in_mention_suggestion_list(username_in_list).wait_for_visibility_of_element(10).click()
@ -1203,8 +1203,8 @@ class ChatView(BaseView):
def mention_user(self, user_name: str): def mention_user(self, user_name: str):
self.driver.info("Mention user %s in the chat" % user_name) self.driver.info("Mention user %s in the chat" % user_name)
gboard = self.driver.available_ime_engines[0] # gboard = self.driver.available_ime_engines[0]
self.driver.activate_ime_engine(gboard) # workaround to get mentions list expanded # self.driver.activate_ime_engine(gboard) # workaround to get mentions list expanded
self.chat_message_input.click_inside() self.chat_message_input.click_inside()
self.chat_message_input.send_keys("@") self.chat_message_input.send_keys("@")
try: try:

View File

@ -67,7 +67,7 @@ class DappsView(BaseView):
web_view.open_new_tab_plus_button.click_if_shown() web_view.open_new_tab_plus_button.click_if_shown()
self.enter_url_editbox.wait_for_visibility_of_element(20) self.enter_url_editbox.wait_for_visibility_of_element(20)
self.enter_url_editbox.click() self.enter_url_editbox.click()
self.enter_url_editbox.set_value(url) self.enter_url_editbox.send_keys(url)
self.confirm() self.confirm()
from views.web_views.base_web_view import BaseWebView from views.web_views.base_web_view import BaseWebView
BaseWebView(self.driver).wait_for_d_aap_to_load() BaseWebView(self.driver).wait_for_d_aap_to_load()

View File

@ -431,8 +431,8 @@ class HomeView(BaseView):
self.driver.info("## Creating community '%s', set image is set to '%s'" % (name, str(set_image)), device=False) self.driver.info("## Creating community '%s', set image is set to '%s'" % (name, str(set_image)), device=False)
self.plus_community_button.click() self.plus_community_button.click()
chat_view = self.communities_button.click() chat_view = self.communities_button.click()
chat_view.community_name_edit_box.set_value(name) chat_view.community_name_edit_box.send_keys(name)
chat_view.community_description_edit_box.set_value(description) chat_view.community_description_edit_box.send_keys(description)
if set_image: if set_image:
from views.profile_view import ProfileView from views.profile_view import ProfileView
set_picture_view = ProfileView(self.driver) set_picture_view = ProfileView(self.driver)
@ -468,7 +468,7 @@ class HomeView(BaseView):
chat_view = self.communities_button.click() chat_view = self.communities_button.click()
chat_view.chat_options.click() chat_view.chat_options.click()
chat_view.element_by_translation_id("import-community").wait_and_click() chat_view.element_by_translation_id("import-community").wait_and_click()
EditBox(self.driver, xpath="//android.widget.EditText").set_value(key) EditBox(self.driver, xpath="//android.widget.EditText").send_keys(key)
import_button.click_until_absense_of_element(import_button) import_button.click_until_absense_of_element(import_button)
def join_public_chat(self, chat_name: str): def join_public_chat(self, chat_name: str):

View File

@ -62,7 +62,7 @@ class KeycardView(BaseView):
self.yes_button.click() self.yes_button.click()
for _ in range(2): for _ in range(2):
number = self.get_required_word_number() number = self.get_required_word_number()
self.confirm_seed_phrase_edit_box.set_value(recovery_phrase[number]) self.confirm_seed_phrase_edit_box.send_keys(recovery_phrase[number])
self.next_button.click() self.next_button.click()
return ' '.join(recovery_phrase.values()) return ' '.join(recovery_phrase.values())

View File

@ -385,12 +385,12 @@ class ProfileView(BaseView):
self.network_settings_button.scroll_to_element() self.network_settings_button.scroll_to_element()
self.network_settings_button.click() self.network_settings_button.click()
self.plus_button.click_until_presence_of_element(self.custom_chain_button) self.plus_button.click_until_presence_of_element(self.custom_chain_button)
self.custom_network_url_input.set_value(rpc_url) self.custom_network_url_input.send_keys(rpc_url)
self.specify_name_input.set_value(name) self.specify_name_input.send_keys(name)
self.custom_network_symbol_input.set_value(symbol) self.custom_network_symbol_input.send_keys(symbol)
self.custom_chain_button.scroll_and_click() self.custom_chain_button.scroll_and_click()
self.specify_network_id_input.scroll_to_element() self.specify_network_id_input.scroll_to_element()
self.specify_network_id_input.set_value(netwrok_id) self.specify_network_id_input.send_keys(netwrok_id)
self.save_button.click() self.save_button.click()
self.element_by_text_part(name).scroll_to_element() self.element_by_text_part(name).scroll_to_element()
self.element_by_text_part(name).click_until_presence_of_element(self.connect_button) self.element_by_text_part(name).click_until_presence_of_element(self.connect_button)
@ -409,10 +409,10 @@ class ProfileView(BaseView):
recovery_phrase = self.get_recovery_phrase() recovery_phrase = self.get_recovery_phrase()
self.next_button.click() self.next_button.click()
word_number = self.recovery_phrase_word_number.number word_number = self.recovery_phrase_word_number.number
self.recovery_phrase_word_input.set_value(recovery_phrase[word_number]) self.recovery_phrase_word_input.send_keys(recovery_phrase[word_number])
self.next_button.click() self.next_button.click()
word_number_1 = self.recovery_phrase_word_number.number word_number_1 = self.recovery_phrase_word_number.number
self.recovery_phrase_word_input.set_value(recovery_phrase[word_number_1]) self.recovery_phrase_word_input.send_keys(recovery_phrase[word_number_1])
self.done_button.click() self.done_button.click()
self.yes_button.click() self.yes_button.click()
self.ok_got_it_button.click() self.ok_got_it_button.click()
@ -480,7 +480,7 @@ class ProfileView(BaseView):
self.sync_settings_button.click() self.sync_settings_button.click()
self.devices_button.scroll_to_element() self.devices_button.scroll_to_element()
self.devices_button.click() self.devices_button.click()
self.device_name_input.set_value(device_name) self.device_name_input.send_keys(device_name)
self.continue_button.click_until_presence_of_element(self.advertise_device_button, 2) self.continue_button.click_until_presence_of_element(self.advertise_device_button, 2)
self.advertise_device_button.click() self.advertise_device_button.click()
@ -501,7 +501,7 @@ class ProfileView(BaseView):
dapp_view.element_by_translation_id("get-started").click() dapp_view.element_by_translation_id("get-started").click()
if not is_stateofus: if not is_stateofus:
dapp_view.element_by_translation_id("ens-want-custom-domain").click() dapp_view.element_by_translation_id("ens-want-custom-domain").click()
dapp_view.ens_name_input.set_value(name) dapp_view.ens_name_input.send_keys(name)
expected_text = dapp_view.get_translation_by_key("ens-username-connected") expected_text = dapp_view.get_translation_by_key("ens-username-connected")
if not dapp_view.element_by_text_part(expected_text).is_element_displayed(): if not dapp_view.element_by_text_part(expected_text).is_element_displayed():
dapp_view.click_system_back_button() dapp_view.click_system_back_button()

View File

@ -8,8 +8,8 @@ class AmountEditBox(EditBox, Button):
def __init__(self, driver): def __init__(self, driver):
super(AmountEditBox, self).__init__(driver, accessibility_id="amount-input") super(AmountEditBox, self).__init__(driver, accessibility_id="amount-input")
def set_value(self, value): def send_keys(self, value):
EditBox.set_value(self, value) EditBox.send_keys(self, value)
self.driver.press_keycode(66) self.driver.press_keycode(66)
@ -130,7 +130,7 @@ class SendTransactionView(BaseView):
def set_recipient_address(self, address): def set_recipient_address(self, address):
self.driver.info("Setting recipient address to '%s'" % address) self.driver.info("Setting recipient address to '%s'" % address)
self.chose_recipient_button.click() self.chose_recipient_button.click()
self.enter_recipient_address_input.set_value(address) self.enter_recipient_address_input.send_keys(address)
self.enter_recipient_address_input.click() self.enter_recipient_address_input.click()
self.done_button.click_until_absense_of_element(self.done_button) self.done_button.click_until_absense_of_element(self.done_button)
@ -189,5 +189,5 @@ class SendTransactionView(BaseView):
def add_to_favorites(self, name): def add_to_favorites(self, name):
self.driver.info("Adding '%s' to favorite recipients" % name) self.driver.info("Adding '%s' to favorite recipients" % name)
self.recipient_add_to_favorites.click() self.recipient_add_to_favorites.click()
self.new_favorite_name_input.set_value(name) self.new_favorite_name_input.send_keys(name)
self.new_favorite_add_favorite.click() self.new_favorite_add_favorite.click()

View File

@ -206,7 +206,7 @@ class SignInView(BaseView):
self.remove_profile_button = Button(self.driver, accessibility_id="remove-profile") self.remove_profile_button = Button(self.driver, accessibility_id="remove-profile")
def set_password(self, password: str): def set_password(self, password: str):
self.profile_password_edit_box.set_value(password) self.profile_password_edit_box.send_keys(password)
self.profile_repeat_password_edit_box.click() self.profile_repeat_password_edit_box.click()
self.profile_repeat_password_edit_box.send_keys(password) self.profile_repeat_password_edit_box.send_keys(password)
self.checkbox_button.scroll_to_element() self.checkbox_button.scroll_to_element()
@ -214,7 +214,7 @@ class SignInView(BaseView):
self.profile_confirm_password_button.click() self.profile_confirm_password_button.click()
def set_profile(self, username: str, set_image=False): def set_profile(self, username: str, set_image=False):
self.profile_your_name_edit_box.set_value(username) self.profile_your_name_edit_box.send_keys(username)
self.profile_continue_button.click_until_presence_of_element(self.profile_password_edit_box) self.profile_continue_button.click_until_presence_of_element(self.profile_password_edit_box)
if set_image: if set_image:
pass pass
@ -242,8 +242,8 @@ class SignInView(BaseView):
# keycard_flow.backup_seed_phrase() # keycard_flow.backup_seed_phrase()
# else: # else:
# self.next_button.click() # self.next_button.click()
# self.create_password_input.set_value(password) # self.create_password_input.send_keys(password)
# self.confirm_your_password_input.set_value(password) # self.confirm_your_password_input.send_keys(password)
# self.next_button.click() # self.next_button.click()
self.identifiers_button.wait_and_click(30) self.identifiers_button.wait_and_click(30)
if enable_notifications: if enable_notifications:
@ -266,7 +266,7 @@ class SignInView(BaseView):
self.plus_profiles_button.click() self.plus_profiles_button.click()
self.create_new_profile_button.click() self.create_new_profile_button.click()
self.use_recovery_phrase_button.click() self.use_recovery_phrase_button.click()
self.passphrase_edit_box.set_value(passphrase) self.passphrase_edit_box.send_keys(passphrase)
self.continue_button.click_until_presence_of_element(self.profile_your_name_edit_box) self.continue_button.click_until_presence_of_element(self.profile_your_name_edit_box)
self.set_profile(username, set_image) self.set_profile(username, set_image)
self.set_password(password) self.set_password(password)
@ -293,7 +293,7 @@ class SignInView(BaseView):
if keycard_view.connect_selected_card_button.is_element_displayed(): if keycard_view.connect_selected_card_button.is_element_displayed():
keycard_view.connect_selected_card_button.click() keycard_view.connect_selected_card_button.click()
else: else:
self.password_input.set_value(password) self.password_input.send_keys(password)
self.login_button.click() self.login_button.click()
self.driver.info("## Signed in successfully!", device=False) self.driver.info("## Signed in successfully!", device=False)
return self.get_home_view() return self.get_home_view()
@ -321,7 +321,7 @@ class SignInView(BaseView):
profile.logout() profile.logout()
self.multi_account_on_login_button.wait_for_visibility_of_element(30) self.multi_account_on_login_button.wait_for_visibility_of_element(30)
self.get_multiaccount_by_position(1).click() self.get_multiaccount_by_position(1).click()
self.password_input.set_value(password) self.password_input.send_keys(password)
self.driver.push_file(source_path=full_path_to_file, self.driver.push_file(source_path=full_path_to_file,
destination_path='%s%s' % (get_app_path(), import_file_name)) destination_path='%s%s' % (get_app_path(), import_file_name))
self.options_button.click() self.options_button.click()
@ -340,7 +340,7 @@ class SignInView(BaseView):
profile.logout() profile.logout()
self.multi_account_on_login_button.wait_for_visibility_of_element(30) self.multi_account_on_login_button.wait_for_visibility_of_element(30)
self.get_multiaccount_by_position(1).click() self.get_multiaccount_by_position(1).click()
self.password_input.set_value(common_password) self.password_input.send_keys(common_password)
self.options_button.click() self.options_button.click()
self.element_by_text('Export unencrypted').wait_and_click(40) self.element_by_text('Export unencrypted').wait_and_click(40)
self.element_by_text('Export unencrypted').wait_for_invisibility_of_element(40) self.element_by_text('Export unencrypted').wait_for_invisibility_of_element(40)

View File

@ -315,7 +315,7 @@ class WalletView(BaseView):
transaction_amount = str(kwargs.get('amount', send_tx.get_unique_amount())) transaction_amount = str(kwargs.get('amount', send_tx.get_unique_amount()))
send_tx.amount_edit_box.set_value(transaction_amount) send_tx.amount_edit_box.send_keys(transaction_amount)
if kwargs.get('account_name'): if kwargs.get('account_name'):
send_tx.chose_recipient_button.click() send_tx.chose_recipient_button.click()
send_tx.accounts_button.click() send_tx.accounts_button.click()