2018-05-14 14:56:21 +00:00
|
|
|
from views.web_views.base_web_view import BaseWebView, BaseButton
|
|
|
|
|
|
|
|
|
|
|
|
class AssetsButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AssetsButton, self).__init__(driver)
|
2018-10-19 14:16:29 +00:00
|
|
|
self.locator = self.Locator.webview_selector('Assets')
|
2018-05-14 14:56:21 +00:00
|
|
|
|
2018-07-23 11:38:47 +00:00
|
|
|
class RequestETHButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AssetsButton.RequestETHButton, self).__init__(driver)
|
2018-11-07 11:57:13 +00:00
|
|
|
self.locator = self.Locator.webview_selector('Request Ropsten ETH')
|
2018-07-23 11:38:47 +00:00
|
|
|
|
2018-05-14 14:56:21 +00:00
|
|
|
class RequestSTTButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AssetsButton.RequestSTTButton, self).__init__(driver)
|
2018-10-19 14:16:29 +00:00
|
|
|
self.locator = self.Locator.webview_selector('Request STT')
|
2018-05-14 14:56:21 +00:00
|
|
|
|
2018-06-04 10:31:45 +00:00
|
|
|
def navigate(self):
|
|
|
|
from views.send_transaction_view import SendTransactionView
|
|
|
|
return SendTransactionView(self.driver)
|
|
|
|
|
|
|
|
|
|
|
|
class TransactionsButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(TransactionsButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Transactions')
|
|
|
|
|
|
|
|
class SignMessageButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(TransactionsButton.SignMessageButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Sign message')
|
|
|
|
|
|
|
|
def navigate(self):
|
|
|
|
from views.send_transaction_view import SendTransactionView
|
|
|
|
return SendTransactionView(self.driver)
|
|
|
|
|
2018-07-13 10:56:36 +00:00
|
|
|
class DeployContractButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(TransactionsButton.DeployContractButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Deploy simple contract')
|
|
|
|
|
|
|
|
def navigate(self):
|
|
|
|
from views.send_transaction_view import SendTransactionView
|
|
|
|
return SendTransactionView(self.driver)
|
|
|
|
|
|
|
|
class TestFiltersButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(TransactionsButton.TestFiltersButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Test filters')
|
|
|
|
|
2018-05-14 14:56:21 +00:00
|
|
|
|
2018-07-26 18:58:05 +00:00
|
|
|
class StatusAPIButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(StatusAPIButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Status API')
|
|
|
|
|
|
|
|
class RequestContactCodeButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(StatusAPIButton.RequestContactCodeButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_part_selector('Request contact code')
|
|
|
|
|
|
|
|
|
2018-05-25 17:29:07 +00:00
|
|
|
class StatusTestDAppView(BaseWebView):
|
2018-05-14 14:56:21 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-05-25 17:29:07 +00:00
|
|
|
super(StatusTestDAppView, self).__init__(driver)
|
2018-05-14 14:56:21 +00:00
|
|
|
self.driver = driver
|
|
|
|
|
|
|
|
self.assets_button = AssetsButton(self.driver)
|
2018-07-23 11:38:47 +00:00
|
|
|
self.request_eth_button = AssetsButton.RequestETHButton(self.driver)
|
2018-05-14 14:56:21 +00:00
|
|
|
self.request_stt_button = AssetsButton.RequestSTTButton(self.driver)
|
2018-06-04 10:31:45 +00:00
|
|
|
|
|
|
|
self.transactions_button = TransactionsButton(self.driver)
|
|
|
|
self.sign_message_button = TransactionsButton.SignMessageButton(self.driver)
|
2018-07-13 10:56:36 +00:00
|
|
|
self.deploy_contract_button = TransactionsButton.DeployContractButton(self.driver)
|
|
|
|
self.test_filters_button = TransactionsButton.TestFiltersButton(self.driver)
|
2018-07-26 18:58:05 +00:00
|
|
|
|
|
|
|
self.status_api_button = StatusAPIButton(self.driver)
|
|
|
|
self.request_contact_code_button = StatusAPIButton.RequestContactCodeButton(self.driver)
|
2018-11-07 13:09:23 +00:00
|
|
|
|
|
|
|
def wait_for_d_aap_to_load(self, wait_time=10):
|
|
|
|
self.assets_button.wait_for_visibility_of_element(seconds=wait_time)
|