diff --git a/src/status_im/contexts/onboarding/welcome/view.cljs b/src/status_im/contexts/onboarding/welcome/view.cljs index fc8ed67b0a..034b21fc50 100644 --- a/src/status_im/contexts/onboarding/welcome/view.cljs +++ b/src/status_im/contexts/onboarding/welcome/view.cljs @@ -57,6 +57,7 @@ [quo/button {:on-press (fn [] (rf/dispatch [:init-root :shell-stack]) + (rf/dispatch [:profile/show-testnet-mode-banner-if-enabled]) (rf/dispatch [:universal-links/process-stored-event])) :type :primary :accessibility-label :welcome-button diff --git a/src/status_im/contexts/profile/login/events.cljs b/src/status_im/contexts/profile/login/events.cljs index f5fffe710e..4c0af263ef 100644 --- a/src/status_im/contexts/profile/login/events.cljs +++ b/src/status_im/contexts/profile/login/events.cljs @@ -10,6 +10,7 @@ [status-im.contexts.profile.rpc :as profile.rpc] [taoensso.timbre :as log] [utils.ethereum.chain :as chain] + [utils.i18n :as i18n] [utils.re-frame :as rf] [utils.security.core :as security])) @@ -82,7 +83,8 @@ constants/theme-type-dark) :shell-stack false]] - [:set-root :shell-stack]]))}))) + [:set-root :shell-stack] + [:dispatch [:profile/show-testnet-mode-banner-if-enabled]]]))}))) ;; login phase 2: we want to load and show chats faster, so we split login into 2 phases (rf/reg-event-fx :profile.login/get-chats-callback @@ -234,3 +236,12 @@ :profile/on-password-input-changed (fn [{:keys [db]} [{:keys [password error]}]] {:db (update db :profile/login assoc :password password :error error)})) + +(rf/reg-event-fx + :profile/show-testnet-mode-banner-if-enabled + (fn [{:keys [db]}] + (when (get-in db [:profile/profile :test-networks-enabled?]) + {:fx [[:dispatch + [:alert-banners/add + {:type :alert + :text (i18n/label :t/testnet-mode-enabled)}]]]}))) diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index dbf1615cfb..8adb7e284d 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -314,6 +314,7 @@ class BaseView(object): # share contact screen self.show_qr_button = Button(self.driver, accessibility_id="show-qr-button") self.link_to_profile_button = Button(self.driver, accessibility_id="share-qr-code-info-text") + self.sharing_text_native = Text(self.driver, xpath="//*[@resource-id='android:id/content_preview_text']") # checkboxes and toggles self.checkbox_button = CheckBox(self.driver, accessibility_id="checkbox-off") diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index a1678a8c52..6dbd6922df 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -331,6 +331,7 @@ class HomeView(BaseView): self.mark_all_read_activity_button = Button(self.driver, translation_id="mark-all-notifications-as-read") # Share tab + self.link_to_profile_button = Button(self.driver, accessibility_id="link-to-profile") self.link_to_profile_text = Text(self.driver, accessibility_id="share-qr-code-info-text") self.close_share_tab_button = Button(self.driver, accessibility_id="close-shell-share-tab") @@ -562,9 +563,10 @@ class HomeView(BaseView): def get_link_to_profile(self): self.show_qr_code_button.click() - self.link_to_profile_text.wait_for_visibility_of_element() - self.link_to_profile_text.click() - return self.driver.get_clipboard_text() + self.link_to_profile_button.click() + link_to_profile = self.sharing_text_native.text + self.click_system_back_button() + return link_to_profile def get_public_key(self): self.driver.info("Getting public key via Share tab") diff --git a/translations/en.json b/translations/en.json index 9fd5540233..668fc6588b 100644 --- a/translations/en.json +++ b/translations/en.json @@ -2566,5 +2566,6 @@ "key-name-error-length": "Key name too long", "key-name-error-emoji": "Emojis are not allowed", "key-name-error-special-char": "Special characters are not allowed", - "display": "Display" + "display": "Display", + "testnet-mode-enabled": "Testnet mode enabled" }