Skip to content

Commit 9376f9b

Browse files
authored
Merge branch 'develop' into 21233-missing-community-stats
2 parents 4af29a1 + 34cb7d1 commit 9376f9b

11 files changed

+438
-208
lines changed

src/status_im/contexts/keycard/migrate/re_encrypting/events.cljs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@
2727
:callback
2828
(fn [{:keys [error]}]
2929
(if (string/blank? error)
30-
(rf/dispatch [:navigate-to :screen/keycard.migrate.success])
30+
(do
31+
(rf/dispatch [:biometric/disable])
32+
(rf/dispatch [:navigate-to :screen/keycard.migrate.success]))
3133
(rf/dispatch [:navigate-to :screen/keycard.migrate.fail])))}]]})))

src/status_im/contexts/wallet/events.cljs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,16 @@
435435
(rf/reg-event-fx
436436
:wallet/start-bridge
437437
(fn [{:keys [db]}]
438-
(let [view-id (:view-id db)]
439-
(cond-> {:db (assoc-in db [:wallet :ui :send :tx-type] :tx/bridge)}
440-
(= view-id :screen/wallet.accounts)
441-
(assoc :fx
442-
[[:dispatch
443-
[:wallet/wizard-navigate-forward
444-
{:start-flow? true
445-
:flow-id :wallet-bridge-flow}]]])))))
438+
{:db (assoc-in db [:wallet :ui :send :tx-type] :tx/bridge)
439+
:fx [[:dispatch
440+
[:wallet/wizard-navigate-forward
441+
{:start-flow? true
442+
:flow-id :wallet-bridge-flow}]]]}))
443+
444+
(rf/reg-event-fx
445+
:wallet/set-send-tx-type
446+
(fn [{:keys [db]} [type]]
447+
{:db (assoc-in db [:wallet :ui :send :tx-type] type)}))
446448

447449
(rf/reg-event-fx :wallet/select-bridge-network
448450
(fn [{:keys [db]} [{:keys [network-chain-id stack-id]}]]

src/status_im/contexts/wallet/home/view.cljs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,16 @@
9191
{:content buy-token/view}]))
9292
on-bridge-press (rn/use-callback
9393
(fn []
94+
;; For a single account, it starts the bridge flow immediately. For
95+
;; multiple accounts, it sets the transaction type and starts the
96+
;; bridge flow after account selection.
9497
(rf/dispatch [:wallet/clean-send-data])
9598
(when-not multiple-accounts?
9699
(rf/dispatch [:wallet/switch-current-viewing-account
97-
first-account-address]))
98-
(rf/dispatch [:wallet/start-bridge])
100+
first-account-address])
101+
(rf/dispatch [:wallet/start-bridge]))
99102
(when multiple-accounts?
103+
(rf/dispatch [:wallet/set-send-tx-type :tx/bridge])
100104
(rf/dispatch [:open-modal :screen/wallet.select-from])))
101105
[multiple-accounts? first-account-address])
102106
on-swap-press (rn/use-callback
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
import re
2+
import time
3+
4+
import pytest
5+
from selenium.common import TimeoutException
6+
7+
from base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
8+
from tests import marks
9+
from users import transaction_senders
10+
from views.sign_in_view import SignInView
11+
12+
13+
@pytest.mark.xdist_group(name="new_one_2")
14+
@marks.nightly
15+
@marks.secured
16+
@marks.smoke
17+
class TestWalletCollectibles(MultipleSharedDeviceTestCase):
18+
19+
def prepare_devices(self):
20+
self.drivers, self.loop = create_shared_drivers(1)
21+
self.sign_in_view = SignInView(self.drivers[0])
22+
self.sender, self.receiver = transaction_senders['ETH_1'], transaction_senders['ETH_2']
23+
self.sender['wallet_address'] = '0x' + self.sender['address']
24+
self.receiver['wallet_address'] = '0x' + self.receiver['address']
25+
self.sign_in_view.recover_access(passphrase=self.sender['passphrase'])
26+
27+
self.home_view = self.sign_in_view.get_home_view()
28+
self.sender_username = self.home_view.get_username()
29+
self.profile_view = self.home_view.profile_button.click()
30+
self.profile_view.switch_network()
31+
self.sign_in_view.sign_in(user_name=self.sender_username)
32+
self.home_view.wallet_tab.click()
33+
self.wallet_view = self.home_view.get_wallet_view()
34+
self.account_name = 'Account 1'
35+
self.sender_short_address = self.sender['wallet_address'].replace(self.sender['wallet_address'][6:-3],
36+
'…').lower()
37+
self.receiver_short_address = self.receiver['wallet_address'].replace(self.receiver['wallet_address'][6:-3],
38+
'…').lower()
39+
40+
@marks.testrail_id(741839)
41+
def test_wallet_collectibles_balance(self):
42+
self.wallet_view.collectibles_tab.click()
43+
self.wallet_view.set_network_in_wallet('Base')
44+
collectibles = {
45+
"BVL": {"quantity": 2,
46+
"info": {"Account": "Account 1",
47+
"Network": "Base",
48+
"category": "Football Player",
49+
"rank": "Star",
50+
"type": "Modric"}},
51+
"Glitch Punks": {"quantity": 1,
52+
"info": {"Account": "Account 1",
53+
"Network": "Base",
54+
"Race": "Skull Blue",
55+
"Mouth": "Lipstick Green",
56+
"Eyes": "Femme Shade Eyes Variant 3",
57+
"Face": "Pipe",
58+
"Ear Accessory": "Silver Stud Cross Combo",
59+
"Nose": "Bot Nose 3",
60+
"Eye Accessory": "Nouns",
61+
"Head": "Double Spike"}}
62+
}
63+
for collectible_name, data in collectibles.items():
64+
self.wallet_view.just_fyi("Check %s collectible info and image" % collectible_name)
65+
try:
66+
element = self.wallet_view.get_collectible_element(collectible_name)
67+
element.wait_for_element()
68+
except TimeoutException:
69+
self.errors.append(self.wallet_view, "Collectible '%s' is not displayed" % collectible_name)
70+
continue
71+
if element.image_element.is_element_differs_from_template(
72+
'%s_collectible_image_template.png' % collectible_name):
73+
self.errors.append(self.wallet_view, "%s image doesn't match expected template" % collectible_name)
74+
if element.quantity != data['quantity']:
75+
self.errors.append(self.wallet_view, "%s quantity %s doesn't match expected %s" % (
76+
collectible_name, element.quantity, data['quantity']))
77+
self.wallet_view.just_fyi("Check %s collectible expanded info" % collectible_name)
78+
element.click()
79+
if self.wallet_view.expanded_collectible_image.is_element_differs_from_template(
80+
'%s_expanded_collectible_image_template.png' % collectible_name):
81+
self.errors.append(self.wallet_view,
82+
"%s expanded image doesn't match expected template" % collectible_name)
83+
self.wallet_view.driver.swipe(500, 2000, 500, 300)
84+
for item, expected_text in data['info'].items():
85+
try:
86+
text = self.wallet_view.get_data_item_element_text(item)
87+
if text != expected_text:
88+
self.errors.append(self.wallet_view, "%s: shown %s text '%s' doesn't match expected '%s'" % (
89+
collectible_name, item, text, expected_text))
90+
except TimeoutException:
91+
self.errors.append(self.wallet_view, "%s: %s data item is not shown" % (collectible_name, item))
92+
self.wallet_view.click_system_back_button()
93+
self.errors.verify_no_errors()
94+
95+
@marks.testrail_id(741840)
96+
def test_wallet_send_collectible(self):
97+
self.wallet_view.reopen_app(user_name=self.sender_username)
98+
self.wallet_view.send_button.click()
99+
self.wallet_view.address_text_input.send_keys(self.receiver['wallet_address'])
100+
self.wallet_view.continue_button.click()
101+
self.wallet_view.collectibles_tab_on_select_token_view.click()
102+
time.sleep(5)
103+
self.wallet_view.get_collectible_element('BVL').click()
104+
self.wallet_view.amount_input_increase_button.click()
105+
self.wallet_view.confirm_button.click()
106+
expected_text = '2 BVL #47'
107+
for text in [self.account_name, self.sender_short_address, expected_text]:
108+
if not self.wallet_view.from_data_container.get_child_element_by_text(text).is_element_displayed():
109+
self.errors.append(self.wallet_view,
110+
"Text %s is not shown in 'From' container on the Review Send page" % text)
111+
for text in [self.receiver_short_address, expected_text]:
112+
if not self.wallet_view.to_data_container.get_child_element_by_text(text).is_element_displayed():
113+
self.errors.append(self.wallet_view,
114+
"Text %s is not shown in 'To' container on the Review Send page" % text)
115+
data_to_check = {
116+
'Est. time': ' min',
117+
'Max fees': r"[$]\d+.\d+",
118+
'Recipient gets': '2 '
119+
}
120+
for key, expected_value in data_to_check.items():
121+
try:
122+
text = self.wallet_view.get_data_item_element_text(data_item_name=key)
123+
if key == 'Max fees':
124+
if not re.findall(expected_value, text):
125+
self.errors.append(self.wallet_view,
126+
"Max fee is not a number - %s on the Review Send page" % text)
127+
else:
128+
if text != expected_value:
129+
self.errors.append(
130+
self.wallet_view,
131+
"%s text %s doesn't match expected %s on the Review Send page" % (
132+
key, text, expected_value))
133+
except TimeoutException:
134+
self.errors.append(self.wallet_view, "%s is not shown on the Review Send page" % key)
135+
136+
self.wallet_view.slide_button_track.slide()
137+
if not self.wallet_view.password_input.is_element_displayed():
138+
self.errors.append(self.wallet_view, "Can't confirm transaction")
139+
140+
self.wallet_view.click_system_back_button(times=6)
141+
self.errors.verify_no_errors()
142+
143+
@marks.testrail_id(741841)
144+
def test_wallet_collectible_send_from_expanded_info_view(self):
145+
# self.wallet_view.reopen_app(user_name=self.sender_username)
146+
self.wallet_view.collectibles_tab.click()
147+
self.wallet_view.get_collectible_element('Glitch Punks').wait_for_element().click()
148+
self.wallet_view.send_from_collectible_info_button.click()
149+
self.wallet_view.address_text_input.send_keys(self.receiver['wallet_address'])
150+
self.wallet_view.continue_button.click()
151+
expected_text = '1 Glitch Punks #3422'
152+
for text in [self.account_name, self.sender_short_address, expected_text]:
153+
if not self.wallet_view.from_data_container.get_child_element_by_text(text).is_element_displayed():
154+
self.errors.append(self.wallet_view,
155+
"Text %s is not shown in 'From' container on the Review Send page" % text)
156+
for text in [self.receiver_short_address, expected_text]:
157+
if not self.wallet_view.to_data_container.get_child_element_by_text(text).is_element_displayed():
158+
self.errors.append(self.wallet_view,
159+
"Text %s is not shown in 'To' container on the Review Send page" % text)
160+
data_to_check = {
161+
'Est. time': ' min',
162+
'Max fees': r"[$]\d+.\d+",
163+
'Recipient gets': '1 '
164+
}
165+
for key, expected_value in data_to_check.items():
166+
try:
167+
text = self.wallet_view.get_data_item_element_text(data_item_name=key)
168+
if key == 'Max fees':
169+
if not re.findall(expected_value, text):
170+
self.errors.append(self.wallet_view,
171+
"Max fee is not a number - %s on the Review Send page" % text)
172+
else:
173+
if text != expected_value:
174+
self.errors.append(
175+
self.wallet_view,
176+
"'%s' text '%s' doesn't match expected '%s' on the Review Send page" % (
177+
key, text, expected_value))
178+
except TimeoutException:
179+
self.errors.append(self.wallet_view, "%s is not shown on the Review Send page" % key)
180+
181+
self.wallet_view.slide_button_track.slide()
182+
if not self.wallet_view.password_input.is_element_displayed():
183+
self.errors.append(self.wallet_view, "Can't confirm transaction")
184+
185+
self.errors.verify_no_errors()

0 commit comments

Comments
 (0)