Compare commits
53
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f627b8d170 | ||
|
|
9de4456d7a | ||
|
|
46a64b7fab | ||
|
|
9a3cdc4f8b | ||
|
|
1d84c30de3 | ||
|
|
8133c4c5f0 | ||
|
|
e21ece0f8d | ||
|
|
89828ba7fd | ||
|
|
8215498ddb | ||
|
|
ae6205c874 | ||
|
|
328f9686c9 | ||
|
|
9f412577d7 | ||
|
|
11bd340a94 | ||
|
|
3c102b9797 | ||
|
|
bd4b7fc49d | ||
|
|
29252336cc | ||
|
|
4b5b4f9099 | ||
|
|
28da6f8bfc | ||
|
|
e0fe0d2dbd | ||
|
|
07cf34ad60 | ||
|
|
7c4c9a9fc0 | ||
|
|
59ceddbaad | ||
|
|
99ccbc3383 | ||
|
|
8c2d5398b0 | ||
|
|
67c83b13e3 | ||
|
|
11a84ba145 | ||
|
|
1f5bb579c9 | ||
|
|
4586f8007c | ||
|
|
55c620e59d | ||
|
|
525609f0af | ||
|
|
90653955a6 | ||
|
|
d27ab756d0 | ||
|
|
c6a1db6334 | ||
|
|
73777e052e | ||
|
|
a6d3fc3742 | ||
|
|
a671c70838 | ||
|
|
a45991b6dc | ||
|
|
2e9fa22e4f | ||
|
|
737d8c4d53 | ||
|
|
3aa7e103f7 | ||
|
|
c1d2d44da4 | ||
|
|
0fed8113d1 | ||
|
|
53c35cb554 | ||
|
|
be82365542 | ||
|
|
eae8a65597 | ||
|
|
fe54a25a3a | ||
|
|
15a4219ef4 | ||
|
|
2ffbdac89e | ||
|
|
402eb8397d | ||
|
|
ff88049a08 | ||
|
|
cee21241d4 | ||
|
|
60ad7c8a29 | ||
|
|
4989c92780 |
@@ -436,10 +436,11 @@ android-clean: ##@prepare Clean Gradle state
|
||||
rm -rf ~/.gradle
|
||||
|
||||
|
||||
android-ports: export FLOWSTORM_PORT := 7722
|
||||
android-ports: export FLOWSTORM_PORT ?= 7722
|
||||
android-ports: export TARGET := android-sdk
|
||||
android-ports: export RCT_METRO_PORT ?= 8081
|
||||
android-ports: ##@other Add proxies to Android Device/Simulator
|
||||
adb reverse tcp:8081 tcp:8081 && \
|
||||
adb reverse tcp:$(RCT_METRO_PORT) tcp:$(RCT_METRO_PORT) && \
|
||||
adb reverse tcp:3449 tcp:3449 && \
|
||||
adb reverse tcp:4567 tcp:4567 && \
|
||||
adb reverse tcp:$(FLOWSTORM_PORT) tcp:$(FLOWSTORM_PORT) && \
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
hermesEnabled ? lib.getEnvWithDefault "ORG_GRADLE_PROJECT_hermesEnabled" "true",
|
||||
buildUrl ? lib.getEnvWithDefault "ORG_GRADLE_PROJECT_buildUrl" null,
|
||||
statusGoSrcOverride ? lib.getEnvWithDefault "STATUS_GO_SRC_OVERRIDE" null,
|
||||
reactMetroPort ? lib.getEnvWithDefault "RCT_METRO_PORT" 8081,
|
||||
# If APKs should be split based on architectures
|
||||
androidAbiSplit ? lib.getEnvWithDefault "ANDROID_ABI_SPLIT" "true",
|
||||
# Android architectures to build for
|
||||
@@ -158,6 +159,7 @@ in stdenv.mkDerivation rec {
|
||||
--no-build-cache \
|
||||
--parallel \
|
||||
-Dmaven.repo.local='${deps.gradle}' \
|
||||
-PreactNativeDevServerPort=${toString reactMetroPort} \
|
||||
assemble${gradleBuildType}
|
||||
'';
|
||||
in
|
||||
|
||||
@@ -6,7 +6,7 @@ if pgrep -f 'shadow-cljs watch mobile' > /dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if pgrep -f 'react-native start' > /dev/null; then
|
||||
if pgrep -f "react-native start --port=${RCT_METRO_PORT:-8081}" > /dev/null; then
|
||||
echo "Error: make run-metro is already running in another terminal" >&2
|
||||
echo "Please close that terminal before running this command." >&2
|
||||
exit 1
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if pgrep -f 'react-native start' > /dev/null; then
|
||||
if pgrep -f "react-native start --port=${RCT_METRO_PORT:-8081}" > /dev/null; then
|
||||
echo "Info: metro is already running in another terminal"
|
||||
else
|
||||
echo "Info: starting a new metro terminal"
|
||||
react-native start --reset-cache
|
||||
react-native start --port=${RCT_METRO_PORT:-8081} --reset-cache
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
TIMEOUT=10 # Metro should not take this long to start.
|
||||
|
||||
while [ "${TIMEOUT}" -gt 0 ]; do
|
||||
if ! lsof -i:8081 &> /dev/null; then
|
||||
if ! lsof -i:"${RCT_METRO_PORT:-8081}" &> /dev/null; then
|
||||
echo "."
|
||||
sleep 1
|
||||
((TIMEOUT--))
|
||||
|
||||
@@ -98,16 +98,16 @@
|
||||
(update :categories <-categories-rpc)
|
||||
(assoc :role-permissions?
|
||||
(->> community
|
||||
:token-permissions
|
||||
:tokenPermissions
|
||||
vals
|
||||
(some role-permission?)))
|
||||
(assoc :membership-permissions?
|
||||
(->> community
|
||||
:token-permissions
|
||||
:tokenPermissions
|
||||
vals
|
||||
(some membership-permission?)))
|
||||
(assoc :token-images
|
||||
(reduce (fn [acc {sym :symbol image :image}]
|
||||
(assoc acc sym image))
|
||||
{}
|
||||
(:tokens-metadata community))))))
|
||||
(:communityTokensMetadata community))))))
|
||||
|
||||
@@ -102,7 +102,8 @@
|
||||
(let [current-theme-type (get-in cofx [:db :profile/profile :appearance])]
|
||||
(when (and (multiaccounts.model/logged-in? db)
|
||||
(= current-theme-type status-im.constants/theme-type-system))
|
||||
{:dispatch [:theme/switch]})))
|
||||
{:profile.settings/switch-theme-fx
|
||||
[(get-in db [:profile/profile :appearance]) (:view-id db)]})))
|
||||
|
||||
(defn- on-biometric-auth-fail
|
||||
[{:keys [code]}]
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
(ns status-im.common.theme.effects
|
||||
(:require
|
||||
[status-im.common.theme.core :as theme]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(rf/reg-fx :theme/legacy-theme-fx
|
||||
(fn [theme]
|
||||
(theme/set-legacy-theme theme)))
|
||||
@@ -1,8 +1,7 @@
|
||||
(ns status-im.common.theme.events
|
||||
(:require
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.common.theme.core :as theme]
|
||||
[status-im.common.theme.utils :as utils]))
|
||||
[status-im.common.theme.core :as theme]))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:theme/init-theme
|
||||
@@ -11,16 +10,5 @@
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
:theme/switch
|
||||
(fn [{db :db} [{:keys [theme view-id theme-type]}]]
|
||||
"Switches the theme and triggers related effects.
|
||||
Parameters:
|
||||
- theme: Optional theme keyword to apply. If not provided, defaults to the theme determined by theme-type.
|
||||
- theme-type: Optional theme type to determine the theme. If not provided, defaults to the theme type from the user's profile.
|
||||
- view-id: Optional view ID for updating status color. If not provided, uses the current view ID from the database."
|
||||
(let [theme-type (or theme-type (get-in db [:profile/profile :appearance]))
|
||||
theme (or theme (utils/theme-type->theme-value theme-type))]
|
||||
{:db (assoc db :theme theme)
|
||||
:fx [[:theme/legacy-theme-fx theme]
|
||||
[:dispatch
|
||||
[:reload-status-nav-color
|
||||
(or view-id (:view-id db))]]]})))
|
||||
(fn [{db :db} [theme]]
|
||||
{:db (assoc db :theme theme)}))
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
(ns status-im.common.theme.utils
|
||||
(:require
|
||||
[status-im.common.theme.core :as theme]
|
||||
[status-im.constants :as constants]))
|
||||
|
||||
(defn theme-type->theme-value
|
||||
"Converts theme type identifier to a theme keyword.
|
||||
Returns `:light` or `:dark` based on `theme-type`:
|
||||
- `theme-type-light` (1): Light theme.
|
||||
- `theme-type-dark` (2): Dark theme.
|
||||
- `theme-type-system` (0): Uses system preference."
|
||||
[theme-type]
|
||||
(condp = theme-type
|
||||
constants/theme-type-dark :dark
|
||||
constants/theme-type-light :light
|
||||
constants/theme-type-system (if (theme/device-theme-dark?) :dark :light)
|
||||
:dark))
|
||||
@@ -19,10 +19,10 @@
|
||||
:icon-name :i/close
|
||||
:right-side [{:icon-name (if light? :i/dark :i/light)
|
||||
:on-press #(if light?
|
||||
(rf/dispatch [:theme/switch {:theme :dark}])
|
||||
(rf/dispatch [:theme/switch {:theme :light}]))}]
|
||||
(rf/dispatch [:theme/switch :dark])
|
||||
(rf/dispatch [:theme/switch :light]))}]
|
||||
:on-press #(if (or logged-in? (not= (rf/sub [:view-id]) :quo-preview))
|
||||
(rf/dispatch [:navigate-back])
|
||||
(do
|
||||
(rf/dispatch [:theme/switch {:theme :dark}])
|
||||
(rf/dispatch [:theme/switch :dark])
|
||||
(rf/dispatch [:init-root root])))}]))
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
(fn []
|
||||
(rn/use-effect (fn []
|
||||
(when @blur?
|
||||
(rf/dispatch [:theme/switch {:theme :dark}])))
|
||||
(rf/dispatch [:theme/switch :dark])))
|
||||
[@blur?])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[rn/view
|
||||
|
||||
@@ -377,8 +377,8 @@
|
||||
(rn/use-effect (fn []
|
||||
(when blur-dark-only?
|
||||
(if blur?
|
||||
(rf/dispatch [:theme/switch {:theme :dark}])
|
||||
(rf/dispatch [:theme/switch {:theme :light}]))))
|
||||
(rf/dispatch [:theme/switch :dark])
|
||||
(rf/dispatch [:theme/switch :light]))))
|
||||
[blur? blur-dark-only?])
|
||||
[rn/view
|
||||
{:style {:top (safe-area/get-top)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
[native-module.core :as native-module]
|
||||
[status-im.common.keychain.events :as keychain]
|
||||
[status-im.config :as config]
|
||||
[status-im.constants :as constants]
|
||||
status-im.contexts.profile.login.effects
|
||||
[status-im.contexts.profile.rpc :as profile.rpc]
|
||||
[status-im.feature-flags :as ff]
|
||||
@@ -79,7 +80,11 @@
|
||||
[[:dispatch [:onboarding/finalize-setup]]]
|
||||
|
||||
:else
|
||||
[[:dispatch [:init-root :shell-stack]]
|
||||
[[:profile.settings/switch-theme-fx
|
||||
[(or (:appearance settings)
|
||||
constants/theme-type-dark)
|
||||
:shell-stack]]
|
||||
[:dispatch [:init-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
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
(ns status-im.contexts.profile.settings.effects
|
||||
(:require [native-module.core :as native-module]
|
||||
[re-frame.core :as re-frame]
|
||||
[react-native.platform :as platform]))
|
||||
[react-native.platform :as platform]
|
||||
[status-im.common.theme.core :as theme]
|
||||
[status-im.constants :as constants]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:profile.settings/blank-preview-flag-changed
|
||||
@@ -13,3 +16,15 @@
|
||||
(fn [value]
|
||||
(when platform/android?
|
||||
(native-module/toggle-webview-debug value))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:profile.settings/switch-theme-fx
|
||||
(fn [[theme-type view-id]]
|
||||
(let [theme (if (or (= theme-type constants/theme-type-dark)
|
||||
(and (= theme-type constants/theme-type-system)
|
||||
(theme/device-theme-dark?)))
|
||||
:dark
|
||||
:light)]
|
||||
(theme/set-legacy-theme theme)
|
||||
(rf/dispatch [:theme/switch theme])
|
||||
(rf/dispatch [:reload-status-nav-color view-id]))))
|
||||
|
||||
@@ -95,7 +95,14 @@
|
||||
(rf/reg-event-fx :profile.settings/change-appearance
|
||||
(fn [_ [theme]]
|
||||
{:fx [[:dispatch [:profile.settings/profile-update :appearance theme]]
|
||||
[:dispatch [:theme/switch {:theme-type theme}]]]}))
|
||||
[:profile.settings/switch-theme-fx [theme :appearance]]]}))
|
||||
|
||||
(rf/reg-event-fx :profile.settings/switch-theme
|
||||
(fn [{:keys [db]} [theme view-id]]
|
||||
(let [theme (or theme
|
||||
(get-in db [:profile/profile :appearance])
|
||||
constants/theme-type-dark)]
|
||||
{:fx [[:profile.settings/switch-theme-fx [theme view-id]]]})))
|
||||
|
||||
(rf/reg-fx :profile.settings/get-profile-picture
|
||||
(fn [key-uid]
|
||||
|
||||
@@ -1,47 +1,33 @@
|
||||
(ns status-im.contexts.shell.qr-reader.sheets.scanned-wallet-address
|
||||
(:require
|
||||
[quo.core :as quo]
|
||||
[react-native.clipboard :as clipboard]
|
||||
[status-im.contexts.wallet.common.utils :as utils]
|
||||
[status-im.contexts.wallet.common.utils.networks :as network-utils]
|
||||
[status-im.feature-flags :as ff]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn- copy-address
|
||||
[address]
|
||||
(clipboard/set-string address)
|
||||
(rf/dispatch [:toasts/upsert
|
||||
{:type :positive
|
||||
:text (i18n/label :t/address-copied)}]))
|
||||
|
||||
#_(defn- send-to-address
|
||||
[address]
|
||||
(let [[_ split-address] (network-utils/split-network-full-address address)]
|
||||
(rf/dispatch
|
||||
[:wallet/select-send-address
|
||||
{:address address
|
||||
:recipient {:recipient-type :address
|
||||
:label (utils/get-shortened-address split-address)}
|
||||
:stack-id :wallet-select-address
|
||||
:start-flow? true}])))
|
||||
|
||||
(defn view
|
||||
[address]
|
||||
[:<>
|
||||
[quo/drawer-top {:title address :type :address}]
|
||||
[quo/action-drawer
|
||||
[[{:icon :i/copy
|
||||
:accessibility-label :send-asset
|
||||
:label (i18n/label :t/copy-address)
|
||||
:on-press #(copy-address address)}
|
||||
;; Originally, the flow went to the send flow, but it has been removed to avoid bugs,
|
||||
;; please check https://github.com/status-im/status-mobile/issues/20972 for more context
|
||||
;; The previous code has been commented out to be reintroduced in the future easily.
|
||||
#_{:icon :i/send
|
||||
(let [[_ splitted-address] (network-utils/split-network-full-address address)]
|
||||
[:<>
|
||||
[quo/drawer-top
|
||||
{:title address
|
||||
:type :address}]
|
||||
[quo/action-drawer
|
||||
[[{:icon :i/send
|
||||
:accessibility-label :send-asset
|
||||
:label (i18n/label :t/send-to-this-address)
|
||||
:on-press #(send-to-address address)}
|
||||
(when (ff/enabled? :ff/wallet.saved-addresses)
|
||||
{:icon :i/save
|
||||
:accessibility-label :save-address
|
||||
:label (i18n/label :t/save-address)
|
||||
:on-press #(js/alert "feature not implemented")})]]]])
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:wallet/select-send-address
|
||||
{:address address
|
||||
:recipient {:recipient-type :address
|
||||
:label (utils/get-shortened-address
|
||||
splitted-address)}
|
||||
:stack-id :wallet-select-address
|
||||
:start-flow? true}]))}
|
||||
(when (ff/enabled? :ff/wallet.saved-addresses)
|
||||
{:icon :i/save
|
||||
:accessibility-label :save-address
|
||||
:label (i18n/label :t/save-address)
|
||||
:on-press #(js/alert "feature not implemented")})]]]]))
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
|
||||
(defn collectible-balance
|
||||
[collectible]
|
||||
(let [balance (-> collectible
|
||||
:ownership
|
||||
first
|
||||
:balance
|
||||
js/parseInt)]
|
||||
(if (js/Number.isNaN balance) 0 balance)))
|
||||
(-> collectible
|
||||
:ownership
|
||||
first
|
||||
:balance
|
||||
js/parseInt))
|
||||
|
||||
(def supported-collectible-types
|
||||
#{"image/jpeg"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
status-im.common.peer-stats.events
|
||||
status-im.common.shared-urls.events
|
||||
status-im.common.signals.events
|
||||
status-im.common.theme.effects
|
||||
status-im.common.theme.events
|
||||
[status-im.common.toasts.events]
|
||||
status-im.common.universal-links
|
||||
|
||||
@@ -74,7 +74,9 @@
|
||||
(let [[status-bar-theme] (get-status-nav-color root-id theme)
|
||||
root (get (roots/roots status-bar-theme) root-id)]
|
||||
(dismiss-all-modals)
|
||||
(rf/dispatch [:theme/switch {:view-id root-id}])
|
||||
(rf/dispatch [:profile.settings/switch-theme
|
||||
(get roots/themes root-id)
|
||||
root-id])
|
||||
(reset! state/root-id (or (get-in root [:root :stack :id]) root-id))
|
||||
(navigation/set-root root)
|
||||
(state/navigation-state-reset [{:id root-id
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
(ns status-im.navigation.roots
|
||||
(:require
|
||||
[quo.foundations.colors :as colors]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.navigation.options :as options]))
|
||||
|
||||
;; Theme Order for navigation roots
|
||||
;; 1. Themes hardcoded in below map
|
||||
;; 2. If nil or no entry in map, then theme stored in
|
||||
;; [:db :profile/profile :appearance] will be used (for mulitaccounts)
|
||||
;; 3). Fallback theme - Dark
|
||||
(def themes
|
||||
{:screen/onboarding.intro constants/theme-type-dark
|
||||
:screen/profile.profiles constants/theme-type-dark
|
||||
:shell-stack nil})
|
||||
|
||||
(defn roots-internal
|
||||
[status-bar-theme]
|
||||
{:screen/onboarding.intro
|
||||
|
||||
@@ -12,10 +12,9 @@
|
||||
[re-frame.events :as rf-events]
|
||||
[re-frame.registrar :as rf-registrar]
|
||||
[re-frame.subs :as rf-subs]
|
||||
[taoensso.timbre :as log]
|
||||
[taoensso.timbre :as log] ;; We must require this namespace to register the custom cljs.test
|
||||
;; directive `match-strict?`.
|
||||
test-helpers.matchers))
|
||||
;; We must require `test-helpers.matchers` this namespace to register the custom cljs.test
|
||||
;; directive `match-strict?`.
|
||||
|
||||
(defn db
|
||||
"A simple wrapper to get the latest value from the app db."
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "test/set-api-proxy-test",
|
||||
"commit-sha1": "ca7e72ec062c9abd9b8f9eae7c96667854f69321",
|
||||
"src-sha256": "1236hj7l9sj0d2gpij584lzpa2dnh5mv9d6fp0iba8sn3pb9jca3"
|
||||
"version": "logger-check",
|
||||
"commit-sha1": "156b848c1a0b4b07b249f453f6b7b82a5592f09c",
|
||||
"src-sha256": "1sq62z1zg0jnbw1yzds4f0d26kvakyqw3b1zkwpl2mhfvm344j68"
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import logging
|
||||
import time
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from json import JSONDecodeError
|
||||
from os import environ
|
||||
from typing import List
|
||||
|
||||
import pytest
|
||||
import pytz
|
||||
import requests
|
||||
from selenium.common import TimeoutException
|
||||
|
||||
@@ -38,7 +40,7 @@ class NetworkApi:
|
||||
return self.send_etherscan_request(params)
|
||||
|
||||
def get_transactions(self, address: str) -> List[dict]:
|
||||
params = {'module': 'account', 'action': 'txlist', 'address': address, 'sort': 'desc'}
|
||||
params = {'module': 'account', 'action': 'txlist', 'address': address, 'page': 1, 'offset': 10, 'sort': 'desc'}
|
||||
return self.send_etherscan_request(params)
|
||||
|
||||
def is_transaction_successful(self, transaction_hash: str) -> int:
|
||||
@@ -106,22 +108,28 @@ class NetworkApi:
|
||||
self.log("Failed iterate transactions(Etherscan unexpected error): " + str(e))
|
||||
continue
|
||||
|
||||
def wait_for_confirmation_of_transaction(self, address, amount, confirmations=6, token=False):
|
||||
def wait_for_confirmation_of_transaction(self, address, tx_time, confirmations=7, token=False):
|
||||
expected_tx_timestamp = datetime.strptime(tx_time, "%Y-%m-%dT%H:%M:%S%z").replace(tzinfo=pytz.UTC)
|
||||
start_time = time.time()
|
||||
if token:
|
||||
token_info = "token transaction"
|
||||
else:
|
||||
token_info = "ETH transaction"
|
||||
self.log('Waiting %s %s for %s to have %s confirmations' % (amount, token_info, address, confirmations))
|
||||
self.log('Waiting for %s of %s to have %s confirmations' % (token_info, address, confirmations))
|
||||
while round(time.time() - start_time, ndigits=2) < 600: # should be < idleTimeout capability
|
||||
transaction = self.find_transaction_by_unique_amount(address, amount, token)
|
||||
if token:
|
||||
transaction = self.get_token_transactions(address)[0]
|
||||
else:
|
||||
transaction = self.get_transactions(address)[0]
|
||||
tx_timestamp = datetime.fromtimestamp(int(transaction['timeStamp'])).replace(tzinfo=pytz.UTC)
|
||||
if tx_timestamp > expected_tx_timestamp:
|
||||
if int(transaction['confirmations']) >= confirmations:
|
||||
return
|
||||
time.sleep(20)
|
||||
self.log(
|
||||
'Expected amount of confirmations is %s, in fact %s' % (confirmations, transaction['confirmations']))
|
||||
if int(transaction['confirmations']) >= confirmations:
|
||||
return
|
||||
time.sleep(20)
|
||||
pytest.fail('Transaction with amount %s was not confirmed, address is %s, still has %s confirmations' % (
|
||||
amount, address, int(transaction['confirmations'])))
|
||||
pytest.fail('The last transaction was not confirmed, address is %s, still has %s confirmations' % (
|
||||
address, int(transaction['confirmations'])))
|
||||
|
||||
def verify_balance_is_updated(self, initial_balance, recipient_address, wait_time=360):
|
||||
counter = 0
|
||||
@@ -142,7 +150,7 @@ class NetworkApi:
|
||||
balance = round(self.get_balance(address), 4)
|
||||
if balance == expected_balance:
|
||||
return
|
||||
time.sleep(10)
|
||||
time.sleep(20)
|
||||
raise TimeoutException(
|
||||
'balance is not updated on Etherscan, it is %s but expected to be %s' % (balance, expected_balance))
|
||||
|
||||
|
||||
@@ -17,13 +17,14 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
|
||||
|
||||
self.home = self.sign_in.create_user(username=self.username)
|
||||
self.home.communities_tab.click_until_presence_of_element(self.home.plus_community_button)
|
||||
self.community_name = "open community"
|
||||
self.open_community_name = "open community"
|
||||
self.channel_name = "general"
|
||||
self.community = self.home.create_community(community_type="open")
|
||||
self.profile_view = self.home.get_profile_view()
|
||||
self.browser_view = self.home.get_dapp_view()
|
||||
self.home.get_chat(self.community_name, community=True).click()
|
||||
self.home.get_chat(self.open_community_name, community=True).click()
|
||||
self.community_view = self.home.get_community_view()
|
||||
self.open_community_url = self.community_view.copy_community_link()
|
||||
self.channel = self.community_view.get_channel(self.channel_name).click()
|
||||
|
||||
@marks.testrail_id(704613)
|
||||
@@ -39,7 +40,6 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
|
||||
self.channel.send_message(url)
|
||||
self.channel.chat_element_by_text(url).click_on_link_inside_message_body()
|
||||
if self.channel.profile_send_contact_request_button.is_element_displayed(10):
|
||||
# username_text = self.profile_view.default_username_text.text
|
||||
username_text = self.profile_view.contact_name_text.text
|
||||
if not (username_text.endswith(url[-6:]) or username_text == text):
|
||||
self.errors.append("Incorrect username is shown for profile url %s" % url)
|
||||
@@ -47,34 +47,10 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
|
||||
self.errors.append("Profile was not opened by the profile url %s" % url)
|
||||
self.profile_view.close_button.click()
|
||||
|
||||
community_urls = {
|
||||
"https://status.app/c/ixyACjgKDVNOVCBjb21tdW5pdHkSHHJlcXVpcmUgMTAgU05UIEdvZXJsaSB0byB1c2UYASIHI2VhYjcwMAM=#zQ3shUeGnhM33QW4g9JfYfeLFAH9ZwbDboNYn5exCR7S3ii1y":
|
||||
"SNT community",
|
||||
"https://status.app/c/G0UAAMTyNsn2QZDEG0EXftOl8pOEfwEBOOSA_YTfIk85xmADDgINGmxpUHAXzK36bN0fK42Xf4YD2yjPk1z2pbFwFw==#zQ3sheoNX5kiuM393TJ6xDnL57aQoiwFWEuJnazJ6W2eNuh9u":
|
||||
"open community",
|
||||
"https://status.app/c/G00AAGS9TbI9mSR-ZNmFrhRjNuEeXAAbcAIUaLLJyjMOG3ACJQ12oIHD78QhzO9s_T5bUeU7rnATWJg3mGgTUemrAg==#zQ3shp9f5M3uyMpwTi3rFpFrP6WCWmNsW9pgK9cjXVTaf2vgj":
|
||||
"closed community"
|
||||
}
|
||||
for url, text in community_urls.items():
|
||||
self.channel.just_fyi("Opening community '%s' by the url %s" % (text, url))
|
||||
self.channel.chat_message_input.clear()
|
||||
self.channel.send_message(url)
|
||||
self.channel.chat_element_by_text(url).click_on_link_inside_message_body()
|
||||
if text == 'SNT community':
|
||||
if self.community_view.community_title.text != text:
|
||||
self.errors.append("Community '%s' was not requested to join by the url %s" % (text, url))
|
||||
else:
|
||||
if not self.community_view.join_button.is_element_displayed(
|
||||
10) or self.community_view.community_title.text != text:
|
||||
self.errors.append("Community '%s' was not requested to join by the url %s" % (text, url))
|
||||
if text != "closed community": # the last one
|
||||
self.home.navigate_back_to_home_view()
|
||||
self.home.get_to_community_channel_from_home(self.community_name)
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702775)
|
||||
def test_links_deep_links(self):
|
||||
def test_links_deep_links_profile(self):
|
||||
self.home.navigate_back_to_home_view()
|
||||
self.home.browser_tab.click()
|
||||
|
||||
@@ -87,7 +63,6 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
|
||||
for link, text in profile_links.items():
|
||||
self.channel.just_fyi("Opening profile link %s" % link)
|
||||
self.browser_view.open_url(link)
|
||||
# shown_name_text = self.profile_view.default_username_text.text
|
||||
shown_name_text = self.profile_view.contact_name_text.text
|
||||
if text:
|
||||
name_is_shown = shown_name_text == text or shown_name_text.endswith(link[-6:])
|
||||
@@ -97,25 +72,42 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
|
||||
self.errors.append("Profile was not opened by the profile deep link %s" % link)
|
||||
self.browser_view.click_system_back_button()
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(739307)
|
||||
def test_deep_links_communities(self):
|
||||
closed_community_name, snt_community_name = "closed community", "SNT community"
|
||||
self.home.navigate_back_to_home_view()
|
||||
self.home.create_community(community_type="closed")
|
||||
if not self.community_view.community_options_button.is_element_displayed():
|
||||
self.home.get_chat(closed_community_name, community=True).click()
|
||||
closed_community_url = self.community_view.copy_community_link()
|
||||
self.home.navigate_back_to_home_view()
|
||||
self.home.create_community(community_type="token-gated")
|
||||
if not self.community_view.community_options_button.is_element_displayed():
|
||||
self.home.get_chat(snt_community_name, community=True).click()
|
||||
snt_community_url = self.community_view.copy_community_link()
|
||||
self.home.reopen_app(sign_in=False)
|
||||
self.sign_in.create_user(username="second user", first_user=False)
|
||||
self.home.browser_tab.click()
|
||||
|
||||
old, new = "https://status.app/", "status-app://"
|
||||
community_links = {
|
||||
"status.app://c/ixyACjgKDVNOVCBjb21tdW5pdHkSHHJlcXVpcmUgMTAgU05UIEdvZXJsaSB0byB1c2UYASIHI2VhYjcwMAM=#zQ3shUeGnhM33QW4g9JfYfeLFAH9ZwbDboNYn5exCR7S3ii1y":
|
||||
"SNT community",
|
||||
"status.app://c/G0UAAMTyNsn2QZDEG0EXftOl8pOEfwEBOOSA_YTfIk85xmADDgINGmxpUHAXzK36bN0fK42Xf4YD2yjPk1z2pbFwFw==#zQ3sheoNX5kiuM393TJ6xDnL57aQoiwFWEuJnazJ6W2eNuh9u":
|
||||
"open community",
|
||||
"status.app://c/G00AAGS9TbI9mSR-ZNmFrhRjNuEeXAAbcAIUaLLJyjMOG3ACJQ12oIHD78QhzO9s_T5bUeU7rnATWJg3mGgTUemrAg==#zQ3shp9f5M3uyMpwTi3rFpFrP6WCWmNsW9pgK9cjXVTaf2vgj":
|
||||
"closed community"
|
||||
snt_community_name: snt_community_url.replace(old, new),
|
||||
self.open_community_name: self.open_community_url.replace(old, new),
|
||||
closed_community_name: closed_community_url.replace(old, new)
|
||||
}
|
||||
for link, text in community_links.items():
|
||||
for text, link in community_links.items():
|
||||
self.channel.just_fyi("Opening community '%s' by the link %s" % (text, link))
|
||||
self.browser_view.open_url(link)
|
||||
if text == 'SNT community':
|
||||
if text == snt_community_name:
|
||||
if self.community_view.community_title.text != text:
|
||||
self.errors.append("Community '%s' was not requested to join by the deep link %s" % (text, link))
|
||||
else:
|
||||
if not self.community_view.join_button.is_element_displayed(
|
||||
10) or self.community_view.community_title.text != text:
|
||||
self.errors.append("Community '%s' was not requested to join by the deep link %s" % (text, link))
|
||||
if text != "closed community": # the last one
|
||||
if text != closed_community_name: # the last one
|
||||
self.home.navigate_back_to_home_view()
|
||||
self.home.browser_tab.click()
|
||||
|
||||
|
||||
@@ -135,11 +135,14 @@ class TestWalletMultipleDevice(MultipleSharedDeviceTestCase):
|
||||
|
||||
self.wallet_1.just_fyi("Sending funds from wallet")
|
||||
amount_to_send = 0.0001
|
||||
device_time_before_sending = self.wallet_1.driver.device_time
|
||||
self.wallet_1.send_asset(address='arb1:' + self.receiver['wallet_address'],
|
||||
asset_name='Ether',
|
||||
amount=amount_to_send)
|
||||
self.network_api.wait_for_confirmation_of_transaction(address=self.sender['wallet_address'],
|
||||
tx_time=device_time_before_sending)
|
||||
|
||||
device_time = self.wallet_1.driver.device_time
|
||||
device_time_after_sending = self.wallet_1.driver.device_time
|
||||
|
||||
self._check_balances_after_tx(amount_to_send, sender_balance, receiver_balance, eth_amount_sender,
|
||||
eth_amount_receiver)
|
||||
@@ -164,10 +167,13 @@ class TestWalletMultipleDevice(MultipleSharedDeviceTestCase):
|
||||
|
||||
self.wallet_1.just_fyi("Sending asset from drawer")
|
||||
amount_to_send = 0.0001
|
||||
device_time_before_sending = self.wallet_1.driver.device_time
|
||||
self.wallet_1.send_asset_from_drawer(address='arb1:' + self.receiver['wallet_address'],
|
||||
asset_name='Ether',
|
||||
amount=amount_to_send)
|
||||
device_time = self.wallet_1.driver.device_time
|
||||
self.network_api.wait_for_confirmation_of_transaction(address=self.sender['wallet_address'],
|
||||
tx_time=device_time_before_sending)
|
||||
device_time_after_sending = self.wallet_1.driver.device_time
|
||||
|
||||
self._check_balances_after_tx(amount_to_send, sender_balance, receiver_balance, eth_amount_sender,
|
||||
eth_amount_receiver)
|
||||
|
||||
@@ -372,7 +372,7 @@ class CommunityView(HomeView):
|
||||
self.community_create_a_channel_button = Button(self.driver, accessibility_id="community-create-channel")
|
||||
self.channel_name_edit_box = EditBox(self.driver, translation_id="name-your-channel-placeholder")
|
||||
self.channel_descripton = ChatView(self.driver).community_description_edit_box
|
||||
self.community_options_button = Button(self.driver, accessibility_id="community-menu-button")
|
||||
self.community_options_button = Button(self.driver, accessibility_id="community-options-for-community")
|
||||
self.view_members_button = Button(self.driver, accessibility_id="view-members")
|
||||
self.community_info_button = Button(self.driver, translation_id="community-info")
|
||||
self.invite_button = Button(self.driver, accessibility_id="community-invite-people")
|
||||
@@ -455,11 +455,10 @@ class CommunityView(HomeView):
|
||||
def copy_community_link(self):
|
||||
self.driver.info("Copy community link")
|
||||
self.community_options_button.click()
|
||||
self.community_info_button.click()
|
||||
self.element_starts_with_text('join.status.im/c/').click()
|
||||
community_link_text = self.element_starts_with_text('join.status.im/c/').text
|
||||
self.home_button.double_click()
|
||||
return 'https://%s' % community_link_text
|
||||
self.share_community_button.click()
|
||||
text = self.sharing_text_native.text
|
||||
self.click_system_back_button(times=2)
|
||||
return text
|
||||
|
||||
def handle_membership_request(self, username: str, approve=True):
|
||||
self.driver.info("Handling membership request of user '%s', approve='%s'" % (username, str(approve)))
|
||||
|
||||
@@ -290,8 +290,11 @@ class ProfileView(BaseView):
|
||||
self.advertise_device_button = Button(self.driver, accessibility_id="advertise-device")
|
||||
self.sync_all_button = Button(self.driver, translation_id="sync-all-devices")
|
||||
self.syncing_button = Button(self.driver, accessibility_id="icon, Syncing, label-component, icon")
|
||||
self.sync_plus_button = Button(self.driver,
|
||||
xpath="//*[@text='Syncing']/following-sibling::android.view.ViewGroup[1]")
|
||||
self.paired_devices_button = Button(self.driver,
|
||||
accessibility_id="icon, Paired devices, 0 devices, label-component, icon")
|
||||
self.sync_plus_button = Button(
|
||||
self.driver,
|
||||
xpath="//*[@text='Paired devices']/following-sibling::android.view.ViewGroup[@content-desc='icon']")
|
||||
|
||||
# Keycard
|
||||
self.keycard_button = Button(self.driver, accessibility_id="keycard-button")
|
||||
@@ -539,6 +542,7 @@ class ProfileView(BaseView):
|
||||
|
||||
def get_sync_code(self):
|
||||
self.syncing_button.scroll_and_click()
|
||||
self.paired_devices_button.click()
|
||||
self.sync_plus_button.click()
|
||||
for checkbox in Button(
|
||||
self.driver,
|
||||
|
||||
@@ -261,10 +261,11 @@ class SignInView(BaseView):
|
||||
# self.identifiers_button.wait_and_click(30)
|
||||
if enable_notifications:
|
||||
self.enable_notifications_button.click_until_presence_of_element(self.start_button)
|
||||
if self.allow_button.is_element_displayed():
|
||||
self.allow_button.click()
|
||||
if self.allow_button.is_element_displayed(10):
|
||||
self.allow_button.click_until_presence_of_element(self.start_button)
|
||||
else:
|
||||
self.maybe_later_button.click_until_presence_of_element(self.start_button)
|
||||
self.cancel_button.click_if_shown() # TODO: remove when issue 20806 is fixed
|
||||
self.start_button.click()
|
||||
self.chats_tab.wait_for_visibility_of_element(30)
|
||||
self.driver.info("## New multiaccount is created successfully!", device=False)
|
||||
|
||||
@@ -160,7 +160,6 @@ class WalletView(BaseView):
|
||||
self.add_account_button.click()
|
||||
self.add_account_to_watch.click()
|
||||
self.address_to_watch_input.send_keys(address)
|
||||
self.account_has_activity_label.wait_for_visibility_of_element()
|
||||
self.add_account_continue_button.click()
|
||||
SignInView(self.driver).profile_title_input.send_keys(account_name)
|
||||
self.add_watched_address_button.click()
|
||||
|
||||
Reference in New Issue
Block a user