Disable reload button on unsafe sites

Add refresh button check in respective e2e

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
This commit is contained in:
Vitaliy Vlasov 2020-06-16 13:00:55 +03:00
parent 29508c015a
commit ce1ce1c9a6
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
2 changed files with 12 additions and 8 deletions

View File

@ -24,7 +24,7 @@
[status-im.utils.contenthash :as contenthash])
(:require-macros [status-im.utils.views :as views]))
(defn toolbar-content [url url-original {:keys [secure?]} url-editing?]
(defn toolbar-content [url url-original {:keys [secure?]} url-editing? unsafe?]
(let [url-text (atom url)]
[react/view (styles/toolbar-content)
[react/touchable-highlight {:on-press #(re-frame/dispatch [:browser.ui/lock-pressed secure?])}
@ -45,11 +45,12 @@
[react/touchable-highlight {:style styles/url-text-container
:on-press #(re-frame/dispatch [:browser.ui/url-input-pressed])}
[react/text (http/url-host url-original)]])
[react/touchable-highlight {:on-press #(.reload ^js @webview-ref/webview-ref)
:accessibility-label :refresh-page-button}
[icons/icon :main-icons/refresh]]]))
(when-not unsafe?
[react/touchable-highlight {:on-press #(.reload ^js @webview-ref/webview-ref)
:accessibility-label :refresh-page-button}
[icons/icon :main-icons/refresh]])]))
(defn toolbar [error? url url-original browser browser-id url-editing?]
(defn toolbar [error? url url-original browser browser-id url-editing? unsafe?]
[toolbar.view/toolbar
{:browser? true}
[toolbar.view/nav-button
@ -58,7 +59,7 @@
(re-frame/dispatch [:navigate-back])
(when error?
(re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))))]
[toolbar-content url url-original browser url-editing?]])
[toolbar-content url url-original browser url-editing? unsafe?]])
(defn- web-view-error [_ _ desc]
(reagent/as-element
@ -156,7 +157,7 @@
can-go-forward? (browser/can-go-forward? browser)
url-original (browser/get-current-url browser)]
[react/view {:style styles/browser}
[toolbar error? url url-original browser browser-id url-editing?]
[toolbar error? url url-original browser browser-id url-editing? unsafe?]
[react/view
(when loading?
[connectivity/loading-indicator window-width])]

View File

@ -74,7 +74,10 @@ class TestBrowsing(SingleDeviceTestCase):
def test_open_blocked_site(self):
home_view = SignInView(self.driver).create_user()
daap_view = home_view.dapp_tab_button.click()
daap_view.open_url('https://www.cryptokitties.domainname').find_text_part('This site is blocked')
dapp_detail = daap_view.open_url('https://www.cryptokitties.domainname')
dapp_detail.find_text_part('This site is blocked')
if dapp_detail.browser_refresh_page_button.is_element_displayed():
self.driver.fail("Refresh button is present in blocked site")
@marks.testrail_id(6300)