e2e: browser1.0
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
3241d3273e
commit
905aa26705
|
@ -614,6 +614,8 @@ 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()
|
||||
|
|
|
@ -486,6 +486,8 @@ 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()
|
||||
|
@ -519,6 +521,7 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
sign_in.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.share_url_button.click()
|
||||
browsing_view.share_via_messenger()
|
||||
expeceted_text_1 = 'https://join.status.im/b/https://dap.ps'
|
||||
|
|
|
@ -923,12 +923,13 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
|
|||
'address': '0x3D59…F415',
|
||||
},
|
||||
},
|
||||
'dapp_deep_link': {
|
||||
'url': 'https://join.status.im/b/simpledapp.eth',
|
||||
},
|
||||
'dapp_deep_link_https': {
|
||||
'url': 'https://join.status.im/b/https://simpledapp.eth',
|
||||
},
|
||||
# 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',
|
||||
# },
|
||||
'public_chat_deep_link': {
|
||||
'url': 'https://join.status.im/baga-ma-2020',
|
||||
'chat_name': 'baga-ma-2020'
|
||||
|
|
|
@ -36,6 +36,7 @@ class TestBrowsing(SingleDeviceTestCase):
|
|||
browsing_view.just_fyi('Relogin and check that tap on "Next" navigates to next page')
|
||||
browsing_view.relogin()
|
||||
home_view.dapp_tab_button.click()
|
||||
browsing_view.open_tabs_button.click()
|
||||
dapp_view.element_by_text_part(ru_url).click()
|
||||
browsing_view.wait_for_element_starts_with_text('свободную энциклопедию')
|
||||
browsing_view.browser_next_page_button.click()
|
||||
|
@ -75,21 +76,22 @@ class TestBrowsing(SingleDeviceTestCase):
|
|||
for url in ('metamask.site', 'https://www.cryptokitties.domainname'):
|
||||
daap_view.just_fyi('Checking blocked website %s' % url)
|
||||
dapp_detail = daap_view.open_url(url)
|
||||
dapp_detail.find_text_part('This site is blocked')
|
||||
dapp_detail.find_element_by_translation_id('browsing-site-blocked-title')
|
||||
if dapp_detail.browser_refresh_page_button.is_element_displayed():
|
||||
self.errors.append("Refresh button is present in blocked site")
|
||||
dapp_detail.go_back_button.click()
|
||||
dapp_detail.open_tabs_button.click()
|
||||
daap_view.element_by_text("Browser").click()
|
||||
dapp_detail.continue_anyway_button.click()
|
||||
if dapp_detail.element_by_text('This site is blocked').is_element_displayed():
|
||||
self.errors.append("Failed to open Dapp after 'Continue anyway' tapped for %s" % url)
|
||||
daap_view.cross_icon.click()
|
||||
home_view.dapp_tab_button.click()
|
||||
|
||||
daap_view.just_fyi('Checking connection is not secure warning')
|
||||
browsing_view = daap_view.open_url('http://www.dvwa.co.uk')
|
||||
browsing_view.url_edit_box_lock_icon.click_until_presence_of_element(
|
||||
browsing_view.element_by_text(connection_not_secure_text))
|
||||
browsing_view.cross_icon.click()
|
||||
home_view.dapp_tab_button.click()
|
||||
|
||||
for url in ('https://www.bbc.com', 'https://instant.airswap.io'):
|
||||
daap_view.just_fyi('Checking connection is secure for %s' % url)
|
||||
|
@ -97,7 +99,7 @@ class TestBrowsing(SingleDeviceTestCase):
|
|||
browsing_view.wait_for_d_aap_to_load()
|
||||
browsing_view.url_edit_box_lock_icon.click_until_presence_of_element(
|
||||
browsing_view.element_by_text(connection_is_secure_text))
|
||||
browsing_view.cross_icon.click()
|
||||
home_view.dapp_tab_button.click()
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
@ -144,26 +146,44 @@ class TestBrowsing(SingleDeviceTestCase):
|
|||
|
||||
@marks.testrail_id(5390)
|
||||
@marks.high
|
||||
def test_long_press_delete_clear_all_dapps(self):
|
||||
sign_in = SignInView(self.driver)
|
||||
home_view = sign_in.create_user()
|
||||
@marks.skip
|
||||
# TODO: rebuild with browser 1.0
|
||||
def test_delete_close_all_tabs(self):
|
||||
home_view = SignInView(self.driver).create_user()
|
||||
dapp_view = home_view.dapp_tab_button.click()
|
||||
browsing_view = dapp_view.open_url('google.com')
|
||||
browsing_view.back_button.click()
|
||||
dapp_view = DappsView(self.driver)
|
||||
browser_entry = dapp_view.remove_browser_entry_long_press('Google')
|
||||
urls = {
|
||||
'google.com': 'Google',
|
||||
'status.im': 'Status',
|
||||
'bbc.com' : 'BBC'
|
||||
}
|
||||
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.remove_tab(name=urls['bbc.com'])
|
||||
home_view.relogin()
|
||||
home_view.dapp_tab_button.click()
|
||||
if browser_entry.is_element_present(20):
|
||||
self.errors.append('The browser entry is present after re-login')
|
||||
for entry in ('google.com', 'status.im'):
|
||||
browsing_view = dapp_view.open_url(entry)
|
||||
browsing_view.back_button.click()
|
||||
dapp_view.remove_browser_entry_long_press('status', clear_all=True)
|
||||
home_view.relogin()
|
||||
home_view.dapp_tab_button.click()
|
||||
if not dapp_view.element_by_text('Browser history will appear here').is_element_displayed():
|
||||
self.errors.append('Browser history is not empty')
|
||||
# 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')
|
||||
|
||||
|
||||
# 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()
|
||||
|
||||
@marks.testrail_id(5321)
|
||||
@marks.critical
|
||||
|
|
|
@ -56,6 +56,8 @@ 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()
|
||||
|
|
|
@ -149,8 +149,8 @@ class DappTabButton(TabButton):
|
|||
return DappsView(self.driver)
|
||||
|
||||
def click(self):
|
||||
from views.dapps_view import SelectAccountButton
|
||||
self.click_until_presence_of_element(SelectAccountButton(self.driver))
|
||||
from views.dapps_view import EnterUrlEditbox
|
||||
self.click_until_presence_of_element(EnterUrlEditbox(self.driver))
|
||||
return self.navigate()
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,12 @@ class ProgressBarIcon(BaseElement):
|
|||
self.locator = self.Locator.xpath_selector("//android.widget.ProgressBar")
|
||||
|
||||
|
||||
class CloseTabButton(BaseElement):
|
||||
def __init__(self, driver, name):
|
||||
super(CloseTabButton, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector("//*[contains(@text, '%s')]/../../../../*[@content-desc='empty-tab']"
|
||||
% name)
|
||||
|
||||
class WebLinkEditBox(BaseEditBox):
|
||||
|
||||
def __init__(self, driver):
|
||||
|
@ -84,13 +90,22 @@ class ShareUrlButton(BaseButton):
|
|||
class GoBackButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(GoBackButton, self).__init__(driver)
|
||||
self.locator = self.Locator.text_selector("Go back")
|
||||
self.locator = self.Locator.translation_id_selector('browsing-site-blocked-go-back')
|
||||
|
||||
class OpenTabsButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(OpenTabsButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('browser-open-tabs')
|
||||
|
||||
class CloseAllButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(CloseAllButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('close-all')
|
||||
|
||||
class ContinueAnywayButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(ContinueAnywayButton, self).__init__(driver)
|
||||
self.locator = self.Locator.text_selector("Continue anyway")
|
||||
self.locator = self.Locator.translation_id_selector("continue-anyway")
|
||||
|
||||
|
||||
class BaseWebView(BaseView):
|
||||
|
@ -114,6 +129,8 @@ class BaseWebView(BaseView):
|
|||
self.share_url_button = ShareUrlButton(self.driver)
|
||||
self.go_back_button = GoBackButton(self.driver)
|
||||
self.continue_anyway_button = ContinueAnywayButton(self.driver)
|
||||
self.open_tabs_button = OpenTabsButton(self.driver)
|
||||
self.close_all_button = CloseAllButton(self.driver)
|
||||
|
||||
def wait_for_d_aap_to_load(self, wait_time=35):
|
||||
counter = 0
|
||||
|
@ -129,3 +146,12 @@ class BaseWebView(BaseView):
|
|||
if self.always_button.is_element_displayed():
|
||||
self.always_button.click()
|
||||
|
||||
def remove_tab(self, name='', clear_all=False):
|
||||
self.open_tabs_button.click()
|
||||
if clear_all:
|
||||
self.close_all_button.click()
|
||||
else:
|
||||
close_button = CloseTabButton(self.driver, name)
|
||||
close_button.scroll_to_element()
|
||||
close_button.click()
|
||||
|
||||
|
|
Loading…
Reference in New Issue