Compare commits

...
Author SHA1 Message Date
Yevheniia Berdnyk be36e6789d e2e: added tests for mobile data messaging 2025-03-04 16:55:47 +02:00
Yevheniia Berdnyk 767be39673 e2e: fix for collectibles tests 2025-03-04 00:09:00 +02:00
Parvesh Monu 714d966d48 fix Some of the message longtap options disappear until relogin after unmuting chat (#22220) (#22221) 2025-03-04 00:05:41 +05:30
Siddarth Kumar 11d66e5bc2 ci: fix nix-cache-job with nix-export 2025-03-03 15:39:12 +05:30
jakub 9d5f6d0b06 nix: replace yet another openjdk with headless version
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2025-02-27 14:21:18 +01:00
frank 48c83ef759 fix_: no log file (#22122)
* fix_: no log file

https://github.com/status-im/status-go/compare/c5e4eb1a...388fce10

* chore_: fix lint issue

* chore_: set error level for release build

https://github.com/status-im/status-go/compare/c5e4eb1a...ba8fd519
2025-02-27 19:46:28 +08:00
jakub c84fc71bf1 nix: use openjdk_headless to avoid pulling GTK
This saves a whole bunch of downloading.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2025-02-26 18:56:10 +01:00
20 changed files with 273 additions and 37 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ DEBUG_WEBVIEW=0
ETHEREUM_DEV_CLUSTER=0
EXTENSIONS=0
GROUP_CHATS_ENABLED=1
LOG_LEVEL=
LOG_LEVEL=error
MAILSERVER_CONFIRMATIONS_ENABLED=1
MAINNET_WARNING_ENABLED=1
PFS_ENCRYPTION_ENABLED=1
+12 -3
View File
@@ -109,10 +109,19 @@ pipeline {
stage('Upload') {
steps { script {
sshagent(credentials: ['nix-cache-ssh']) {
nix.shell("""
nix.shell(
"""
find /nix/store/ -mindepth 1 -maxdepth 1 -type d \
-not -name '*.links' -and -not -name '*-status-mobile-*' \
| xargs nix copy --to ${NIX_SSH_REMOTE}
-not -name "*.links" -and -not -name "*-status-mobile-*" \
-and -not -name "tmp-*" \
-print0 | xargs -0 nix-store -qR | sort -u > "${WORKSPACE_TMP}"/store-paths.txt
""",
pure: false
)
nix.shell(
"""
nix-store --export < "${WORKSPACE_TMP}"/store-paths.txt | \\
ssh ${env.NIX_SSHOPTS} ${params.NIX_CACHE_USER}@${params.NIX_CACHE_HOST} ${env.NIX_STORE_CMD} --import
""",
pure: false
)
+1 -1
View File
@@ -71,7 +71,7 @@ in stdenv.mkDerivation rec {
};
};
buildInputs = with pkgs; [ nodejs openjdk ];
buildInputs = with pkgs; [ nodejs openjdk_headless ];
nativeBuildInputs = with pkgs; [ bash gradle unzip ]
++ lib.optionals stdenv.isDarwin [ file gnumake ];
+1 -1
View File
@@ -8,7 +8,7 @@ rec {
shell = mkShell {
buildInputs = with pkgs; [
openjdk
openjdk_headless
gradle
lsof # used in start-react-native.sh
flock # used in nix/scripts/node_modules.sh
+1 -1
View File
@@ -38,7 +38,7 @@ stdenv.mkDerivation {
];
};
};
buildInputs = with pkgs; [ clojure nodejs bash git openjdk];
buildInputs = with pkgs; [ clojure nodejs bash git openjdk_headless ];
phases = [
"unpackPhase" "secretsPhase" "patchPhase"
"configurePhase" "buildPhase" "installPhase"
+1 -1
View File
@@ -49,7 +49,7 @@ in {
nodejs = super.nodejs_20;
ruby = super.ruby_3_1;
yarn = super.yarn.override { nodejs = super.nodejs_20; };
openjdk = super.openjdk17_headless;
openjdk_headless = super.openjdk17_headless;
xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } {
versions = ["16.0" "16.1" "16.2"];
};
+2 -2
View File
@@ -1,8 +1,8 @@
{ mkShell, openjdk, androidPkgs }:
{ mkShell, openjdk_headless, androidPkgs }:
mkShell {
name = "android-sdk-shell";
buildInputs = [ openjdk ];
buildInputs = [ openjdk_headless ];
shellHook = ''
export ANDROID_HOME="${androidPkgs.sdk}"
+2 -2
View File
@@ -19,7 +19,7 @@ let
# for calling clojure targets in CI or Makefile
clojure = mkShell {
buildInputs = with pkgs; [
clojure flock maven openjdk
clojure flock maven openjdk_headless
# lint specific utilities
babashka clj-kondo clojure-lsp ripgrep zprint
];
@@ -61,7 +61,7 @@ let
# for 'scripts/generate-keystore.sh'
keytool = mkShell {
buildInputs = with pkgs; [ openjdk apksigner ];
buildInputs = with pkgs; [ openjdk_headless apksigner ];
};
# for targets needing 'adb', 'apkanalyzer' and other SDK/NDK tools
+2 -2
View File
@@ -1,5 +1,5 @@
{ callPackage, lib, buildGoPackage, pkgs
, androidPkgs, openjdk, gomobile, xcodeWrapper, removeReferencesTo
, androidPkgs, openjdk_headless, gomobile, xcodeWrapper, removeReferencesTo
, go-bindata, mockgen, protobuf3_20, protoc-gen-go
, meta
, source
@@ -32,7 +32,7 @@ in buildGoPackage rec {
extraSrcPaths = [ gomobile ];
nativeBuildInputs = [
gomobile removeReferencesTo go-bindata mockgen protoc-gen-go protobuf3_20 fakeGit
] ++ optional isAndroid openjdk
] ++ optional isAndroid openjdk_headless
++ optional isIOS xcodeWrapper;
ldflags = goBuildLdFlags;
+28 -6
View File
@@ -2,19 +2,41 @@
(:require
[legacy.status-im.multiaccounts.update.core :as multiaccounts.update]
[re-frame.core :as re-frame]
[taoensso.timbre :as log]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(rf/defn save-log-level
{:events [:log-level.ui/change-log-level-confirmed]}
[{:keys [db] :as cofx} log-level]
[{:keys [db]} log-level]
(let [old-log-level (get-in db [:profile/profile :log-level])]
(when (not= old-log-level log-level)
(multiaccounts.update/multiaccount-update
cofx
:log-level
log-level
{:on-success #(re-frame/dispatch [:profile/logout])}))))
(let [need-set-log-enabled? (or (empty? old-log-level) (empty? log-level))
log-enabled? (boolean (seq log-level))
rpc-calls (cond-> []
log-enabled?
(conj {:method "wakuext_setLogLevel"
:params [{:logLevel log-level}]
:on-error #(log/error "Failed to set log level" %)})
need-set-log-enabled?
(conj {:method "wakuext_setLogEnabled"
:params [log-enabled?]
:on-error #(log/error "Failed to set log enabled" %)}))]
{:fx [[:json-rpc/call
(conj (vec (map #(assoc % :on-success nil) (butlast rpc-calls)))
(assoc (last rpc-calls)
:on-success
#(rf/dispatch [:log-level/update-multiaccount log-level])))]]}))))
(rf/defn update-multiaccount
{:events [:log-level/update-multiaccount]}
[cofx log-level]
(multiaccounts.update/multiaccount-update
cofx
:log-level
log-level
{:on-success #(rf/dispatch [:profile/logout])}))
(rf/defn show-change-log-level-confirmation
{:events [:log-level.ui/log-level-selected]}
@@ -33,6 +33,9 @@
name]]]]))
(def log-levels
"The status-go log library (zap) doesn't support the trace level, so we remove
the trace option from the UI. When trace is enabled an error will happen while
trying to login (user will see the error 'wrong password')."
[{:name "DISABLED"
:value ""}
{:name "ERROR"
@@ -42,9 +45,7 @@
{:name "INFO"
:value "INFO"}
{:name "DEBUG"
:value "DEBUG"}
{:name "TRACE"
:value "TRACE"}])
:value "DEBUG"}])
(views/defview log-level-settings
[]
+2 -1
View File
@@ -275,7 +275,8 @@
{:events [:chat/unmute-chat-community]}
[{:keys [db]} chat-id]
(let [{:keys [community-id]} (get-in db [:chats chat-id])]
{:db (assoc-in db [:communities community-id :muted] false)}))
(when community-id
{:db (assoc-in db [:communities community-id :muted] false)})))
(rf/defn mute-chat-failed
{:events [:chat/mute-failed]}
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v10.6.0",
"commit-sha1": "c5e4eb1a56ea7641efcc7cc677be7fd5d3f92225",
"src-sha256": "0n8x03c4dqxwcl27y8x6hmn6wbfpq3llkj15hhjxc4baaqwrhy8i"
"version": "v10.8.0",
"commit-sha1": "ba8fd51958686aea45e34e684ac925a4e65927f8",
"src-sha256": "0kqn5rkfsn7aqc2n2flqvkm6cc53ssk0mc1l84f4czg0paci0717"
}
+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.WIFI_ONLY)
drivers[i].set_network_connection(ConnectionType.ALL_NETWORK_ON)
return drivers, loop
except (MaxRetryError, AttributeError) as e:
test_suite_data.current_test.testruns[-1].error = str(e)
@@ -710,10 +710,9 @@ 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()
# 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.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')
@@ -1245,3 +1244,199 @@ 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()
@@ -43,7 +43,7 @@ class TestWalletCollectibles(MultipleSharedDeviceTestCase):
self.wallet_view.collectibles_tab.click()
self.wallet_view.set_network_in_wallet(self.network_name)
collectibles = {
"BVL": {"quantity": 2,
"BVL": {"quantity": 1,
"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': '2 '
'Recipient gets': '1 '
}
for key, expected_value in data_to_check.items():
try:
+7
View File
@@ -381,3 +381,10 @@ 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: 329 KiB

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

+2 -1
View File
@@ -120,7 +120,6 @@ 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")
@@ -142,6 +141,8 @@ 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)