Compare commits

..
Author SHA1 Message Date
Mohamed JavidandYevheniia Berdnyk f69fa8ba58 feat(wallet)_: Add base chain indicator (#22215)
* feat(wallet)_: Add base chain indicator

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>

* e2e: updated Base network name

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Co-authored-by: Yevheniia Berdnyk <ie.berdnyk@gmail.com>
2025-03-04 02:03:06 +05:30
30 changed files with 212 additions and 301 deletions
@@ -0,0 +1,13 @@
(ns quo.components.common.new-feature-dot
(:require [quo.components.common.new-feature-gradient :as new-feature-gradient]))
(def ^:const size 8)
(defn view
[{:keys [style accessibility-label]}]
[new-feature-gradient/view
{:style (merge {:width size
:height size
:border-radius (/ size 2)}
style)
:accessibility-label accessibility-label}])
@@ -0,0 +1,16 @@
(ns quo.components.common.new-feature-gradient
(:require [quo.foundations.colors :as colors]
[quo.theme]
[react-native.linear-gradient :as linear-gradient]))
(defn view
[{:keys [style accessibility-label]}]
(let [theme (quo.theme/use-theme)]
[linear-gradient/linear-gradient
{:style style
:accessibility-label accessibility-label
:colors [(colors/resolve-color :yellow theme)
colors/new-feature-gradient-pink]
:use-angle true
:angle 78
:angle-center {:x 0.5 :y 0.5}}]))
@@ -33,4 +33,12 @@
networks-list])
(h/is-truthy (h/query-by-label-text :network-dropdown))
(h/fire-event :press (h/query-by-label-text :network-dropdown))
(h/was-not-called on-press))))
(h/was-not-called on-press)))
(h/test "Should display new chain indicator"
(h/render [network-dropdown/view
{:state :default
:show-new-chain-indicator? true}
networks-list])
(h/is-truthy (h/query-by-label-text :network-dropdown))
(h/is-truthy (h/query-by-label-text :new-chain-indicator))))
@@ -23,3 +23,7 @@
:opacity (if (= state :disabled) 0.3 1)
:border-color (container-border-color props)
:align-items :center})
(def new-chain-indicator
{:position :absolute
:right 0})
@@ -1,12 +1,13 @@
(ns quo.components.dropdowns.network-dropdown.view
(:require
[quo.components.common.new-feature-dot :as new-feature-dot]
[quo.components.dropdowns.network-dropdown.style :as style]
[quo.components.list-items.preview-list.view :as preview-list]
[quo.theme :as quo.theme]
[react-native.core :as rn]))
(defn view
[{:keys [on-press state] :as props} networks]
[{:keys [on-press state show-new-chain-indicator?] :as props} networks]
(let [theme (quo.theme/use-theme)
[pressed? set-pressed] (rn/use-state false)
on-press-in (rn/use-callback #(set-pressed true))
@@ -18,6 +19,10 @@
:on-press on-press
:on-press-in on-press-in
:on-press-out on-press-out}
(when show-new-chain-indicator?
[new-feature-dot/view
{:style style/new-chain-indicator
:accessibility-label :new-chain-indicator}])
[preview-list/view
{:type :network
:list-size (count networks)
@@ -200,12 +200,15 @@
shown-name]]))
(defn- wallet-networks-center
[{:keys [networks networks-on-press background center-content-container-style]}]
[{:keys [networks networks-on-press show-new-chain-indicator? background
center-content-container-style]}]
[reanimated/view {:style center-content-container-style}
[network-dropdown/view
{:state :default
:on-press networks-on-press
:blur? (= background :blur)} networks]])
{:state :default
:on-press networks-on-press
:blur? (= background :blur)
:show-new-chain-indicator? show-new-chain-indicator?}
networks]])
(defn page-nav
"Props:
@@ -64,3 +64,20 @@
{:margin-top 7
:margin-bottom 2
:margin-left -1})
(def new-feature-tag-container
{:margin-left 6
:border-radius 12
:justify-content :center})
(def new-feature-tag-gradient
{:border-radius 12
:position :absolute
:left 0
:right 0
:top 0
:bottom 0})
(def new-feature-tag-text
{:color colors/white
:margin-horizontal 5})
@@ -4,6 +4,7 @@
[quo.components.avatars.icon-avatar :as icon-avatar]
[quo.components.avatars.user-avatar.view :as user-avatar]
[quo.components.buttons.button.view :as button]
[quo.components.common.new-feature-gradient :as new-feature-gradient]
[quo.components.icon :as icon]
[quo.components.list-items.preview-list.view :as preview-list]
[quo.components.markdown.text :as text]
@@ -115,7 +116,9 @@
nil)])
(defn view
[{:keys [title on-press action-props accessibility-label blur? container-style content] :as props}]
[{:keys [title show-new-feature-tag? on-press action-props accessibility-label blur? container-style
content]
:as props}]
[rn/pressable
{:style (merge style/container container-style)
:on-press (or on-press (:on-change action-props))
@@ -126,10 +129,19 @@
[rn/view {:style (style/left-sub-container props)}
[image-component props]
[rn/view {:style (style/left-container (:image props))}
[text/text
{:weight :medium
:style {:color (when blur? colors/white)}}
title]
[rn/view {:flex-direction :row}
[text/text
{:weight :medium
:style {:color (when blur? colors/white)}}
title]
(when show-new-feature-tag?
[rn/view {:style style/new-feature-tag-container}
[new-feature-gradient/view {:style style/new-feature-tag-gradient}]
[text/text
{:weight :semi-bold
:size :label
:style style/new-feature-tag-text}
(string/upper-case (i18n/label :t/new))]])]
[description-component props]
[tag-component props]]]
[rn/view {:style (style/sub-container (:alignment action-props))}
@@ -18,5 +18,6 @@
[:dropdown-on-press {:optional true} [:maybe fn?]]
[:networks {:optional true}
[:maybe [:sequential [:map [:source [:maybe :schema.common/image-source]]]]]]
[:dropdown-state {:optional true} [:maybe [:enum :default :disabled]]]]]]
[:dropdown-state {:optional true} [:maybe [:enum :default :disabled]]]
[:show-new-chain-indicator? {:optional true} [:maybe :boolean]]]]]
:any])
@@ -25,7 +25,7 @@
bars))
(defn- view-info-top
[{:keys [state balance networks dropdown-on-press dropdown-state]}]
[{:keys [state balance networks dropdown-on-press dropdown-state show-new-chain-indicator?]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style style/container-info-top}
(if (= state :loading)
@@ -36,9 +36,10 @@
:style (style/style-text-heading theme)}
balance])
[network-dropdown/view
{:state (or dropdown-state :default)
:blur? true
:on-press dropdown-on-press}
{:state (or dropdown-state :default)
:blur? true
:on-press dropdown-on-press
:show-new-chain-indicator? show-new-chain-indicator?}
networks]]))
(defn- view-metrics
+2
View File
@@ -315,6 +315,8 @@
networks-short-name
socials))
(def new-feature-gradient-pink "#FF33A3")
(defn hex-string?
[s]
(and (string? s) (string/starts-with? s "#")))
@@ -1,6 +1,7 @@
(ns status-im.contexts.wallet.common.account-switcher.view
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.contexts.wallet.sheets.account-options.view :as account-options]
[status-im.contexts.wallet.sheets.network-filter.view :as network-filter]
[status-im.contexts.wallet.sheets.select-account.view :as select-account]
@@ -30,25 +31,33 @@
type :no-title}}]
(let [{:keys [color emoji watch-only?]} (rf/sub [:wallet/current-viewing-account])
networks (rf/sub [:wallet/selected-network-details])
sending-collectible? (rf/sub [:wallet/sending-collectible?])]
sending-collectible? (rf/sub [:wallet/sending-collectible?])
show-new-chain-indicator? (rf/sub [:wallet/show-new-chain-indicator?])
on-press-networks (rn/use-callback
(fn []
(rf/dispatch [:wallet/hide-new-chain-indicator])
(rf/dispatch [:show-bottom-sheet
{:content network-filter/view}])))]
[quo/page-nav
{:type type
:icon-name icon-name
:margin-top margin-top
:background :blur
:on-press on-press
:accessibility-label accessibility-label
:networks networks
:align-center? true
:networks-on-press #(rf/dispatch [:show-bottom-sheet {:content network-filter/view}])
:right-side [(when (and (ff/enabled? ::ff/wallet.wallet-connect)
(not watch-only?)
show-dapps-button?)
{:icon-name :i/dapps
:on-press #(rf/dispatch [:navigate-to :screen/wallet.connected-dapps])})
(when-not sending-collectible?
{:content-type :account-switcher
:customization-color color
:on-press #(on-switcher-press switcher-type params)
:emoji emoji
:type (when watch-only? :watch-only)})]}]))
{:type type
:icon-name icon-name
:margin-top margin-top
:background :blur
:on-press on-press
:accessibility-label accessibility-label
:networks networks
:align-center? true
:networks-on-press on-press-networks
:show-new-chain-indicator? show-new-chain-indicator?
:right-side [(when (and (ff/enabled? ::ff/wallet.wallet-connect)
(not watch-only?)
show-dapps-button?)
{:icon-name :i/dapps
:on-press #(rf/dispatch [:navigate-to
:screen/wallet.connected-dapps])})
(when-not sending-collectible?
{:content-type :account-switcher
:customization-color color
:on-press #(on-switcher-press switcher-type params)
:emoji emoji
:type (when watch-only? :watch-only)})]}]))
+13 -14
View File
@@ -324,20 +324,19 @@
(defn make-network-item
"This function generates props for quo/category component item"
[{:keys [network-name color on-change networks state label-props type blur?]}]
(cond-> {:title (string/capitalize (name network-name))
:image :icon-avatar
:image-props {:icon (resources/get-network network-name)
:size :size-20}
:action :selector
:action-props {:type (or type
(if (= :default state)
:filled-checkbox
:checkbox))
:blur? blur?
:customization-color color
:checked? (contains? networks network-name)
:on-change on-change}}
[{:keys [network-name color on-change networks label-props type blur?]}]
(cond-> {:title (string/capitalize (name network-name))
:image :icon-avatar
:image-props {:icon (resources/get-network network-name)
:size :size-20}
;; Remove the following line for v2.35
:show-new-feature-tag? (= network-name constants/base-network-name)
:action :selector
:action-props {:type (or type :checkbox)
:blur? blur?
:customization-color color
:checked? (contains? networks network-name)
:on-change on-change}}
label-props
(assoc :label :text
@@ -3,6 +3,7 @@
[clojure.string :as string]
[native-module.core :as native-module]
[promesa.core :as promesa]
[react-native.async-storage :as async-storage]
[status-im.common.json-rpc.events :as json-rpc]
[status-im.contexts.profile.recover.effects :as profile.recover.effects]
[status-im.contexts.wallet.rpc :as wallet-rpc]
@@ -130,3 +131,14 @@
(-> (wallet-rpc/sign-message message address (security/safe-unmask-data password))
(promesa/then on-success)
(promesa/catch on-error))))
(rf/reg-fx
:effects.wallet/retrieve-base-chain-indicator-shown
(fn []
(async-storage/get-item :base-chain-indicator-shown
#(rf/dispatch [:wallet/retrieve-new-chain-indicator (not %)]))))
(rf/reg-fx
:effects.wallet/set-base-chain-indicator-shown
(fn [flag]
(async-storage/set-item! :base-chain-indicator-shown flag)))
+11
View File
@@ -797,3 +797,14 @@
:wallet.swap/transaction-success
:wallet/transaction-success)
sent-transactions])]]})))
(rf/reg-event-fx
:wallet/retrieve-new-chain-indicator
(fn [{:keys [db]} [flag]]
{:db (assoc-in db [:wallet :ui :show-new-chain-indicator?] flag)}))
(rf/reg-event-fx
:wallet/hide-new-chain-indicator
(fn [{:keys [db]}]
{:db (assoc-in db [:wallet :ui :show-new-chain-indicator?] false)
:fx [[:effects.wallet/set-base-chain-indicator-shown true]]}))
+15 -8
View File
@@ -135,7 +135,13 @@
cards (conj account-cards-data (new-account-card-data))
[init-loaded? set-init-loaded] (rn/use-state false)
{:keys [formatted-balance]} (rf/sub [:wallet/aggregated-token-values-and-balance])
theme (quo.theme/use-theme)]
theme (quo.theme/use-theme)
show-new-chain-indicator? (rf/sub [:wallet/show-new-chain-indicator?])
on-press-network-selector (rn/use-callback
(fn []
(rf/dispatch [:wallet/hide-new-chain-indicator])
(rf/dispatch [:show-bottom-sheet
{:content network-filter/view}])))]
(rn/use-effect (fn []
(when (and @account-list-ref (pos? (count cards)))
(.scrollToOffset ^js @account-list-ref
@@ -157,13 +163,14 @@
:on-refresh #(rf/dispatch [:wallet/get-accounts])}]
:header [rn/view {:style (style/header-container theme)}
[quo/wallet-overview
{:state (if tokens-loading? :loading :default)
:time-frame :none
:metrics :none
:balance formatted-balance
:networks networks
:dropdown-on-press #(rf/dispatch [:show-bottom-sheet
{:content network-filter/view}])}]
{:state (if tokens-loading? :loading :default)
:time-frame :none
:metrics :none
:balance formatted-balance
:networks networks
:dropdown-on-press on-press-network-selector
:show-new-chain-indicator? (when (not-empty networks)
show-new-chain-indicator?)}]
(when (ff/enabled? ::ff/wallet.graph)
[quo/wallet-graph {:time-frame :empty}])
[render-cards cards account-list-ref]
@@ -18,6 +18,7 @@
:network-name :mainnet
:chain-id 1
:related-chain-id 5}]
:wallet/show-new-chain-indicator? false
:wallet/current-viewing-account-address "0x1"
:wallet/current-viewing-account {:path "m/44'/60'/0'/0/1"
:emoji "💎"
@@ -8,41 +8,26 @@
(defn view
[]
(let [selected-networks (rf/sub [:wallet/selected-networks])
selector-state (rf/sub [:wallet/network-filter-selector-state])
color (rf/sub [:profile/customization-color])
network-details (rf/sub [:wallet/network-details])
viewing-account? (rf/sub [:wallet/viewing-account?])
balance-per-chain (if viewing-account?
(rf/sub [:wallet/current-viewing-account-fiat-balance-per-chain])
(rf/sub [:wallet/aggregated-fiat-balance-per-chain]))
mainnet (first network-details)
layer-2-networks (rest network-details)]
network-details (rf/sub [:wallet/network-details])]
[:<>
[quo/drawer-top {:title (i18n/label :t/select-networks)}]
[quo/information-box
{:type :informative
:icon :i/info
:blur? false
:style {:margin-horizontal 20
:margin-bottom 4}}
(i18n/label :t/base-chain-available-info)]
[quo/category
{:list-type :settings
:data [(utils/make-network-item
{:state selector-state
:network-name (:network-name mainnet)
:color color
:networks selected-networks
:label-props (get balance-per-chain (:chain-id mainnet))
:on-change #(rf/dispatch
[:wallet/update-selected-networks
(:network-name
mainnet)])})]}]
[quo/category
{:list-type :settings
:label (i18n/label :t/layer-2)
:data (mapv (fn [network]
(utils/make-network-item
{:state selector-state
:network-name (:network-name network)
{:network-name (:network-name network)
:color color
:networks selected-networks
:label-props (get balance-per-chain (:chain-id network))
:on-change #(rf/dispatch
[:wallet/update-selected-networks
(:network-name
network)])}))
layer-2-networks)}]]))
network-details)}]]))
+3 -1
View File
@@ -78,4 +78,6 @@
;;app starting flow continues in get-profiles-overview
:profile/get-profiles-overview #(rf/dispatch [:profile/get-profiles-overview-success %])
:effects.font/get-font-file-for-initials-avatar
#(rf/dispatch [:font/init-font-file-for-initials-avatar %])}))
#(rf/dispatch [:font/init-font-file-for-initials-avatar %])
;; show new chain indicator to highlight base chain. This will be be removed in v2.35.
:effects.wallet/retrieve-base-chain-indicator-shown nil}))
+5
View File
@@ -47,6 +47,11 @@
:<- [:wallet/ui]
:-> :last-updates-per-address)
(rf/reg-sub
:wallet/show-new-chain-indicator?
:<- [:wallet/ui]
:-> :show-new-chain-indicator?)
(rf/reg-sub
:wallet/latest-update
:<- [:wallet/last-updates-per-address]
+1 -1
View File
@@ -199,7 +199,7 @@ def create_shared_drivers(quantity: int, platform_version: int = 14, device_name
test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
drivers[i].implicitly_wait(implicit_wait)
drivers[i].update_settings({"enforceXPath1": True})
drivers[i].set_network_connection(ConnectionType.ALL_NETWORK_ON)
drivers[i].set_network_connection(ConnectionType.WIFI_ONLY)
return drivers, loop
except (MaxRetryError, AttributeError) as e:
test_suite_data.current_test.testruns[-1].error = str(e)
@@ -710,9 +710,10 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
if not self.chat_1.chat_element_by_text(message_to_disappear).is_element_disappeared(30):
self.errors.append(self.chat_1, "Messages from blocked user is not cleared in public chat ")
self.chat_1.navigate_back_to_home_view()
self.home_1.chats_tab.click()
if not self.home_1.element_by_translation_id("no-messages").is_element_displayed():
self.errors.append("1-1 chat from blocked user is not removed and messages home is not empty!")
# ToDo: enable when https://github.com/status-im/status-mobile/issues/19334 is fixed
# self.home_1.chats_tab.click()
# if not self.home_1.element_by_translation_id("no-messages").is_element_displayed():
# self.errors.append("1-1 chat from blocked user is not removed and messages home is not empty!")
self.chat_1.driver.set_network_connection(ConnectionType.AIRPLANE_MODE)
self.home_2.just_fyi('Send message to public chat while device 1 is offline')
@@ -1244,199 +1245,3 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
self.errors.append(self.home_2, "%s is not listed inside Joined communities tab" % community_name)
self.errors.verify_no_errors()
@pytest.mark.xdist_group(name="new_three_2")
@marks.nightly
class TestCommunityMultipleDeviceMergedThree(MultipleSharedDeviceTestCase):
def prepare_devices(self):
self.drivers, self.loop = create_shared_drivers(2)
self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user,),
(self.device_2.create_user,))))
self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.username_1, self.username_2 = self.home_1.get_username(), self.home_2.get_username()
self.public_key_2 = self.home_2.get_public_key()
self.profile_1 = self.home_1.get_profile_view()
[home.navigate_back_to_home_view() for home in self.homes]
[home.chats_tab.click() for home in self.homes]
self.home_1.add_contact(self.public_key_2)
self.home_2.handle_contact_request(self.username_1)
self.text_message = 'hello'
self.chat_1 = self.home_1.get_chat(self.username_2).click()
self.chat_1.send_message('hey')
self.chat_2 = self.home_2.get_chat(self.username_1).click()
self.home_1.navigate_back_to_home_view()
self.home_1.just_fyi("Open community to message")
self.home_1.communities_tab.click()
self.community_name = "open community"
self.channel_name = 'general'
self.home_1.create_community(community_type="open")
self.community_1, self.community_2 = self.home_1.get_community_view(), self.home_2.get_community_view()
self.community_1.invite_to_community(self.community_name, self.username_2)
self.channel_1 = self.home_1.get_to_community_channel_from_home(self.community_name)
self.community_2.join_community()
self.channel_2 = self.community_2.get_channel(self.channel_name).click()
@marks.testrail_id(741924)
def test_community_mobile_data_and_wi_fi_only_fetching(self):
self.device_2.just_fyi("Receiver turns wi-fi off")
self.device_2.navigate_back_to_home_view()
self.device_2.driver.set_network_connection(ConnectionType.DATA_ONLY)
# ToDo: pop up is not shown on LT emulators, needs more investigation
# self.device_2.turn_wi_fi_off()
#
# for translation in ['which-connection-to-use', 'mobile-and-wifi', 'wifi-only']:
# if not self.device_2.element_by_translation_id(translation).is_element_displayed():
# self.errors.append(self.device_2,
# "Element with text '%s' is not shown when switching to mobile data" % translation)
profile_2 = self.device_2.profile_button.click()
profile_2.syncing_button.scroll_and_click()
profile_2.sync_and_backup_button.click()
profile_2.wi_fi_only_button.click()
self.device_2.click_system_back_button(times=2)
self.home_2.communities_tab.click()
self.home_2.discover_communities_button.click()
if self.home_2.community_card_item.is_element_displayed(10):
self.errors.append(self.home_2,
"Community can be fetched while using mobile data with wi-fi only syncing settings")
message_1 = 'message text 1'
self.channel_1.just_fyi("Sender sends a message in the community channel when receiver is using mobile data")
self.channel_1.send_message(message_1)
self.home_2.click_system_back_button()
self.home_2.get_to_community_channel_from_home(self.community_name)
if not self.channel_2.chat_element_by_text(message_1).is_element_displayed(120):
self.errors.append(self.device_2,
"Can't receive the message '%s' in community when using mobile data" % message_1)
self.device_2.just_fyi("Receiver turns internet off")
self.device_2.driver.set_network_connection(ConnectionType.NO_CONNECTION)
message_2 = 'message text 2'
self.channel_1.just_fyi("Sender sends messages in the community channel and 1-1 chat when receiver is offline")
self.channel_1.send_message(message_2)
self.device_1.navigate_back_to_home_view()
self.device_1.chats_tab.click()
self.home_1.get_chat(self.username_2).click()
message_3 = 'message text 3'
self.chat_1.send_message(message_3)
self.device_2.just_fyi("Receiver turns mobile data on")
self.device_2.driver.set_network_connection(ConnectionType.DATA_ONLY)
if self.channel_2.chat_element_by_text(message_2).is_element_displayed(120):
self.errors.append(
self.device_2,
"Message '%s' in community, which is sent when receiver was offline, is received using mobile data" % message_2)
self.device_2.navigate_back_to_home_view()
self.device_2.chats_tab.click()
self.home_2.get_chat(self.username_1).click()
if not self.chat_2.chat_element_by_text(message_3).is_element_displayed(120):
self.errors.append(
self.device_2,
"Message '%s' in 1-1 chat, which is sent when receiver was offline, is missed" % message_3)
self.device_2.just_fyi("Receiver turns wi-fi on")
self.device_2.driver.set_network_connection(ConnectionType.WIFI_ONLY)
self.home_2.navigate_back_to_home_view()
self.home_2.communities_tab.click()
self.home_2.get_to_community_channel_from_home(self.community_name)
if not self.channel_2.chat_element_by_text(message_2).is_element_displayed(120):
self.errors.append(
self.device_2,
"Message '%s' in community channel, which is sent when receiver was offline, is missed after turning wi-fi on" % message_2)
self.errors.verify_no_errors()
@marks.testrail_id(741925)
def test_community_send_message_from_offline(self):
self.device_1.just_fyi("Device 1 goes offline and send a message in 1-1 chat")
self.device_1.driver.set_network_connection(ConnectionType.NO_CONNECTION)
message_1_1 = 'message in 1-1 chat'
def _send_message_1_1():
self.device_1.navigate_back_to_home_view()
self.device_1.chats_tab.click()
self.home_1.get_chat(self.username_2).click()
self.chat_1.send_message(message_1_1)
self.device_2.just_fyi("Device 2 goes offline and send a message in community")
self.device_2.driver.set_network_connection(ConnectionType.NO_CONNECTION)
message_community = 'message community'
def _send_message_community():
self.device_2.navigate_back_to_home_view()
self.device_2.communities_tab.click()
self.home_2.get_to_community_channel_from_home(self.community_name)
self.channel_2.send_message(message_community)
self.loop.run_until_complete(run_in_parallel(((_send_message_1_1,), (_send_message_community,))))
self.device_1.just_fyi("Device 1 goes back online and checks a message in community channel")
self.device_1.driver.set_network_connection(ConnectionType.WIFI_ONLY)
def _check_message_community():
self.device_1.navigate_back_to_home_view()
self.device_1.communities_tab.click()
self.home_1.get_to_community_channel_from_home(self.community_name)
if not self.channel_1.chat_element_by_text(message_community).is_element_displayed(120):
self.errors.append(
self.device_1,
"Can't receive the message '%s' in community if it's sent from offline" % message_community)
self.device_2.just_fyi("Device 2 goes back online and checks a message in 1-1 chat")
self.device_2.driver.set_network_connection(ConnectionType.WIFI_ONLY)
def _check_message_1_1():
self.device_2.navigate_back_to_home_view()
self.device_2.chats_tab.click()
self.home_2.get_chat(self.username_1).click()
if not self.chat_2.chat_element_by_text(message_1_1).is_element_displayed(120):
self.errors.append(
self.device_1,
"Can't receive the message '%s' in 1-1 chat if it's sent from offline" % message_1_1)
self.loop.run_until_complete(run_in_parallel(((_check_message_community,), (_check_message_1_1,))))
self.errors.verify_no_errors()
@marks.testrail_id(741926)
def test_community_messaging_on_mobile_data(self):
self.device_1.just_fyi("Device 1 turns mobile data on and send a message in community channel")
self.device_1.driver.set_network_connection(ConnectionType.DATA_ONLY)
self.device_2.just_fyi("Device 2 turns mobile data on and checks receiving a message in community channel")
self.device_2.driver.set_network_connection(ConnectionType.DATA_ONLY)
self.device_1.navigate_back_to_home_view()
self.device_1.communities_tab.click()
self.home_1.get_to_community_channel_from_home(self.community_name)
message_community = 'message community'
self.channel_1.send_message(message_community)
self.device_2.navigate_back_to_home_view()
self.device_2.communities_tab.click()
self.home_2.get_to_community_channel_from_home(self.community_name)
if not self.channel_2.chat_element_by_text(message_community).is_element_displayed(60):
self.errors.append(self.channel_2,
"Message with text '%s' was not received in community" % message_community)
self.device_2.just_fyi("Device 2 sends a message in 1-1 chat")
self.device_2.navigate_back_to_home_view()
self.device_2.chats_tab.click()
self.home_2.get_chat(self.username_1).click()
message_1_1 = "message 1-1 chat"
self.chat_2.send_message(message_1_1)
self.device_1.just_fyi("Device 1 checks a message receiving in 1-1 chat")
self.device_1.navigate_back_to_home_view()
self.device_1.chats_tab.click()
self.home_1.get_chat(self.username_2).click()
if not self.chat_1.chat_element_by_text(message_1_1).is_element_displayed(60):
self.errors.append(self.chat_1,
"Message with text '%s' was not received in 1-1 chat" % message_1_1)
self.errors.verify_no_errors()
@@ -41,9 +41,9 @@ class TestWalletCollectibles(MultipleSharedDeviceTestCase):
@marks.testrail_id(741839)
def test_wallet_collectibles_balance(self):
self.wallet_view.collectibles_tab.click()
self.wallet_view.set_network_in_wallet(self.network_name)
self.wallet_view.set_network_in_wallet(self.network_name + ', NEW')
collectibles = {
"BVL": {"quantity": 1,
"BVL": {"quantity": 2,
"info": {"Account": "Account 1",
"Network": "Base",
"category": "Football Player",
@@ -102,8 +102,8 @@ class TestWalletCollectibles(MultipleSharedDeviceTestCase):
self.wallet_view.collectibles_tab_on_select_token_view.click()
time.sleep(5)
self.wallet_view.get_collectible_element('BVL').click()
# self.wallet_view.amount_input_increase_button.click()
# self.wallet_view.confirm_button.click()
self.wallet_view.amount_input_increase_button.click()
self.wallet_view.confirm_button.click()
for text in [self.account_name, self.sender_short_address]:
if not self.wallet_view.from_data_container.get_child_element_by_text(text).is_element_displayed():
self.errors.append(self.wallet_view,
@@ -118,7 +118,7 @@ class TestWalletCollectibles(MultipleSharedDeviceTestCase):
data_to_check = {
'Est. time': ' min',
'Max fees': r"[$]\d+.\d+",
'Recipient gets': '1 '
'Recipient gets': '2 '
}
for key, expected_value in data_to_check.items():
try:
@@ -52,7 +52,7 @@ class TestWalletOneDevice(MultipleSharedDeviceTestCase):
'Mainnet': self.mainnet_balance,
'Arbitrum': self.arb_balance,
'Optimism': self.optimism_balance,
'Base': self.base_balance
'Base, NEW': self.base_balance
}
for network in expected_balances:
-7
View File
@@ -381,10 +381,3 @@ class BaseView(object):
Button(self.driver,
xpath="//*[@resource-id='android:id/resolver_list']//*[@text='%s']" % text_to_click).click_if_shown()
Button(self.driver, xpath="//*[@resource-id='android:id/button_once']").click()
def turn_wi_fi_off(self):
self.driver.swipe(900, 0, 900, 1000)
self.element_by_text('Internet').click()
Button(self.driver, accessibility_id='WiFi').click()
self.element_by_text('Done').click()
self.click_system_back_button_until_presence_of_element(self.chats_tab)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

+1 -2
View File
@@ -120,6 +120,7 @@ class ProfileView(BaseView):
self.recovery_phrase_next_button = Button(self.driver, accessibility_id="Next, icon")
self.recovery_phrase_word_input = EditBox(self.driver, xpath="//android.widget.EditText")
# Notifications
self.profile_notifications_button = Button(self.driver,
accessibility_id="icon, Notifications, label-component, icon")
@@ -141,8 +142,6 @@ class ProfileView(BaseView):
self.sync_plus_button = Button(
self.driver,
xpath="//*[@text='Paired devices']/following-sibling::android.view.ViewGroup[@content-desc='icon']")
self.sync_and_backup_button = Button(self.driver, xpath="//*[@text='Sync and backup']")
self.wi_fi_only_button = Button(self.driver, accessibility_id='wifi-only-action')
# Advanced
self.advanced_button = AdvancedButton(self.driver)
+1 -1
View File
@@ -182,7 +182,7 @@ class WalletView(BaseView):
def set_network_in_wallet(self, network_name: str):
self.network_drop_down.click()
Button(self.driver, accessibility_id="%s, label-component" % network_name.capitalize()).click()
Button(self.driver, accessibility_id="%s, label-component" % network_name).click()
self.network_drop_down.click()
def get_account_element(self, account_name: str = 'Account 1'):
+1
View File
@@ -200,6 +200,7 @@
"bad-fees-description": "Your priority fee is below our suggested parameters.",
"balance": "Balance",
"base": "Base",
"base-chain-available-info": "Base chain is now on Status - view your assets, interact with dApps and swap tokens",
"be-safe-with-secure-cold-wallet": "Be safe with secure cold wallet",
"begin-set-up": "Begin setup",
"below-base-fee": "max fee below base fee",