mirror of
https://github.com/status-im/status-react.git
synced 2025-01-10 19:16:59 +00:00
New e2e tests and fix
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
cbe17cbe02
commit
c0945c41d6
@ -123,3 +123,14 @@ class TestBrowsing(SingleDeviceTestCase):
|
||||
status_test_dapp.find_full_text('Sign message')
|
||||
status_test_dapp.browser_refresh_page_button.click()
|
||||
status_test_dapp.find_full_text('defaultAccount')
|
||||
|
||||
@marks.testrail_id(5785)
|
||||
@marks.critical
|
||||
def test_can_open_dapp_from_dapp_store(self):
|
||||
sign_in = SignInView(self.driver)
|
||||
home = sign_in.create_user()
|
||||
daap_view = home.dapp_tab_button.click()
|
||||
dapp_store_view = daap_view.discover_dapps_button.click()
|
||||
dapp_store_view.element_by_text_part("CryptoKitties").click()
|
||||
if not dapp_store_view.element_by_text_part("Start", "text").is_element_displayed(20):
|
||||
self.driver.fail("Failed to access CryptoKitties Dapp from Discover Dapp store")
|
||||
|
@ -368,7 +368,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
send_transaction.sign_with_password.click_until_presence_of_element(send_transaction.enter_password_input)
|
||||
send_transaction.enter_password_input.send_keys(common_password)
|
||||
send_transaction.sign_button.click()
|
||||
send_transaction.element_by_text('intrinsic gas too low', 'text').wait_for_visibility_of_element(20)
|
||||
send_transaction.element_by_text('intrinsic gas too low', 'text').wait_for_visibility_of_element(40)
|
||||
send_transaction.ok_button.click()
|
||||
|
||||
send_transaction.sign_transaction_button.click()
|
||||
@ -426,6 +426,28 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
if not wallet_view.find_text_part('EUR'):
|
||||
self.driver.fail('EUR currency is not displayed')
|
||||
|
||||
@marks.testrail_id(5407)
|
||||
@marks.medium
|
||||
def test_cant_send_transaction_in_offline_mode(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
sign_in_view.create_user()
|
||||
wallet_view = sign_in_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
wallet_view.accounts_status_account.click()
|
||||
send_transaction = wallet_view.send_transaction_button.click()
|
||||
send_transaction.chose_recipient_button.click()
|
||||
send_transaction.accounts_button.click()
|
||||
send_transaction.element_by_text("Status account").click()
|
||||
send_transaction.amount_edit_box.click()
|
||||
send_transaction.amount_edit_box.set_value("0")
|
||||
send_transaction.confirm()
|
||||
send_transaction.sign_transaction_button.click()
|
||||
send_transaction.cancel_button.click()
|
||||
send_transaction.toggle_airplane_mode()
|
||||
send_transaction.sign_transaction_button.click()
|
||||
if send_transaction.sign_with_password.is_element_displayed():
|
||||
self.driver.fail("Sign transaction button is active in offline mode")
|
||||
|
||||
@marks.testrail_id(6225)
|
||||
@marks.high
|
||||
def test_send_funds_between_accounts_in_multiaccount_instance(self):
|
||||
|
@ -17,7 +17,6 @@ from support.github_report import GithubHtmlReport
|
||||
from support.message_reliability_report import create_one_to_one_chat_report, create_public_chat_report
|
||||
from tests import test_suite_data, start_threads, appium_container
|
||||
|
||||
|
||||
class AbstractTestCase:
|
||||
__metaclass__ = ABCMeta
|
||||
|
||||
@ -247,11 +246,10 @@ class SauceMultipleDeviceTestCase(AbstractTestCase):
|
||||
cls.loop.close()
|
||||
|
||||
|
||||
environment = LocalMultipleDeviceTestCase if pytest.config.getoption('env') == 'local' else SauceMultipleDeviceTestCase
|
||||
|
||||
|
||||
class MultipleDeviceTestCase(environment):
|
||||
pass
|
||||
if pytest.config.getoption('env') == 'local':
|
||||
MultipleDeviceTestCase = LocalMultipleDeviceTestCase
|
||||
else:
|
||||
MultipleDeviceTestCase = SauceMultipleDeviceTestCase
|
||||
|
||||
|
||||
class NoDeviceTestCase(AbstractTestCase):
|
||||
|
@ -3,22 +3,20 @@ from views.base_view import BaseView
|
||||
from views.home_view import ChatElement
|
||||
|
||||
|
||||
|
||||
class OpenDAppButton(BaseButton):
|
||||
class DiscoverDappsButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(OpenDAppButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('open-dapp-button')
|
||||
|
||||
|
||||
class OpenButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(OpenButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('open-dapp-button')
|
||||
super(DiscoverDappsButton, self).__init__(driver)
|
||||
self.locator = self.Locator.text_selector('Discover ÐApps')
|
||||
|
||||
def navigate(self):
|
||||
from views.web_views.base_web_view import BaseWebView
|
||||
return BaseWebView(self.driver)
|
||||
|
||||
def click(self):
|
||||
from views.web_views.base_web_view import BrowserRefreshPageButton
|
||||
self.click_until_presence_of_element(BrowserRefreshPageButton(self.driver))
|
||||
return self.navigate()
|
||||
|
||||
|
||||
class EnterUrlEditbox(BaseEditBox):
|
||||
def __init__(self, driver):
|
||||
@ -72,9 +70,8 @@ class DappsView(BaseView):
|
||||
def __init__(self, driver):
|
||||
super(DappsView, self).__init__(driver)
|
||||
|
||||
self.open_d_app_button = OpenDAppButton(self.driver)
|
||||
self.open_button = OpenButton(self.driver)
|
||||
self.enter_url_editbox = EnterUrlEditbox(self.driver)
|
||||
self.discover_dapps_button = DiscoverDappsButton(self.driver)
|
||||
|
||||
#ens dapp
|
||||
self.ens_name = EnsName(self.driver)
|
||||
|
@ -236,6 +236,11 @@ class SendTransactionButton(BaseButton):
|
||||
from views.send_transaction_view import SendTransactionView
|
||||
return SendTransactionView(self.driver)
|
||||
|
||||
def click(self):
|
||||
self.find_element().click()
|
||||
self.driver.info('Tap on %s' % self.name)
|
||||
return self.navigate()
|
||||
|
||||
|
||||
class ReceiveTransactionButton(BaseButton):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user