Merge branch 'develop' into bugfix/allow-scrollable-overlays

This commit is contained in:
Alexander
2023-02-06 21:48:58 +01:00
committed by GitHub
8 changed files with 152 additions and 31 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ pipeline {
e2eApk = utils.getEnv(apke2e, 'SAUCE_URL')
build(
job: 'status-mobile/e2e/status-app-nightly',
parameters: [string(name: 'APK_NAME', value: e2eApk)],
parameters: [string(name: 'APK_URL', value: e2eApk)],
wait: false
)
} }
+11 -2
View File
@@ -4,8 +4,8 @@ pipeline {
parameters {
string(
name: 'APK_NAME',
description: 'Filename of APK uploaded to SauceLabs.',
name: 'APK_URL',
description: 'URL of APK uploaded to SauceLabs.',
)
string(
name: 'KEYWORD_EXPRESSION',
@@ -20,6 +20,14 @@ pipeline {
stages {
stage('Prep') {
steps { script {
if (params.PR_ID == null) {
error("PR_ID parameter not set!")
}
} }
}
stage('Setup') {
steps { script {
dir('test/appium') {
@@ -27,6 +35,7 @@ pipeline {
}
} }
}
stage('Test') {
steps {
withCredentials([
+32 -16
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.3'
library 'status-jenkins-lib@v1.6.5'
pipeline {
@@ -10,16 +10,6 @@ pipeline {
description: 'Name of the branch to checkout and build.',
defaultValue: 'develop',
)
/* Commented to use TEST_MARKERS values from job params
string(
name: 'TEST_MARKERS',
description: 'Marker expression for matching tests to run.',
defaultValue: 'new_ui_critical',
) */
string(
name: 'APK_NAME',
description: 'Filename of APK uploaded to SauceLabs, path, or URL.',
)
string(
name: 'PR_ID',
description: 'ID of the Pull Request triggering this build.',
@@ -34,6 +24,19 @@ pipeline {
description: 'IDs of the TestRail case, separated by a comma (Optional)',
defaultValue: '',
)
/* FIXME: Remove this no longer relevant argument */
string(
name: 'APK_NAME',
description: 'OBSOLETE ARGUMENT TO BE REMOVED',
defaultValue: 'DUMMY',
)
/* Commented to use TEST_MARKERS values from job params
string(
name: 'TEST_MARKERS',
description: 'Marker expression for matching tests to run.',
defaultValue: 'new_ui_critical',
)
*/
}
options {
@@ -41,12 +44,25 @@ pipeline {
}
stages {
stage('Checks') {
stage('Prep') {
steps { script {
if (params.APK_NAME == null) { error("APK_NAME parameter not set!") }
if (params.PR_ID == null) { error("PR_ID parameter not set!") }
currentBuild.displayName = "PR-${params.PR_ID}"
if (params.PR_ID == null) {
error("PR_ID parameter not set!")
}
} }
}
stage('Fetch') {
steps { script { /* WARNING: This copies the latest available artifact. */
copyArtifacts(
projectName: "status-mobile/prs/android-e2e/PR-${params.PR_ID}",
selector: lastWithArtifacts(),
)
apk_path = "${env.PWD}/${utils.findFile('result/*.apk')}"
} }
}
stage('Setup') {
steps { script {
dir('test/appium') {
@@ -54,9 +70,9 @@ pipeline {
}
} }
}
stage('Test') {
steps { script {
currentBuild.displayName = "PR-${params.PR_ID}"
/* for managing optional arguments */
def extraPytestOpts = ''
if (params.TR_CASE_IDS != '') {
@@ -103,7 +119,7 @@ pipeline {
--rerun_count=2 \
--testrail_report=True \
-k \"${params.KEYWORD_EXPRESSION}\" \
--apk=${params.APK_NAME} \
--apk=${apk_path} \
--build=PR-${params.PR_ID}-${utils.timestamp()} \
--pr_number=${params.PR_ID} \
${extraPytestOpts}
+18 -6
View File
@@ -4,12 +4,12 @@ pipeline {
parameters {
string(
name: 'APK_NAME',
description: 'Filename of APK uploaded to SauceLabs (base for upgrade, usually release build)',
name: 'APK_URL',
description: 'URL of APK to be tested(base for upgrade, usually release build)',
)
string(
name: 'APK_NAME_UPGRADE',
description: 'Filename of APK of upgraded application (installed on top of base)',
name: 'APK_URL_UPGRADE',
description: 'URL of APK of upgraded application (installed on top of base)',
)
string(
name: 'KEYWORD_EXPRESSION',
@@ -29,6 +29,17 @@ pipeline {
stages {
stage('Prep') {
steps { script {
if (params.APK_URL == null) {
error("APK_URL parameter not set!")
}
if (params.APK_URL_UPGRADE == null) {
error("APK_URL_UPGRADE parameter not set!")
}
} }
}
stage('Setup') {
steps { script {
dir('test/appium') {
@@ -36,6 +47,7 @@ pipeline {
}
} }
}
stage('Test') {
steps { script {
/* for managing optional arguments */
@@ -77,8 +89,8 @@ pipeline {
--numprocesses 4 \
--rerun_count=2 \
--testrail_report=True \
--apk=${params.APK_NAME} \
--apk_upgrade=${params.APK_NAME_UPGRADE} \
--apk=${params.APK_URL} \
--apk_upgrade=${params.APK_URL_UPGRADE} \
${extraPytestOpts}
"""
}
@@ -76,8 +76,10 @@
:icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40)
:accessibility-label :start-a-new-chat
:icon :i/new-message
:on-press #(hide-sheet-and-dispatch [:bottom-sheet/show-sheet
:start-a-new-chat {}])}]
:on-press (fn []
(rf/dispatch [:group-chat/clear-contacts])
(hide-sheet-and-dispatch [:bottom-sheet/show-sheet
:start-a-new-chat {}]))}]
[quo2/menu-item
{:type :transparent
:title (i18n/label :t/add-a-contact)
+6 -2
View File
@@ -259,7 +259,9 @@
(views/letsubs [logging-in? [:multiaccounts/login]]
[components.plus-button/plus-button-old
{:on-press (when-not logging-in?
#(re-frame/dispatch [:bottom-sheet/show-sheet :start-a-new-chat {}]))
(fn []
(re-frame/dispatch [:group-chat/clear-contacts])
(re-frame/dispatch [:bottom-sheet/show-sheet :start-a-new-chat {}])))
:loading logging-in?
:accessibility-label :new-chat-button}]))
@@ -268,7 +270,9 @@
(views/letsubs [logging-in? [:multiaccounts/login]]
[components.plus-button/plus-button-old
{:on-press (when-not logging-in?
#(re-frame/dispatch [:bottom-sheet/show-sheet :start-a-new-chat {}]))
(fn []
(re-frame/dispatch [:group-chat/clear-contacts])
(re-frame/dispatch [:bottom-sheet/show-sheet :start-a-new-chat {}])))
:loading logging-in?
:accessibility-label :new-chat-button}]))
@@ -13,7 +13,6 @@
[quo2.components.markdown.text :as text]
[status-im.ui.components.invite.events :as invite.events]
[status-im.ui2.screens.chat.components.new-chat.styles :as style]
[quo.react :as quo.react]
[quo.components.safe-area :as safe-area]
[status-im.react-native.resources :as resources]))
@@ -65,7 +64,6 @@
[]
[:f>
(fn []
(quo.react/effect! #(rf/dispatch [:group-chat/clear-contacts]) [])
(let [contacts (rf/sub
[:contacts/sorted-and-grouped-by-first-letter])
selected-contacts-count (rf/sub [:selected-contacts-count])
+80
View File
@@ -0,0 +1,80 @@
(ns status-im2.subs.shell-test
(:require [utils.re-frame :as rf]
[re-frame.db :as rf-db]
[test-helpers.unit :as h]
[cljs.test :refer [is testing]]
[status-im2.constants :as constants]))
(def public-profile-timeline-chats
{"0xpublic-chat" {:chat-type constants/public-chat-type
:unviewed-messages-count 5
:unviewed-mentions-count 6}
"0xprofile-chat" {:chat-type constants/profile-chat-type
:unviewed-messages-count 5
:unviewed-mentions-count 6}
"0xtimeline-chat" {:chat-type constants/timeline-chat-type
:unviewed-messages-count 5
:unviewed-mentions-count 6}})
(def expected-notification-data-for-public-profile-timeline-chats
{:communities-stack {:new-notifications? false
:notification-indicator :unread-dot
:counter-label 0}
:chats-stack {:new-notifications? false
:notification-indicator :unread-dot
:counter-label 0}})
(def one-to-one-group-community-chats1
{"0xone-to-one-chat1" {:chat-type constants/one-to-one-chat-type
:unviewed-messages-count 5
:unviewed-mentions-count 0}
"0xgroup-chat1" {:chat-type constants/private-group-chat-type
:unviewed-messages-count 2
:unviewed-mentions-count 0}
"0xcommunity-chat1" {:chat-type constants/community-chat-type
:unviewed-messages-count 3
:unviewed-mentions-count 0}})
(def expected-notification-data-for-one-to-one-group-community-chats1
{:communities-stack {:new-notifications? true
:notification-indicator :unread-dot
:counter-label 0}
:chats-stack {:new-notifications? true
:notification-indicator :unread-dot
:counter-label 0}})
(def one-to-one-group-community-chats2
(merge
one-to-one-group-community-chats1
{"0xone-to-one-chat2" {:chat-type constants/one-to-one-chat-type
:unviewed-messages-count 8
:unviewed-mentions-count 6}
"0xgroup-chat2" {:chat-type constants/private-group-chat-type
:unviewed-messages-count 4
:unviewed-mentions-count 3}
"0xcommunity-chat2" {:chat-type constants/community-chat-type
:unviewed-messages-count 9
:unviewed-mentions-count 7}}))
(def expected-notification-data-for-one-to-one-group-community-chats2
{:communities-stack {:new-notifications? true
:notification-indicator :counter
:counter-label 7}
:chats-stack {:new-notifications? true
:notification-indicator :counter
:counter-label 9}})
(h/deftest-sub :shell/bottom-tabs-notifications-data
[sub-name]
(testing "public, profile and timeline chats should not affect shell bottom tab indicator"
(swap! rf-db/app-db assoc :chats public-profile-timeline-chats)
(is (= (rf/sub [sub-name]) expected-notification-data-for-public-profile-timeline-chats)))
(testing "chats with only unviewed-messages, without unviewed-mentions count should use unread-dot"
(swap! rf-db/app-db assoc :chats one-to-one-group-community-chats1)
(is (= (rf/sub [sub-name]) expected-notification-data-for-one-to-one-group-community-chats1)))
(testing
"chats with both unviewed-messages and unviewed-mentions count should use counter with mentions count"
(swap! rf-db/app-db assoc :chats one-to-one-group-community-chats2)
(is (= (rf/sub [sub-name]) expected-notification-data-for-one-to-one-group-community-chats2))))