e2e: fixed browser tests
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
879f441b7d
commit
1b9bd8b017
|
@ -614,16 +614,13 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
|||
|
||||
@marks.testrail_id(5738)
|
||||
@marks.high
|
||||
@marks.skip
|
||||
# TODO: rebuild with browser 1.0
|
||||
def test_dapps_permissions(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.create_user()
|
||||
home_view = SignInView(self.driver).create_user()
|
||||
account_name = home_view.status_account_name
|
||||
|
||||
home_view.just_fyi('open Status Test Dapp, allow all and check permissions in Profile')
|
||||
home_view.open_status_test_dapp()
|
||||
home_view.cross_icon.click()
|
||||
home_view.dapp_tab_button.click()
|
||||
profile_view = home_view.profile_button.click()
|
||||
profile_view.privacy_and_security_button.click()
|
||||
profile_view.dapp_permissions_button.click()
|
||||
|
|
|
@ -486,13 +486,10 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
|
||||
@marks.testrail_id(5498)
|
||||
@marks.medium
|
||||
@marks.skip
|
||||
# TODO: rebuild with browser 1.0
|
||||
def test_share_user_profile_url_public_chat(self):
|
||||
sign_in = SignInView(self.driver)
|
||||
home = sign_in.create_user()
|
||||
home = SignInView(self.driver).create_user()
|
||||
|
||||
sign_in.just_fyi('Join to one-to-one chat and share link to other user profile via messenger')
|
||||
home.just_fyi('Join to one-to-one chat and share link to other user profile via messenger')
|
||||
chat_view = home.add_contact(dummy_user["public_key"])
|
||||
chat_view.chat_options.click()
|
||||
chat_view.view_profile_button.click_until_presence_of_element(chat_view.remove_from_contacts)
|
||||
|
@ -505,7 +502,7 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
for _ in range(2):
|
||||
chat_view.click_system_back_button()
|
||||
|
||||
sign_in.just_fyi('Join to public chat and share link to it via messenger')
|
||||
home.just_fyi('Join to public chat and share link to it via messenger')
|
||||
chat_view.get_back_to_home_view()
|
||||
public_chat_name = 'pubchat'
|
||||
public_chat = home.join_public_chat(public_chat_name)
|
||||
|
@ -518,10 +515,10 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
chat_view.click_system_back_button()
|
||||
chat_view.get_back_to_home_view()
|
||||
|
||||
sign_in.just_fyi('Open URL and share link to it via messenger')
|
||||
home.just_fyi('Open URL and share link to it via messenger')
|
||||
daap_view = home.dapp_tab_button.click()
|
||||
browsing_view = daap_view.open_url('dap.ps')
|
||||
|
||||
browsing_view.options_button.click()
|
||||
browsing_view.share_url_button.click()
|
||||
browsing_view.share_via_messenger()
|
||||
expeceted_text_1 = 'https://join.status.im/b/https://dap.ps'
|
||||
|
|
|
@ -873,9 +873,8 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
|
|||
@marks.testrail_id(6322)
|
||||
@marks.medium
|
||||
def test_can_scan_different_links_with_universal_qr_scanner(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
user = transaction_senders['C']
|
||||
home_view = sign_in_view.recover_access(user['passphrase'])
|
||||
home_view = SignInView(self.driver).recover_access(user['passphrase'])
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
wallet_view.home_button.click()
|
||||
|
@ -923,13 +922,12 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
|
|||
'address': '0x3D59…F415',
|
||||
},
|
||||
},
|
||||
# TODO: rebuild with browser 1.0
|
||||
# 'dapp_deep_link': {
|
||||
# 'url': 'https://join.status.im/b/simpledapp.eth',
|
||||
# },
|
||||
# 'dapp_deep_link_https': {
|
||||
# 'url': 'https://join.status.im/b/https://simpledapp.eth',
|
||||
# },
|
||||
'dapp_deep_link': {
|
||||
'url': 'https://join.status.im/b/simpledapp.eth',
|
||||
},
|
||||
'dapp_deep_link_https': {
|
||||
'url': 'https://join.status.im/b/https://simpledapp.eth',
|
||||
},
|
||||
'public_chat_deep_link': {
|
||||
'url': 'https://join.status.im/baga-ma-2020',
|
||||
'chat_name': 'baga-ma-2020'
|
||||
|
@ -938,7 +936,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
|
|||
|
||||
for key in url_data:
|
||||
home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button)
|
||||
sign_in_view.just_fyi('Checking %s case' % key)
|
||||
home_view.just_fyi('Checking %s case' % key)
|
||||
if home_view.universal_qr_scanner_button.is_element_displayed():
|
||||
home_view.universal_qr_scanner_button.click()
|
||||
if home_view.allow_button.is_element_displayed():
|
||||
|
@ -970,7 +968,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
|
|||
home_view.open_in_status_button.click()
|
||||
if not chat_view.allow_button.is_element_displayed():
|
||||
self.errors.append('No allow button is shown in case of navigating to Status dapp!')
|
||||
chat_view.cross_icon.click()
|
||||
chat_view.dapp_tab_button.click()
|
||||
if 'public' in key:
|
||||
if not chat_view.chat_message_input.is_element_displayed():
|
||||
self.errors.append('No message input is shown in case of navigating to public chat via deep link!')
|
||||
|
|
|
@ -147,43 +147,36 @@ class TestBrowsing(SingleDeviceTestCase):
|
|||
@marks.testrail_id(5390)
|
||||
@marks.high
|
||||
@marks.skip
|
||||
# TODO: rebuild with browser 1.0
|
||||
# TODO: failed due to #11544 and #11545
|
||||
def test_delete_close_all_tabs(self):
|
||||
home_view = SignInView(self.driver).create_user()
|
||||
dapp_view = home_view.dapp_tab_button.click()
|
||||
urls = {
|
||||
'google.com': 'Google',
|
||||
'status.im': 'Status',
|
||||
'bbc.com' : 'BBC'
|
||||
'bbc.com' : 'bbc.com'
|
||||
}
|
||||
tab_name, tab_name_status = 'Google' , 'Status'
|
||||
#browsing_view = dapp_view.open_url('google.com')
|
||||
for url in urls:
|
||||
browsing_view = dapp_view.open_url(url)
|
||||
browsing_view.browser_previous_page_button.click()
|
||||
# browsing_view.back_button.click()
|
||||
[browsing_view.dapp_tab_button.click() for _ in range(2)]
|
||||
home_view.just_fyi('Close one tab, relogin and check that it is not reappearing')
|
||||
browsing_view.remove_tab(name=urls['bbc.com'])
|
||||
home_view.relogin()
|
||||
# home_view.dapp_tab_button.click()
|
||||
# browsing_view.open_tabs_button.click()
|
||||
# if browsing_view.element_by_text_part(tab_name).is_element_displayed():
|
||||
# self.errors.append('Closed tab is present after re-login')
|
||||
# for entry in ('google.com', 'status.im'):
|
||||
# browsing_view = dapp_view.open_url(entry)
|
||||
# browsing_view.browser_previous_page_button.click()
|
||||
# browsing_view.remove_tab(clear_all=True)
|
||||
# # dapp_view.remove_browser_entry_long_press('status', clear_all=True)
|
||||
# home_view.relogin()
|
||||
# home_view.dapp_tab_button.click()
|
||||
# browsing_view.open_tabs_button.click()
|
||||
# for closed_tab in (tab_name, tab_name_status):
|
||||
# if browsing_view.element_by_text_part(closed_tab).is_element_displayed():
|
||||
# self.errors.append('Closed tab %s is present after re-login')
|
||||
home_view.dapp_tab_button.click()
|
||||
browsing_view.open_tabs_button.click()
|
||||
if browsing_view.element_by_text_part(urls['bbc.com']).is_element_displayed():
|
||||
self.errors.append('Closed tab is present after re-login')
|
||||
|
||||
home_view.just_fyi('Close all tabs via "Close all", relogin and check that it is not reappearing')
|
||||
browsing_view.close_all_button.click()
|
||||
home_view.relogin()
|
||||
home_view.dapp_tab_button.click()
|
||||
browsing_view.open_tabs_button.click()
|
||||
for url in urls:
|
||||
if browsing_view.element_by_text_part(urls[url]).is_element_displayed():
|
||||
self.errors.append('Closed tab %s present after re-login after "Close all"' % url)
|
||||
|
||||
# if not dapp_view.element_by_text('Browser history will appear here').is_element_displayed():
|
||||
# self.errors.append('Browser history is not empty')
|
||||
# self.errors.verify_no_errors()
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(5321)
|
||||
@marks.critical
|
||||
|
|
|
@ -56,8 +56,6 @@ class TestDApps(SingleDeviceTestCase):
|
|||
|
||||
@marks.testrail_id(6232)
|
||||
@marks.medium
|
||||
@marks.skip
|
||||
# TODO: rebuild with browser 1.0
|
||||
def test_switching_accounts_in_dapp(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.create_user()
|
||||
|
@ -92,18 +90,18 @@ class TestDApps(SingleDeviceTestCase):
|
|||
self.errors.append("Permissions for %s are not removed" % test_dapp_name)
|
||||
|
||||
sign_in_view.just_fyi('check that can change account')
|
||||
profile_view.dapp_tab_button.click()
|
||||
if not status_test_dapp.element_by_text(account_name).is_element_displayed():
|
||||
profile_view.dapp_tab_button.click(desired_element_text='Allow')
|
||||
if not status_test_dapp.element_by_text_part(account_name).is_element_displayed():
|
||||
self.errors.append("No expected account %s is shown in authorize web3 popup for wallet" % account_name)
|
||||
status_test_dapp.allow_button.wait_and_click()
|
||||
status_test_dapp.allow_button.click()
|
||||
dapp_view.profile_button.click(desired_element_text='DApp permissions')
|
||||
profile_view.element_by_text(test_dapp_name).click()
|
||||
for text in 'Chat key', account_name:
|
||||
if not dapp_view.element_by_text(text).is_element_displayed():
|
||||
if not dapp_view.element_by_text_part(text).is_element_displayed():
|
||||
self.errors.append("Access is not granted to %s" % text)
|
||||
|
||||
sign_in_view.just_fyi('check correct account is shown for transaction if sending from DApp')
|
||||
profile_view.dapp_tab_button.click()
|
||||
profile_view.dapp_tab_button.click(desired_element_text='Accounts')
|
||||
status_test_dapp.assets_button.click()
|
||||
send_transaction_view = status_test_dapp.request_stt_button.click()
|
||||
address = send_transaction_view.get_formatted_recipient_address(address)
|
||||
|
@ -117,8 +115,11 @@ class TestDApps(SingleDeviceTestCase):
|
|||
sign_in_view.wallet_button.click()
|
||||
if not wallet_view.element_by_text(account_name).is_element_displayed():
|
||||
self.errors.append("Subaccount is gone after relogin in Wallet!")
|
||||
sign_in_view.dapp_tab_button.click()
|
||||
if not dapp_view.element_by_text(account_name).is_element_displayed():
|
||||
sign_in_view.profile_button.click()
|
||||
profile_view.privacy_and_security_button.click()
|
||||
profile_view.dapp_permissions_button.click()
|
||||
profile_view.element_by_text(test_dapp_name).click()
|
||||
if not profile_view.element_by_text(account_name).is_element_displayed():
|
||||
self.errors.append("Subaccount is not selected after relogin in Dapps!")
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
|
|
@ -148,9 +148,14 @@ class DappTabButton(TabButton):
|
|||
from views.dapps_view import DappsView
|
||||
return DappsView(self.driver)
|
||||
|
||||
def click(self):
|
||||
def click(self, desired_element_text = 'enter_url'):
|
||||
from views.dapps_view import EnterUrlEditbox
|
||||
self.click_until_presence_of_element(EnterUrlEditbox(self.driver))
|
||||
if desired_element_text == 'enter_url':
|
||||
self.click_until_presence_of_element(EnterUrlEditbox(self.driver))
|
||||
else:
|
||||
base_view = BaseView(self.driver)
|
||||
self.click_until_presence_of_element(base_view.element_by_text_part(desired_element_text))
|
||||
|
||||
return self.navigate()
|
||||
|
||||
|
||||
|
|
|
@ -123,6 +123,7 @@ class DappsView(BaseView):
|
|||
self.close_web3_permissions_window_button = CrossCloseWeb3PermissionButton(self.driver)
|
||||
|
||||
def open_url(self, url):
|
||||
self.enter_url_editbox.wait_for_visibility_of_element(10)
|
||||
self.enter_url_editbox.click()
|
||||
self.enter_url_editbox.send_keys(url)
|
||||
self.confirm()
|
||||
|
|
|
@ -84,14 +84,18 @@ class PolicySummary(BaseElement):
|
|||
class ShareUrlButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(ShareUrlButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('modal-share-link-button')
|
||||
|
||||
self.locator = self.Locator.accessibility_id('share')
|
||||
|
||||
class GoBackButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(GoBackButton, self).__init__(driver)
|
||||
self.locator = self.Locator.translation_id_selector('browsing-site-blocked-go-back')
|
||||
|
||||
class OptionsButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(OptionsButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('browser-options')
|
||||
|
||||
class OpenTabsButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(OpenTabsButton, self).__init__(driver)
|
||||
|
@ -128,6 +132,7 @@ class BaseWebView(BaseView):
|
|||
self.browser_refresh_page_button = BrowserRefreshPageButton(self.driver)
|
||||
self.share_url_button = ShareUrlButton(self.driver)
|
||||
self.go_back_button = GoBackButton(self.driver)
|
||||
self.options_button = OptionsButton(self.driver)
|
||||
self.continue_anyway_button = ContinueAnywayButton(self.driver)
|
||||
self.open_tabs_button = OpenTabsButton(self.driver)
|
||||
self.close_all_button = CloseAllButton(self.driver)
|
||||
|
|
Loading…
Reference in New Issue