2018-01-26 11:07:09 +00:00
|
|
|
import time
|
2018-05-02 16:01:17 +00:00
|
|
|
from tests.base_test_case import AbstractTestCase
|
|
|
|
from views.base_element import BaseText, BaseButton, BaseEditBox, BaseElement
|
2018-01-03 09:34:40 +00:00
|
|
|
from views.base_view import BaseView
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PublicKeyText(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(PublicKeyText, self).__init__(driver)
|
2019-08-14 16:05:04 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('chat-key')
|
2017-08-28 10:02:20 +00:00
|
|
|
|
2018-10-02 11:33:51 +00:00
|
|
|
|
|
|
|
class ProfileAddressText(BaseText):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ProfileAddressText, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('profile-public-key')
|
|
|
|
|
2017-10-11 20:10:57 +00:00
|
|
|
@property
|
|
|
|
def text(self):
|
|
|
|
text = self.scroll_to_element().text
|
2018-08-15 12:51:52 +00:00
|
|
|
self.driver.info('%s is %s' % (self.name, text))
|
2017-10-11 20:10:57 +00:00
|
|
|
return text
|
|
|
|
|
2017-08-28 10:02:20 +00:00
|
|
|
|
2017-10-30 11:11:58 +00:00
|
|
|
class OptionsButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(OptionsButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
'(//android.view.ViewGroup[@content-desc="icon"])[2]')
|
|
|
|
|
|
|
|
class UserStatusBox(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(OptionsButton.UserStatusBox, self).__init__(driver)
|
2018-01-26 11:07:09 +00:00
|
|
|
self.locator = self.Locator.xpath_selector('(//android.widget.ScrollView)[2]//android.widget.TextView')
|
2017-10-30 11:11:58 +00:00
|
|
|
|
|
|
|
class UsernameInput(BaseEditBox):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(OptionsButton.UsernameInput, self).__init__(driver)
|
2018-03-28 10:21:39 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('username-input')
|
2017-10-30 11:11:58 +00:00
|
|
|
|
|
|
|
class UserStatusInput(BaseEditBox):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(OptionsButton.UserStatusInput, self).__init__(driver)
|
2018-01-26 11:07:09 +00:00
|
|
|
self.locator = self.Locator.xpath_selector('(//android.widget.EditText)[2]')
|
2017-10-30 11:11:58 +00:00
|
|
|
|
|
|
|
|
2017-10-11 20:10:57 +00:00
|
|
|
class NetworkSettingsButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(NetworkSettingsButton, self).__init__(driver)
|
2018-03-15 20:01:08 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('network-button')
|
2017-10-11 20:10:57 +00:00
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
class NetworkButton(BaseButton):
|
|
|
|
def __init__(self, driver, network):
|
|
|
|
super(NetworkSettingsButton.NetworkButton, self).__init__(driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
self.locator = self.Locator.text_selector(network)
|
2017-10-11 20:10:57 +00:00
|
|
|
|
|
|
|
class ConnectButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(NetworkSettingsButton.ConnectButton, self).__init__(driver)
|
2018-03-15 20:01:08 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('network-connect-button')
|
2017-10-11 20:10:57 +00:00
|
|
|
|
|
|
|
|
2018-01-14 17:43:36 +00:00
|
|
|
class LogoutButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(LogoutButton, self).__init__(driver)
|
2018-03-28 10:21:39 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('log-out-button')
|
2018-01-14 17:43:36 +00:00
|
|
|
|
2018-08-20 10:02:37 +00:00
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
2018-08-29 12:14:36 +00:00
|
|
|
self.driver.info('Tap on %s' % self.name)
|
2018-08-20 10:02:37 +00:00
|
|
|
return self.navigate()
|
|
|
|
|
2018-05-02 16:01:17 +00:00
|
|
|
|
2018-04-26 06:22:11 +00:00
|
|
|
class LogoutDialog(BaseView):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(LogoutDialog, self).__init__(driver)
|
|
|
|
self.logout_button = LogoutDialog.LogoutButton(driver)
|
|
|
|
|
|
|
|
class LogoutButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(LogoutDialog.LogoutButton, self).__init__(driver)
|
2018-05-16 19:59:36 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("//*[@text='LOG OUT' or @text='Log out']")
|
2018-04-26 06:22:11 +00:00
|
|
|
|
|
|
|
def navigate(self):
|
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
return SignInView(self.driver)
|
|
|
|
|
|
|
|
|
2018-05-02 16:01:17 +00:00
|
|
|
class ConfirmLogoutButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ConfirmLogoutButton, self).__init__(driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
self.locator = self.Locator.text_selector('LOG OUT')
|
2018-01-14 17:43:36 +00:00
|
|
|
|
|
|
|
|
2018-10-06 12:00:30 +00:00
|
|
|
class DefaultUserNameText(BaseText):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(DefaultUserNameText, self).__init__(driver)
|
2020-04-23 14:05:26 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('default-username')
|
2018-02-14 13:48:18 +00:00
|
|
|
|
2019-11-25 10:32:30 +00:00
|
|
|
class ENSusernames(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ENSusernames, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('ENS usernames')
|
|
|
|
|
|
|
|
def navigate(self):
|
|
|
|
from views.dapps_view import DappsView
|
|
|
|
return DappsView(self.driver)
|
|
|
|
|
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
|
|
|
return self.navigate()
|
|
|
|
|
2018-02-14 13:48:18 +00:00
|
|
|
|
2018-10-02 11:33:51 +00:00
|
|
|
class ShareMyProfileButton(BaseButton):
|
2018-01-26 11:07:09 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-10-02 11:33:51 +00:00
|
|
|
super(ShareMyProfileButton, self).__init__(driver)
|
2019-08-14 16:05:04 +00:00
|
|
|
self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="icon"])[1]')
|
2018-01-26 11:07:09 +00:00
|
|
|
|
|
|
|
|
2018-05-02 16:01:17 +00:00
|
|
|
class ProfilePictureElement(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ProfilePictureElement, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('chat-icon')
|
|
|
|
|
|
|
|
|
2020-05-20 15:43:29 +00:00
|
|
|
class ProfileDetailsOtherUser(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ProfileDetailsOtherUser, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('profile-public-key')
|
|
|
|
|
|
|
|
|
2018-05-02 16:01:17 +00:00
|
|
|
class EditPictureButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(EditPictureButton, self).__init__(driver)
|
2019-08-23 10:24:52 +00:00
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
'//android.view.ViewGroup[@content-desc="edit-profile-photo-button"]')
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
class ConfirmEditButton(BaseButton):
|
2018-01-26 11:07:09 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-07-19 09:57:45 +00:00
|
|
|
super(ConfirmEditButton, self).__init__(driver)
|
2018-03-15 20:01:08 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('done-button')
|
2018-01-26 11:07:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CrossIcon(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(CrossIcon, self).__init__(driver)
|
2018-03-15 20:01:08 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('done-button')
|
|
|
|
|
|
|
|
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2020-04-23 15:42:20 +00:00
|
|
|
class ENSUsernameInShareChatKeyPopup(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ENSUsernameInShareChatKeyPopup, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('ens-username')
|
|
|
|
|
|
|
|
|
2018-03-15 20:01:08 +00:00
|
|
|
class AdvancedButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AdvancedButton, self).__init__(driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
self.locator = self.Locator.text_selector('Advanced')
|
2018-03-15 20:01:08 +00:00
|
|
|
|
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
2018-08-15 12:51:52 +00:00
|
|
|
self.driver.info('Tap on %s' % self.name)
|
2018-03-15 20:01:08 +00:00
|
|
|
return self.navigate()
|
2018-01-26 11:07:09 +00:00
|
|
|
|
|
|
|
|
2019-10-15 08:58:11 +00:00
|
|
|
class LogLevelSetting(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(LogLevelSetting, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector('//*[@content-desc="log-level-settings-button"]/android.widget.TextView[2]')
|
|
|
|
|
2020-05-20 15:43:29 +00:00
|
|
|
|
2018-07-04 13:40:52 +00:00
|
|
|
class BackupRecoveryPhraseButton(BaseButton):
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-07-04 13:40:52 +00:00
|
|
|
super(BackupRecoveryPhraseButton, self).__init__(driver)
|
2019-08-29 07:52:30 +00:00
|
|
|
self.locator = self.Locator.xpath_selector('//*[@content-desc="back-up-recovery-phrase-button"]')
|
2018-05-02 16:01:17 +00:00
|
|
|
|
2018-12-20 14:50:02 +00:00
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
|
|
|
self.driver.info('Tap on %s' % self.name)
|
|
|
|
return self.navigate()
|
|
|
|
|
2018-05-02 16:01:17 +00:00
|
|
|
|
2018-07-04 13:40:52 +00:00
|
|
|
class OkContinueButton(BaseButton):
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-07-04 13:40:52 +00:00
|
|
|
super(OkContinueButton, self).__init__(driver)
|
2020-01-07 12:33:47 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("//*[@text='Okay, continue']")
|
2018-07-04 13:40:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RecoveryPhraseTable(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(RecoveryPhraseTable, self).__init__(driver)
|
2018-05-02 16:01:17 +00:00
|
|
|
self.locator = self.Locator.xpath_selector(
|
2019-09-04 13:10:23 +00:00
|
|
|
"//*[@text='Your seed phrase']/following-sibling::android.view.ViewGroup[1]/android.widget.TextView")
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
|
2018-07-04 13:40:52 +00:00
|
|
|
class RecoveryPhraseWordNumberText(BaseText):
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-07-04 13:40:52 +00:00
|
|
|
super(RecoveryPhraseWordNumberText, self).__init__(driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
self.locator = self.Locator.text_part_selector('#')
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
@property
|
2018-05-10 10:29:08 +00:00
|
|
|
def number(self):
|
2018-05-02 16:01:17 +00:00
|
|
|
time.sleep(1)
|
2018-05-10 10:29:08 +00:00
|
|
|
return int(self.find_element().text.split('#')[1])
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
|
2018-07-04 13:40:52 +00:00
|
|
|
class RecoveryPhraseWordInput(BaseEditBox):
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-07-04 13:40:52 +00:00
|
|
|
super(RecoveryPhraseWordInput, self).__init__(driver)
|
2018-05-02 16:01:17 +00:00
|
|
|
self.locator = self.Locator.xpath_selector('//android.widget.EditText')
|
|
|
|
|
|
|
|
class DebugModeToggle(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(DebugModeToggle, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.Switch")
|
|
|
|
|
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element()
|
|
|
|
super(DebugModeToggle, self).click()
|
|
|
|
|
|
|
|
|
|
|
|
class SelectFromGalleryButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(SelectFromGalleryButton, self).__init__(driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
self.locator = self.Locator.text_selector('Select from gallery')
|
|
|
|
|
|
|
|
|
|
|
|
class CaptureButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(CaptureButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Capture')
|
2018-05-02 16:01:17 +00:00
|
|
|
|
|
|
|
|
2018-07-03 12:40:44 +00:00
|
|
|
class MainCurrencyButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(MainCurrencyButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id("currency-button")
|
|
|
|
|
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
class PlusButton(BaseButton):
|
2018-07-03 12:40:44 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-07-19 09:57:45 +00:00
|
|
|
super(PlusButton, self).__init__(driver)
|
2018-07-03 12:40:44 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("(//android.view.ViewGroup[@content-desc='icon'])[2]")
|
|
|
|
|
|
|
|
|
|
|
|
class RopstenChainButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(RopstenChainButton, self).__init__(driver)
|
2019-02-15 16:14:42 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("//*[contains(@text,'Ropsten test network')]")
|
2018-07-03 12:40:44 +00:00
|
|
|
|
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
class SpecifyNameInput(BaseEditBox):
|
2018-07-03 12:40:44 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-07-19 09:57:45 +00:00
|
|
|
super(SpecifyNameInput, self).__init__(driver)
|
2018-07-03 12:40:44 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("//*[@text='Name']/following-sibling::*[1]/android.widget.EditText")
|
|
|
|
|
|
|
|
|
|
|
|
class CustomNetworkURL(BaseEditBox):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(CustomNetworkURL, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
"//*[@text='RPC URL']/following-sibling::*[1]/android.widget.EditText")
|
|
|
|
|
|
|
|
|
2018-07-06 11:10:48 +00:00
|
|
|
class HelpButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(HelpButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id("help-button")
|
|
|
|
|
2018-11-05 21:38:19 +00:00
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
|
|
|
|
2018-07-06 11:10:48 +00:00
|
|
|
|
|
|
|
class SubmitBugButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(SubmitBugButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id("submit-bug-button")
|
|
|
|
|
|
|
|
|
2019-08-29 15:53:17 +00:00
|
|
|
class RequestFeatureButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(RequestFeatureButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id("request-a-feature-button")
|
|
|
|
|
2019-09-05 02:32:33 +00:00
|
|
|
|
2018-07-06 11:10:48 +00:00
|
|
|
class FaqButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(FaqButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id("faq-button")
|
|
|
|
|
|
|
|
def navigate(self):
|
|
|
|
from views.web_views.base_web_view import BaseWebView
|
|
|
|
return BaseWebView(self.driver)
|
|
|
|
|
2019-08-23 10:24:52 +00:00
|
|
|
|
2019-09-20 15:12:03 +00:00
|
|
|
class AppVersionText(BaseText):
|
2019-08-08 11:41:06 +00:00
|
|
|
def __init__(self, driver):
|
2019-09-20 15:12:03 +00:00
|
|
|
super(AppVersionText, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//*[@content-desc='app-version']//android.widget.TextView[2]")
|
|
|
|
|
|
|
|
|
|
|
|
class NodeVersionText(BaseText):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(NodeVersionText, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//*[@content-desc='node-version']//android.widget.TextView[2]")
|
2018-07-06 11:10:48 +00:00
|
|
|
|
2019-08-23 10:24:52 +00:00
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
class BootnodesButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BootnodesButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('bootnodes-settings-button')
|
|
|
|
|
|
|
|
|
|
|
|
class AddBootnodeButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AddBootnodeButton, self).__init__(driver)
|
2020-04-23 15:42:20 +00:00
|
|
|
self.locator = self.Locator.accessibility_id("add-bootnode")
|
2018-07-19 09:57:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
class BootnodeAddressInput(BaseEditBox):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BootnodeAddressInput, self).__init__(driver)
|
2020-04-23 15:42:20 +00:00
|
|
|
self.locator = self.Locator.accessibility_id("bootnode-address")
|
2018-07-19 09:57:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
class EnableBootnodesToggle(BaseEditBox):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(EnableBootnodesToggle, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector('//android.widget.Switch')
|
|
|
|
|
|
|
|
|
|
|
|
class MailServerButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(MailServerButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('offline-messages-settings-button')
|
|
|
|
|
|
|
|
|
|
|
|
class MailServerAddressInput(BaseEditBox):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(MailServerAddressInput, self).__init__(driver)
|
2019-03-22 11:01:22 +00:00
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
"//*[@text='Mailserver address']/following-sibling::*[1]/android.widget.EditText")
|
2018-07-19 09:57:45 +00:00
|
|
|
|
|
|
|
|
2019-03-04 14:19:42 +00:00
|
|
|
class MailServerAutoSelectionButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(MailServerAutoSelectionButton, self).__init__(driver)
|
2019-10-24 16:03:11 +00:00
|
|
|
self.locator = self.Locator.accessibility_id("checkbox")
|
2019-03-04 14:19:42 +00:00
|
|
|
|
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
class MailServerElement(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver, server_name):
|
|
|
|
super(MailServerElement, self).__init__(driver)
|
2019-03-04 14:19:42 +00:00
|
|
|
self.server_name = server_name
|
2018-07-19 09:57:45 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("//*[@content-desc='mailserver-item']//*[@text='%s']" % server_name)
|
|
|
|
|
2019-03-04 14:19:42 +00:00
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
|
|
|
self.driver.info('Tap on "%s" mailserver value' % self.server_name)
|
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
|
|
|
|
class MailServerConnectButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(MailServerConnectButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('mailserver-connect-button')
|
|
|
|
|
2019-12-27 11:34:59 +00:00
|
|
|
class MailServerDeleteButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(MailServerDeleteButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('mailserver-delete-button')
|
|
|
|
|
|
|
|
class MailServerConfirmDeleteButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(MailServerConfirmDeleteButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('DELETE MAILSERVER')
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2018-09-05 19:50:48 +00:00
|
|
|
class ActiveNetworkName(BaseText):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ActiveNetworkName, self).__init__(driver)
|
2019-03-21 11:36:09 +00:00
|
|
|
self.locator = self.Locator.text_part_selector('with upstream RPC')
|
2018-09-05 19:50:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AboutButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AboutButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('about-button')
|
|
|
|
|
|
|
|
def navigate(self):
|
|
|
|
from views.about_view import AboutView
|
|
|
|
return AboutView(self.driver)
|
|
|
|
|
2018-10-18 08:23:54 +00:00
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
|
|
|
return self.navigate()
|
|
|
|
|
2018-09-05 19:50:48 +00:00
|
|
|
|
2018-10-24 08:50:58 +00:00
|
|
|
class RemovePictureButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Remove current photo')
|
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
class DevicesButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
2019-08-29 15:53:17 +00:00
|
|
|
self.locator = self.Locator.xpath_selector('//*[@content-desc="pairing-settings-button"]')
|
2019-05-29 08:43:41 +00:00
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
class DeviceNameInput(BaseEditBox):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('device-name')
|
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
class ContinueButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ContinueButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Continue')
|
|
|
|
|
2019-09-05 02:32:33 +00:00
|
|
|
|
2019-08-29 15:53:17 +00:00
|
|
|
class SyncSettingsButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(SyncSettingsButton, self).__init__(driver)
|
2020-03-24 15:39:52 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('sync-settings-button')
|
|
|
|
|
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
|
|
|
self.driver.info('Tap on %s' % self.name)
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-09-05 02:32:33 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
class GoToPairingSettingsButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(GoToPairingSettingsButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('GO TO PAIRING SETTINGS')
|
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
class AdvertiseDeviceButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AdvertiseDeviceButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('advertise-device')
|
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
class SyncedDeviceToggle(BaseButton):
|
|
|
|
def __init__(self, driver, device_name):
|
|
|
|
super(SyncedDeviceToggle, self).__init__(driver)
|
|
|
|
self.device_name = device_name
|
2019-08-02 21:22:23 +00:00
|
|
|
self.locator = self.Locator.xpath_selector(
|
2019-08-18 23:31:42 +00:00
|
|
|
'//android.widget.TextView[contains(@text,"%s")]/../android.widget.Switch' % device_name)
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
|
|
|
|
class SyncAllButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(SyncAllButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Sync all devices')
|
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
class ContactsButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ContactsButton, self).__init__(driver)
|
2019-10-23 17:17:54 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('contacts-button')
|
|
|
|
|
|
|
|
|
|
|
|
class BlockedUsersButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(BlockedUsersButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('blocked-users-list-button')
|
2019-05-29 08:43:41 +00:00
|
|
|
|
2018-10-24 08:50:58 +00:00
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
class DappPermissionsButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(DappPermissionsButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id('dapps-permissions-button')
|
|
|
|
|
|
|
|
def click(self):
|
|
|
|
self.scroll_to_element().click()
|
|
|
|
self.driver.info('Tap on %s' % self.name)
|
|
|
|
|
|
|
|
|
|
|
|
class RevokeAccessButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(RevokeAccessButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector('Revoke access')
|
|
|
|
|
2019-09-05 02:32:33 +00:00
|
|
|
|
2019-08-29 07:52:30 +00:00
|
|
|
class PrivacyAndSecurityButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(PrivacyAndSecurityButton, self).__init__(driver)
|
2019-09-06 18:17:44 +00:00
|
|
|
self.locator = self.Locator.accessibility_id('privacy-and-security-settings-button')
|
2019-08-29 07:52:30 +00:00
|
|
|
|
2019-10-03 16:08:06 +00:00
|
|
|
class UseMobileDataToggle(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(UseMobileDataToggle, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
2020-03-24 15:39:52 +00:00
|
|
|
"//*[@text='Use mobile data']/following-sibling::android.widget.Switch[1]")
|
2019-10-03 16:08:06 +00:00
|
|
|
|
|
|
|
class AskMeWhenOnMobileNetworkToggle(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AskMeWhenOnMobileNetworkToggle, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
2020-03-24 15:39:52 +00:00
|
|
|
"//*[@text='Ask me when on mobile network']/following-sibling::android.widget.Switch[1]")
|
2019-10-03 16:08:06 +00:00
|
|
|
|
2019-11-13 17:38:41 +00:00
|
|
|
class ENSUsernameInChatSettings(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ENSUsernameInChatSettings, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
"//*[@content-desc='chat-icon']/../android.widget.TextView[2]")
|
|
|
|
|
2019-10-03 16:08:06 +00:00
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
class ProfileView(BaseView):
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-01-03 09:34:40 +00:00
|
|
|
super(ProfileView, self).__init__(driver)
|
2017-08-28 10:02:20 +00:00
|
|
|
self.driver = driver
|
|
|
|
|
2017-10-30 11:11:58 +00:00
|
|
|
self.options_button = OptionsButton(self.driver)
|
|
|
|
self.username_input = OptionsButton.UsernameInput(self.driver)
|
|
|
|
self.user_status_box = OptionsButton.UserStatusBox(self.driver)
|
|
|
|
self.user_status_input = OptionsButton.UserStatusInput(self.driver)
|
2017-08-28 10:02:20 +00:00
|
|
|
self.public_key_text = PublicKeyText(self.driver)
|
2017-09-21 17:01:04 +00:00
|
|
|
self.profile_address_text = ProfileAddressText(self.driver)
|
2018-09-05 19:50:48 +00:00
|
|
|
self.about_button = AboutButton(self.driver)
|
2019-09-20 15:12:03 +00:00
|
|
|
self.app_version_text = AppVersionText(self.driver)
|
|
|
|
self.node_version_text = NodeVersionText(self.driver)
|
2017-10-11 20:10:57 +00:00
|
|
|
|
|
|
|
self.network_settings_button = NetworkSettingsButton(self.driver)
|
2018-09-05 19:50:48 +00:00
|
|
|
self.active_network_name = ActiveNetworkName(self.driver)
|
2018-07-19 09:57:45 +00:00
|
|
|
self.plus_button = PlusButton(self.driver)
|
2018-07-03 12:40:44 +00:00
|
|
|
self.ropsten_chain_button = RopstenChainButton(self.driver)
|
|
|
|
self.custom_network_url = CustomNetworkURL(self.driver)
|
2018-07-19 09:57:45 +00:00
|
|
|
self.specify_name_input = SpecifyNameInput(self.driver)
|
2017-10-11 20:10:57 +00:00
|
|
|
self.connect_button = NetworkSettingsButton.ConnectButton(self.driver)
|
2018-01-14 17:43:36 +00:00
|
|
|
self.logout_button = LogoutButton(self.driver)
|
2018-04-26 06:22:11 +00:00
|
|
|
self.logout_dialog = LogoutDialog(self.driver)
|
2018-05-02 16:01:17 +00:00
|
|
|
self.confirm_logout_button = ConfirmLogoutButton(self.driver)
|
2017-10-11 20:10:57 +00:00
|
|
|
|
2018-07-03 12:40:44 +00:00
|
|
|
self.main_currency_button = MainCurrencyButton(self.driver)
|
2018-01-26 11:07:09 +00:00
|
|
|
|
2018-10-06 12:00:30 +00:00
|
|
|
self.default_username_text = DefaultUserNameText(self.driver)
|
2018-10-02 11:33:51 +00:00
|
|
|
self.share_my_profile_button = ShareMyProfileButton(self.driver)
|
2018-05-02 16:01:17 +00:00
|
|
|
self.profile_picture = ProfilePictureElement(self.driver)
|
|
|
|
self.edit_picture_button = EditPictureButton(self.driver)
|
2018-10-24 08:50:58 +00:00
|
|
|
self.remove_picture_button = RemovePictureButton(self.driver)
|
2018-07-19 09:57:45 +00:00
|
|
|
self.confirm_edit_button = ConfirmEditButton(self.driver)
|
2018-01-26 11:07:09 +00:00
|
|
|
self.cross_icon = CrossIcon(self.driver)
|
2018-03-15 20:01:08 +00:00
|
|
|
self.advanced_button = AdvancedButton(self.driver)
|
2019-10-15 08:58:11 +00:00
|
|
|
self.log_level_setting = LogLevelSetting(self.driver)
|
2018-05-02 16:01:17 +00:00
|
|
|
self.debug_mode_toggle = DebugModeToggle(self.driver)
|
2019-05-29 08:43:41 +00:00
|
|
|
self.contacts_button = ContactsButton(self.driver)
|
2019-10-23 17:17:54 +00:00
|
|
|
self.blocked_users_button = BlockedUsersButton(self.driver)
|
2019-08-02 21:22:23 +00:00
|
|
|
self.dapp_permissions_button = DappPermissionsButton(self.driver)
|
|
|
|
self.revoke_access_button = RevokeAccessButton(self.driver)
|
2019-08-29 07:52:30 +00:00
|
|
|
self.privacy_and_security_button = PrivacyAndSecurityButton(self.driver)
|
2018-05-02 16:01:17 +00:00
|
|
|
|
2019-07-24 11:36:46 +00:00
|
|
|
# Backup recovery phrase
|
2018-07-04 13:40:52 +00:00
|
|
|
self.backup_recovery_phrase_button = BackupRecoveryPhraseButton(self.driver)
|
|
|
|
self.ok_continue_button = OkContinueButton(self.driver)
|
|
|
|
self.recovery_phrase_table = RecoveryPhraseTable(self.driver)
|
|
|
|
self.recovery_phrase_word_number = RecoveryPhraseWordNumberText(self.driver)
|
|
|
|
self.recovery_phrase_word_input = RecoveryPhraseWordInput(self.driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
|
2018-05-02 16:01:17 +00:00
|
|
|
self.select_from_gallery_button = SelectFromGalleryButton(self.driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
self.capture_button = CaptureButton(self.driver)
|
2018-01-26 11:07:09 +00:00
|
|
|
|
2018-07-06 11:10:48 +00:00
|
|
|
self.help_button = HelpButton(self.driver)
|
|
|
|
self.submit_bug_button = SubmitBugButton(self.driver)
|
2019-08-29 15:53:17 +00:00
|
|
|
self.request_a_feature_button = RequestFeatureButton(self.driver)
|
2018-07-06 11:10:48 +00:00
|
|
|
self.faq_button = FaqButton(self.driver)
|
2019-08-08 11:41:06 +00:00
|
|
|
self.about_button = AboutButton(self.driver)
|
2019-08-29 15:53:17 +00:00
|
|
|
self.sync_settings_button = SyncSettingsButton(self.driver)
|
2018-07-06 11:10:48 +00:00
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
# Bootnodes
|
|
|
|
self.bootnodes_button = BootnodesButton(self.driver)
|
|
|
|
self.bootnode_address_input = BootnodeAddressInput(self.driver)
|
|
|
|
self.enable_bootnodes = EnableBootnodesToggle(self.driver)
|
2020-04-23 15:42:20 +00:00
|
|
|
self.add_bootnode_button = AddBootnodeButton(self.driver)
|
2018-07-19 09:57:45 +00:00
|
|
|
|
|
|
|
# Mailservers
|
|
|
|
self.mail_server_button = MailServerButton(self.driver)
|
|
|
|
self.mail_server_address_input = MailServerAddressInput(self.driver)
|
|
|
|
self.mail_server_connect_button = MailServerConnectButton(self.driver)
|
2019-03-04 14:19:42 +00:00
|
|
|
self.mail_server_auto_selection_button = MailServerAutoSelectionButton(self.driver)
|
2019-12-27 11:34:59 +00:00
|
|
|
self.mail_server_delete_button = MailServerDeleteButton(self.driver)
|
|
|
|
self.mail_server_confirm_delete_button = MailServerConfirmDeleteButton(self.driver)
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
# Pairing
|
|
|
|
self.devices_button = DevicesButton(self.driver)
|
|
|
|
self.device_name_input = DeviceNameInput(self.driver)
|
|
|
|
self.continue_button = ContinueButton(self.driver)
|
|
|
|
self.go_to_pairing_settings_button = GoToPairingSettingsButton(self.driver)
|
|
|
|
self.advertise_device_button = AdvertiseDeviceButton(self.driver)
|
|
|
|
self.sync_all_button = SyncAllButton(self.driver)
|
|
|
|
|
2019-10-03 16:08:06 +00:00
|
|
|
# ENS
|
2019-11-13 17:38:41 +00:00
|
|
|
self.username_in_ens_chat_settings_text = ENSUsernameInChatSettings(self.driver)
|
2019-11-25 10:32:30 +00:00
|
|
|
self.ens_usernames_button = ENSusernames(self.driver)
|
2020-04-23 15:42:20 +00:00
|
|
|
self.ens_name_in_share_chat_key_text = ENSUsernameInShareChatKeyPopup(self.driver)
|
2019-09-05 02:32:33 +00:00
|
|
|
|
2019-10-03 16:08:06 +00:00
|
|
|
# Mobile Data
|
|
|
|
self.use_mobile_data = UseMobileDataToggle(self.driver)
|
|
|
|
self.ask_me_when_on_mobile_network = AskMeWhenOnMobileNetworkToggle(self.driver)
|
|
|
|
|
2017-10-11 20:10:57 +00:00
|
|
|
def switch_network(self, network):
|
2018-05-18 17:31:01 +00:00
|
|
|
self.advanced_button.click()
|
2017-10-11 20:10:57 +00:00
|
|
|
self.network_settings_button.click()
|
2018-01-03 09:34:40 +00:00
|
|
|
network_button = NetworkSettingsButton.NetworkButton(self.driver, network)
|
|
|
|
network_button.click()
|
2017-10-11 20:10:57 +00:00
|
|
|
self.connect_button.click()
|
2019-03-22 12:14:39 +00:00
|
|
|
self.confirm_button.click()
|
2018-01-03 09:34:40 +00:00
|
|
|
from views.sign_in_view import SignInView
|
2018-11-09 12:36:21 +00:00
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
signin_view.sign_in()
|
2018-01-26 11:07:09 +00:00
|
|
|
|
2019-12-26 11:56:59 +00:00
|
|
|
def open_contact_from_profile(self, username):
|
|
|
|
self.contacts_button.click()
|
|
|
|
self.element_by_text(username).click()
|
|
|
|
from views.chat_view import ChatView
|
|
|
|
return ChatView(self.driver)
|
|
|
|
|
2018-12-05 14:11:50 +00:00
|
|
|
def switch_development_mode(self):
|
|
|
|
self.advanced_button.click()
|
|
|
|
self.debug_mode_toggle.click()
|
|
|
|
|
2018-07-03 12:40:44 +00:00
|
|
|
def add_custom_network(self):
|
|
|
|
self.advanced_button.click()
|
|
|
|
self.network_settings_button.scroll_to_element()
|
|
|
|
self.network_settings_button.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
self.plus_button.click_until_presence_of_element(self.ropsten_chain_button)
|
2019-01-21 14:58:42 +00:00
|
|
|
self.custom_network_url.send_keys('https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a')
|
2018-07-19 09:57:45 +00:00
|
|
|
self.specify_name_input.send_keys('custom_ropsten')
|
2020-05-20 08:47:53 +00:00
|
|
|
self.ropsten_chain_button.scroll_to_element()
|
2019-02-19 18:07:59 +00:00
|
|
|
self.ropsten_chain_button.click()
|
|
|
|
self.ropsten_chain_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
self.save_button.click()
|
|
|
|
self.element_by_text_part('custom_ropsten').click_until_presence_of_element(self.connect_button)
|
|
|
|
self.connect_button.click()
|
2019-04-05 13:05:23 +00:00
|
|
|
self.confirm_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
return self.get_sign_in_view()
|
|
|
|
|
2018-07-04 13:40:52 +00:00
|
|
|
def get_recovery_phrase(self):
|
|
|
|
text = [i.text for i in self.recovery_phrase_table.find_elements()]
|
2018-05-10 10:29:08 +00:00
|
|
|
return dict(zip(map(int, text[::2]), text[1::2]))
|
2018-05-02 16:01:17 +00:00
|
|
|
|
2018-07-04 13:40:52 +00:00
|
|
|
def backup_recovery_phrase(self):
|
2018-06-29 17:27:30 +00:00
|
|
|
self.ok_continue_button.click()
|
2018-07-04 13:40:52 +00:00
|
|
|
recovery_phrase = self.get_recovery_phrase()
|
2018-06-29 17:27:30 +00:00
|
|
|
self.next_button.click()
|
2018-07-04 13:40:52 +00:00
|
|
|
word_number = self.recovery_phrase_word_number.number
|
|
|
|
self.recovery_phrase_word_input.set_value(recovery_phrase[word_number])
|
2018-06-29 17:27:30 +00:00
|
|
|
self.next_button.click()
|
2018-07-04 13:40:52 +00:00
|
|
|
word_number_1 = self.recovery_phrase_word_number.number
|
|
|
|
self.recovery_phrase_word_input.set_value(recovery_phrase[word_number_1])
|
2018-06-29 17:27:30 +00:00
|
|
|
self.done_button.click()
|
|
|
|
self.yes_button.click()
|
|
|
|
self.ok_got_it_button.click()
|
2018-07-04 13:40:52 +00:00
|
|
|
return recovery_phrase
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2018-05-02 16:01:17 +00:00
|
|
|
def edit_profile_picture(self, file_name: str):
|
2018-05-16 19:59:36 +00:00
|
|
|
if not AbstractTestCase().environment == 'sauce':
|
2018-05-02 16:01:17 +00:00
|
|
|
raise NotImplementedError('Test case is implemented to run on SauceLabs only')
|
2019-08-14 16:05:04 +00:00
|
|
|
self.profile_picture.click()
|
2018-10-24 08:50:58 +00:00
|
|
|
self.profile_picture.template = file_name
|
2018-05-16 19:59:36 +00:00
|
|
|
self.select_from_gallery_button.click()
|
2019-01-28 09:00:55 +00:00
|
|
|
if self.allow_button.is_element_displayed(sec=5):
|
2018-05-16 19:59:36 +00:00
|
|
|
self.allow_button.click()
|
2018-07-03 18:50:18 +00:00
|
|
|
picture = self.element_by_text(file_name)
|
|
|
|
if not picture.is_element_displayed(2):
|
2019-01-28 09:00:55 +00:00
|
|
|
self.show_roots_button.click()
|
2018-07-03 18:50:18 +00:00
|
|
|
for element_text in 'Images', 'DCIM':
|
|
|
|
self.element_by_text(element_text).click()
|
|
|
|
picture.click()
|
2018-04-26 06:22:11 +00:00
|
|
|
|
2018-10-24 08:50:58 +00:00
|
|
|
def remove_profile_picture(self):
|
|
|
|
if not AbstractTestCase().environment == 'sauce':
|
|
|
|
raise NotImplementedError('Test case is implemented to run on SauceLabs only')
|
2019-08-14 16:05:04 +00:00
|
|
|
self.profile_picture.click()
|
2018-10-24 08:50:58 +00:00
|
|
|
self.remove_picture_button.click()
|
2019-08-14 16:05:04 +00:00
|
|
|
|
2018-04-26 06:22:11 +00:00
|
|
|
def logout(self):
|
|
|
|
self.logout_button.click()
|
|
|
|
return self.logout_dialog.logout_button.click()
|
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
def mail_server_by_name(self, server_name):
|
|
|
|
return MailServerElement(self.driver, server_name)
|
2018-09-05 19:50:48 +00:00
|
|
|
|
2019-05-29 08:43:41 +00:00
|
|
|
def get_toggle_device_by_name(self, device_name):
|
|
|
|
return SyncedDeviceToggle(self.driver, device_name)
|
|
|
|
|
2019-05-30 13:09:52 +00:00
|
|
|
def discover_and_advertise_device(self, device_name):
|
|
|
|
self.profile_button.click()
|
2019-08-29 15:53:17 +00:00
|
|
|
self.sync_settings_button.click()
|
2019-05-30 13:09:52 +00:00
|
|
|
self.devices_button.scroll_to_element()
|
|
|
|
self.devices_button.click()
|
|
|
|
self.device_name_input.set_value(device_name)
|
|
|
|
self.continue_button.click_until_presence_of_element(self.advertise_device_button, 2)
|
|
|
|
self.advertise_device_button.click()
|
|
|
|
|
2019-10-24 16:03:11 +00:00
|
|
|
def retry_to_connect_to_mailserver(self):
|
|
|
|
i = 0
|
|
|
|
while self.element_by_text_part("Error connecting").is_element_present(20) and i < 5:
|
|
|
|
self.element_by_text('RETRY').click()
|
|
|
|
i += 1
|
|
|
|
self.just_fyi("retrying to connect: %s attempt" % i)
|
2020-02-26 11:49:27 +00:00
|
|
|
# TODO: uncomment after https://github.com/status-im/status-react/issues/9269
|
|
|
|
time.sleep(10)
|
2019-10-24 16:03:11 +00:00
|
|
|
if i == 5:
|
|
|
|
self.driver.fail("Failed to connect after %s attempts" % i)
|
|
|
|
|
2019-11-25 10:32:30 +00:00
|
|
|
def connect_existing_status_ens(self, name):
|
|
|
|
self.just_fyi('switching to mainnet and add ENS')
|
|
|
|
profile = self.profile_button.click()
|
|
|
|
profile.switch_network('Mainnet with upstream RPC')
|
|
|
|
self.profile_button.click()
|
|
|
|
dapp_view = self.ens_usernames_button.click()
|
|
|
|
dapp_view.element_by_text('Get started').click()
|
|
|
|
dapp_view.ens_name.set_value(name)
|
|
|
|
dapp_view.check_ens_name.click_until_presence_of_element(self.element_by_text('Ok, got it'))
|
|
|
|
dapp_view.element_by_text('Ok, got it').click()
|
|
|
|
return dapp_view
|
|
|
|
|
2020-01-21 13:59:01 +00:00
|
|
|
def return_mailserver_name(self, mailserver_name, fleet):
|
|
|
|
return mailserver_name + '.' + fleet
|
|
|
|
|
2019-11-25 10:32:30 +00:00
|
|
|
|
2018-09-05 19:50:48 +00:00
|
|
|
@property
|
|
|
|
def current_active_network(self):
|
|
|
|
self.advanced_button.click()
|
2019-06-04 11:37:19 +00:00
|
|
|
self.active_network_name.scroll_to_element(10, 'up')
|
2018-09-05 19:50:48 +00:00
|
|
|
return self.active_network_name.text
|