Compare commits

..
Author SHA1 Message Date
Yevheniia Berdnyk d2a2c2f48e android 12 try 2023-04-12 03:45:52 +03:00
Yevheniia Berdnyk 7ebf035506 requirements roll back 2023-04-11 23:41:02 +03:00
Yevheniia Berdnyk 7256c66760 fix for stale element 2023-04-10 22:36:17 +03:00
Yevheniia Berdnyk 6a9a6fb52c appium 1.22.1 2023-04-10 21:32:19 +03:00
Yevheniia Berdnyk de05976353 android 11 2023-04-10 16:54:47 +03:00
Yevheniia Berdnyk db9e3bde17 newCommandTimeout 2023-04-10 15:45:41 +03:00
Yevheniia Berdnyk cb0e15eff0 capabilities 2023-04-07 01:34:09 +03:00
Yevheniia Berdnyk d4c275cb09 find element 2023-04-06 22:48:19 +03:00
Yevheniia Berdnyk dc781b73fa updated versions 2023-04-06 14:28:57 +03:00
Yevheniia Berdnyk 321efa053c temp 2023-04-06 09:23:58 +03:00
Yevheniia Berdnyk bdbf00257a e2e: fix for MaxRetryError 2023-04-06 08:46:34 +03:00
33 changed files with 1368 additions and 439 deletions
-9
View File
@@ -12,7 +12,6 @@ stdenv.mkDerivation {
"patchBuildIdPhase"
"patchHermesPhase"
"patchJavaPhase"
"patchYogaNodePackagePhase"
"installPhase"
];
@@ -67,14 +66,6 @@ stdenv.mkDerivation {
patchJavaPhase = ''
${nodejs}/bin/node ./node_modules/jetifier/bin/jetify
'';
# Patch React Native Yoga.cpp file
# FIXME: Remove this once release newer than 1.19.0 is used which includes:
# https://github.com/facebook/yoga/commit/f174de70
patchYogaNodePackagePhase = ''
substituteInPlace ./node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp --replace \
'node->getLayout().hadOverflow() |' \
'node->getLayout().hadOverflow() ||'
'';
installPhase = ''
mkdir -p $out
cp -R node_modules $out/
+3 -4
View File
@@ -11,11 +11,10 @@ let
# We follow the master branch of official nixpkgs.
nixpkgsSrc = fetchFromGitHub {
name = "nixpkgs-source";
# FIXME: Fork used to get Cocoapods 1.12.0 and apksigner macOS build.
owner = "status-im";
owner = "status-im"; # FIXME: Fork used to get Cocoapods 1.12.0.
repo = "nixpkgs";
rev = "d0c06fa3d3982a91aa01bd63ed84020cbde3d3ab";
sha256 = "sha256-8blvuUHnuf0hFr/PpBxVohJp5CaGXIXhgJlFN/cv7us=";
rev = "b9b2ed705edc00003d47625950602136be3e1ed5";
sha256 = "sha256-F0qOawdKx7kgiGqwVikYIawL2taJ1XfcgHy0Wn0mho8=";
# To get the compressed Nix sha256, use:
# nix-prefetch-url --unpack https://github.com/${ORG}/nixpkgs/archive/${REV}.tar.gz
};
+41 -37
View File
@@ -41,19 +41,36 @@
(rf/defn select-mention
{:events [:chat.ui/select-mention]}
[{:keys [db] :as cofx} text-input-ref {:keys [primary-name searched-text match public-key] :as user}]
(let [chat-id (:current-chat-id db)
text (get-in db [:chat/inputs chat-id :input-text])
method "wakuext_chatMentionNewInputTextWithMention"
params [chat-id text primary-name]]
{:json-rpc/call [{:method method
:params params
:on-success #(rf/dispatch [:mention/on-new-input-text-with-mentions-success %
primary-name text-input-ref match searched-text
public-key])
:on-error #(rf/dispatch [:mention/on-error
{:method method
:params params} %])}]}))
[{:keys [db] :as cofx} text-input-ref {:keys [primary-name searched-text match] :as user}]
(let [chat-id (:current-chat-id db)
new-text (mentions/new-input-text-with-mention cofx user)
at-sign-idx (get-in db [:chats/mentions chat-id :mentions :at-sign-idx])
cursor (+ at-sign-idx (count primary-name) 2)]
(rf/merge
cofx
{:db (-> db
(assoc-in [:chats/cursor chat-id] cursor)
(assoc-in [:chats/mention-suggestions chat-id] nil))
:set-text-input-value [chat-id new-text text-input-ref]}
(set-chat-input-text new-text chat-id)
;; NOTE(rasom): Some keyboards do not react on selection property passed to
;; text input (specifically Samsung keyboard with predictive text set on).
;; In this case, if the user continues typing after the programmatic change,
;; the new text is added to the last known cursor position before
;; programmatic change. By calling `reset-text-input-cursor` we force the
;; keyboard's cursor position to be changed before the next input.
(mentions/reset-text-input-cursor text-input-ref cursor)
;; NOTE(roman): on-text-input event is not dispatched when we change input
;; programmatically, so we have to call `on-text-input` manually
(mentions/on-text-input
(let [match-len (count match)
start (inc at-sign-idx)
end (+ start match-len)]
{:new-text match
:previous-text searched-text
:start start
:end end}))
(mentions/recheck-at-idxs {primary-name user}))))
(rf/defn disable-chat-cooldown
"Turns off chat cooldown (protection against message spamming)"
@@ -165,7 +182,8 @@
(rf/merge cofx
{:set-text-input-value [current-chat-id ""]}
(clean-input current-chat-id)
(mentions/clear-mentions))))
(mentions/clear-mentions)
(mentions/clear-cursor))))
(rf/defn send-messages
[{:keys [db] :as cofx} input-text current-chat-id]
@@ -233,29 +251,13 @@
[{{:keys [current-chat-id] :as db} :db :as cofx}]
(let [{:keys [input-text metadata]} (get-in db [:chat/inputs current-chat-id])
editing-message (:editing-message metadata)
method "wakuext_chatMentionCheckMentions"
params [current-chat-id input-text]]
{:json-rpc/call [{:method method
:params params
:on-error #(rf/dispatch [:mention/on-error {:method method :params params} %])
:on-success #(rf/dispatch [:mention/on-check-mentions-success
current-chat-id
editing-message
input-text
%])}]}))
(rf/defn on-check-mentions-success
{:events [:mention/on-check-mentions-success]}
[{:keys [db] :as cofx} current-chat-id editing-message input-text new-text]
(log/debug "[mentions] on-check-mentions-success"
{:chat-id current-chat-id
:editing-message editing-message
:input-text input-text
:new-text new-text})
(rf/merge cofx
(if editing-message
(send-edited-message new-text editing-message)
(send-messages new-text current-chat-id))))
input-text-with-mentions (mentions/check-mentions cofx input-text)]
(rf/merge cofx
(if editing-message
(send-edited-message input-text-with-mentions editing-message)
(send-messages input-text-with-mentions current-chat-id))
(mentions/clear-mentions)
(mentions/clear-cursor))))
(rf/defn send-contact-request
{:events [:contacts/send-contact-request]}
@@ -269,6 +271,7 @@
:on-error #(log/warn "failed to send a contact request" %)
:on-success #(re-frame/dispatch [:transport/message-sent %])}]}
(mentions/clear-mentions)
(mentions/clear-cursor)
(clean-input (:current-chat-id db))))
(rf/defn cancel-contact-request
@@ -279,6 +282,7 @@
(rf/merge cofx
{:db (assoc-in db [:chat/inputs current-chat-id :metadata :sending-contact-request] nil)}
(mentions/clear-mentions)
(mentions/clear-cursor)
(clean-input (:current-chat-id db)))))
(rf/defn chat-send-sticker
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,323 @@
(ns status-im.chat.models.mentions-test
(:require [cljs.test :as test]
[clojure.string :as string]
[status-im.chat.models.mentions :as mentions]))
(def ->info-input
[[:text "H."]
[:mention
"@helpinghand.eth"]
[:text
" "]])
(def ->info-expected
{:at-sign-idx 2
:mention-end 19
:new-text " "
:previous-text ""
:start 18
:end 18
:at-idxs [{:mention? true
:from 2
:to 17
:checked? true}]})
(test/deftest test->info
(test/testing "->info base case"
(test/is (= ->info-expected (mentions/->info ->info-input)))))
;; No mention
(def mention-text-1 "parse-text")
(def mention-text-result-1 [[:text "parse-text"]])
;; Mention in the middle
(def mention-text-2
"hey @0x04fbce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073 he")
(def mention-text-result-2
[[:text "hey "]
[:mention
"0x04fbce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073"]
[:text " he"]])
;; Mention at the beginning
(def mention-text-3
"@0x04fbce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073 he")
(def mention-text-result-3
[[:mention
"0x04fbce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073"]
[:text " he"]])
;; Mention at the end
(def mention-text-4
"hey @0x04fbce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073")
(def mention-text-result-4
[[:text "hey "]
[:mention
"0x04fbce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073"]])
;; Invalid mention
(def mention-text-5
"invalid @0x04fBce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073")
(def mention-text-result-5
[[:text
"invalid @0x04fBce10971e1cd7253b98c7b7e54de3729ca57ce41a2bfb0d1c4e0a26f72c4b6913c3487fa1b4bb86125770f1743fb4459da05c1cbe31d938814cfaf36e252073"]])
(test/deftest test-to-input
(test/testing "only text"
(test/is (= mention-text-result-1 (mentions/->input-field mention-text-1))))
(test/testing "in the middle"
(test/is (= mention-text-result-2 (mentions/->input-field mention-text-2))))
(test/testing "at the beginning"
(test/is (= mention-text-result-3 (mentions/->input-field mention-text-3))))
(test/testing "at the end"
(test/is (= mention-text-result-4 (mentions/->input-field mention-text-4))))
(test/testing "invalid"
(test/is (= mention-text-result-5 (mentions/->input-field mention-text-5)))))
(test/deftest test-replace-mentions
(let [users {"User Number One"
{:primary-name "User Number One"
:public-key "0xpk1"}
"User Number Two"
{:primary-name "user2"
:secondary-name "User Number Two"
:public-key "0xpk2"}
"User Number Three"
{:primary-name "user3"
:secondary-name "User Number Three"
:public-key "0xpk3"}}]
(test/testing "empty string"
(let [text ""
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "no text"
(let [text nil
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "incomlepte mention 1"
(let [text "@"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "incomplete mention 2"
(let [text "@r"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "no mentions"
(let [text "foo bar @buzz kek @foo"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "starts with mention"
(let [text "@User Number One"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk1") (pr-str text))))
(test/testing "starts with mention, comma after mention"
(let [text "@User Number One,"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk1,") (pr-str text))))
(test/testing "starts with mention but no space after"
(let [text "@User Number Onefoo"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "starts with mention, some text after mention"
(let [text "@User Number One foo"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk1 foo") (pr-str text))))
(test/testing "starts with some text, then mention"
(let [text "text @User Number One"
result (mentions/replace-mentions text users)]
(test/is (= result "text @0xpk1") (pr-str text))))
(test/testing "starts with some text, then mention, then more text"
(let [text "text @User Number One foo"
result (mentions/replace-mentions text users)]
(test/is (= result "text @0xpk1 foo") (pr-str text))))
(test/testing "no space before mention"
(let [text "text@User Number One"
result (mentions/replace-mentions text users)]
(test/is (= result "text@0xpk1") (pr-str text))))
(test/testing "two different mentions"
(let [text "@User Number One @User Number two"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk1 @0xpk2") (pr-str text))))
(test/testing "two different mentions, separated with comma"
(let [text "@User Number One,@User Number two"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk1,@0xpk2") (pr-str text))))
(test/testing "two different mentions inside text"
(let [text "foo@User Number One bar @User Number two baz"
result (mentions/replace-mentions text users)]
(test/is (= result "foo@0xpk1 bar @0xpk2 baz") (pr-str text))))
(test/testing "ens mention"
(let [text "@user2"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk2") (pr-str text))))
(test/testing "multiple mentions"
(let [text (string/join
" "
(repeat 1000 "@User Number One @User Number two"))
result (mentions/replace-mentions text users)
exprected-result (string/join
" "
(repeat 1000 "@0xpk1 @0xpk2"))]
(test/is (= exprected-result result))))
(test/testing "markdown"
(test/testing "single * case 1"
(let [text "*@user2*"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "single * case 2"
(let [text "*@user2 *"
result (mentions/replace-mentions text users)]
(test/is (= result "*@0xpk2 *") (pr-str text))))
(test/testing "single * case 3"
(let [text "a*@user2*"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "single * case 4"
(let [text "*@user2 foo*foo"
result (mentions/replace-mentions text users)]
(test/is (= result "*@0xpk2 foo*foo") (pr-str text))))
(test/testing "single * case 5"
(let [text "a *@user2*"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "single * case 6"
(let [text "*@user2 foo*"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "single * case 7"
(let [text "@user2 *@user2 foo* @user2"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk2 *@user2 foo* @0xpk2") (pr-str text))))
(test/testing "single * case 8"
(let [text "*@user2 foo**@user2 foo*"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "single * case 9"
(let [text "*@user2 foo***@user2 foo* @user2"
result (mentions/replace-mentions text users)]
(test/is (= result "*@user2 foo***@user2 foo* @0xpk2") (pr-str text))))
(test/testing "double * case 1"
(let [text "**@user2**"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "double * case 2"
(let [text "**@user2 **"
result (mentions/replace-mentions text users)]
(test/is (= result "**@0xpk2 **") (pr-str text))))
(test/testing "double * case 3"
(let [text "a**@user2**"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "double * case 4"
(let [text "**@user2 foo**foo"
result (mentions/replace-mentions text users)]
(test/is (= result "**@user2 foo**foo") (pr-str text))))
(test/testing "double * case 5"
(let [text "a **@user2**"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "double * case 6"
(let [text "**@user2 foo**"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "double * case 7"
(let [text "@user2 **@user2 foo** @user2"
result (mentions/replace-mentions text users)]
(test/is (= result "@0xpk2 **@user2 foo** @0xpk2") (pr-str text))))
(test/testing "double * case 8"
(let [text "**@user2 foo****@user2 foo**"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "double * case 9"
(let [text "**@user2 foo*****@user2 foo** @user2"
result (mentions/replace-mentions text users)]
(test/is (= result "**@user2 foo*****@user2 foo** @0xpk2") (pr-str text))))
(test/testing "tripple * case 1"
(let [text "***@user2 foo***@user2 foo*"
result (mentions/replace-mentions text users)]
(test/is (= result "***@user2 foo***@0xpk2 foo*") (pr-str text))))
(test/testing "tripple ~ case 1"
(let [text "~~~@user2 foo~~~@user2 foo~"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "quote case 1"
(let [text ">@user2"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "quote case 2"
(let [text "\n>@user2"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "quote case 3"
(let [text "\n> @user2 \n \n @user2"
result (mentions/replace-mentions text users)]
(test/is (= result "\n> @user2 \n \n @0xpk2") (pr-str text))))
(test/testing "quote case 4"
(let [text ">@user2\n\n>@user2"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "quote case 5"
(let [text "***hey\n\n>@user2\n\n@user2 foo***"
result (mentions/replace-mentions text users)]
(test/is (= result "***hey\n\n>@user2\n\n@0xpk2 foo***")
(pr-str text))))
(test/testing "code case 1"
(let [text "` @user2 `"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "code case 2"
(let [text "` @user2 `"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "code case 3"
(let [text "``` @user2 ```"
result (mentions/replace-mentions text users)]
(test/is (= result text) (pr-str text))))
(test/testing "code case 4"
(let [text "` ` @user2 ``"
result (mentions/replace-mentions text users)]
(test/is (= result "` ` @0xpk2 ``") (pr-str text)))))))
+1 -2
View File
@@ -41,8 +41,7 @@
:albumId :album-id
:imageWidth :image-width
:imageHeight :image-height
:new :new?
:albumImagesCount :album-images-count})
:new :new?})
(update :quoted-message
set/rename-keys
+1 -1
View File
@@ -115,7 +115,7 @@
{:events [:system-theme-mode-changed]}
[{:keys [db] :as cofx} _]
(let [current-theme-type (get-in cofx [:db :multiaccount :appearance])]
(when (and (multiaccounts.model/logged-in? db)
(when (and (multiaccounts.model/logged-in? cofx)
(= current-theme-type status-im2.constants/theme-type-system))
{:multiaccounts.ui/switch-theme-fx
[(get-in db [:multiaccount :appearance])
+1 -1
View File
@@ -238,7 +238,7 @@
:t/keycard-can-use-with-new-passcode
:t/keycard-backup-success-body))}}
(cond
(multiaccounts.model/logged-in? db)
(multiaccounts.model/logged-in? cofx)
(navigation/set-stack-root :profile-stack [:my-profile :keycard-settings])
(:multiaccounts/login db)
+1 -1
View File
@@ -21,7 +21,7 @@
(rf/defn on-network-status-change
[{:keys [db] :as cofx}]
(let [initialized? (get db :network-status/initialized?)
logged-in? (multiaccounts.model/logged-in? db)
logged-in? (multiaccounts.model/logged-in? cofx)
{:keys [remember-syncing-choice?]} (:multiaccount db)]
(apply
rf/merge
@@ -21,10 +21,10 @@
(rf/defn key-and-storage-management-pressed
"This event can be dispatched before login and from profile and needs to redirect accordingly"
{:events [::key-and-storage-management-pressed]}
[{:keys [db] :as cofx}]
[cofx]
(navigation/navigate-to
cofx
(if (multiaccounts.model/logged-in? db)
(if (multiaccounts.model/logged-in? cofx)
:actions-logged-in
:actions-not-logged-in)
nil))
+6 -5
View File
@@ -476,6 +476,9 @@
"Decides which root should be initialised depending on user and app state"
[db]
(cond
(get db :local-pairing/completed-pairing?)
(re-frame/dispatch [:syncing/pairing-completed])
(get db :onboarding-2/new-account?)
(re-frame/dispatch [:onboarding-2/finalize-setup])
@@ -487,9 +490,8 @@
(rf/defn login-only-events
[{:keys [db] :as cofx} key-uid password save-password?]
(let [auth-method (:auth-method db)
new-auth-method (get-new-auth-method auth-method save-password?)
pairing-in-progress? (get-in db [:syncing :pairing-in-progress?])]
(let [auth-method (:auth-method db)
new-auth-method (get-new-auth-method auth-method save-password?)]
(log/debug "[login] login-only-events"
"auth-method" auth-method
"new-auth-method" new-auth-method)
@@ -498,8 +500,7 @@
:json-rpc/call
[{:method "settings_getSettings"
:on-success #(do (re-frame/dispatch [::get-settings-callback %])
(when-not pairing-in-progress?
(redirect-to-root db)))}]}
(redirect-to-root db))}]}
(notifications/load-notification-preferences)
(when save-password?
(keychain/save-user-password key-uid password))
+3 -2
View File
@@ -1,8 +1,9 @@
(ns status-im.multiaccounts.model)
(defn logged-in?
[{:keys [multiaccount]}]
(boolean multiaccount))
[cofx]
(boolean
(get-in cofx [:db :multiaccount])))
(defn credentials
[cofx]
+2 -2
View File
@@ -4,6 +4,6 @@
(deftest logged-in-test
(testing "multiaccount is defined"
(is (multiaccounts.model/logged-in? {:multiaccount {}})))
(is (multiaccounts.model/logged-in? {:db {:multiaccount {}}})))
(testing "multiaccount is not there"
(is (not (multiaccounts.model/logged-in? {})))))
(is (not (multiaccounts.model/logged-in? {:db {}})))))
+9 -13
View File
@@ -60,29 +60,27 @@
[{:keys [db] :as cofx} event]
(log/info "local pairing signal received"
{:event event})
(let [connection-success? (and (= (:type event)
constants/local-pairing-event-connection-success)
(= (:action event)
constants/local-pairing-action-connect))
(let [connection-success? (= (:type event)
constants/local-pairing-event-connection-success)
error-on-pairing? (contains? constants/local-pairing-event-errors (:type event))
completed-pairing? (and (= (:type event)
constants/local-pairing-event-transfer-success)
constants/local-pairing-event-process-success)
(= (:action event)
constants/local-pairing-action-pairing-installation))
logged-in? (multiaccounts.model/logged-in? db)
constants/local-pairing-action-pairing-account))
logged-in? (multiaccounts.model/logged-in? cofx)
;; since `connection-success` event is received on both sender and receiver devices
;; we check the `logged-in?` status to identify the receiver and take the user to next screen
navigate-to-syncing-devices? (and connection-success? (not logged-in?))
user-in-syncing-devices-screen? (= (:view-id db) :syncing-devices)]
(merge {:db (cond-> db
connection-success?
(assoc-in [:syncing :pairing-in-progress?] true)
(assoc :local-pairing/completed-pairing? false)
error-on-pairing?
(update-in [:syncing :pairing-in-progress?] dissoc)
(dissoc :local-pairing/completed-pairing?)
completed-pairing?
(assoc-in [:syncing :pairing-in-progress?] false))}
(assoc :local-pairing/completed-pairing? true))}
(when navigate-to-syncing-devices?
{:dispatch [:navigate-to :syncing-devices]})
(when (and error-on-pairing? user-in-syncing-devices-screen?)
@@ -91,9 +89,7 @@
:icon-color colors/danger-50
:override-theme :light
:text (i18n/label :t/error-syncing-connection-failed)}]
[:navigate-back]]})
(when completed-pairing?
{:dispatch [:syncing/pairing-completed]}))))
[:navigate-back]]}))))
(rf/defn process
{:events [:signals/signal-received]}
@@ -10,7 +10,9 @@
[re-frame.core :as re-frame]
[reagent.core :as reagent]
[status-im2.constants :as chat.constants]
[status-im.chat.models.mentions :as mentions]
[utils.i18n :as i18n]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.icons.icons :as icons]
[status-im.ui.components.list.views :as list]
[status-im.ui.screens.chat.components.reply :as reply]
@@ -93,7 +95,7 @@
:color (styles/send-icon-color)}])]])
(defn on-selection-change
[timeout-id last-text-change args]
[timeout-id last-text-change mentionable-users args]
(let [selection (.-selection ^js (.-nativeEvent ^js args))
start (.-start selection)
end (.-end selection)]
@@ -104,9 +106,10 @@
(reset!
timeout-id
(utils.utils/set-timeout
#(re-frame/dispatch [:mention/on-selection-change
#(re-frame/dispatch [::mentions/on-selection-change
{:start start
:end end}])
:end end}
mentionable-users])
50)))
;; NOTE(rasom): on Android we dispatch event only in case if there
;; was no text changes during last 50ms. `on-selection-change` is
@@ -115,9 +118,10 @@
(when (and platform/android?
(or (not @last-text-change)
(< 50 (- (js/Date.now) @last-text-change))))
(re-frame/dispatch [:mention/on-selection-change
(re-frame/dispatch [::mentions/on-selection-change
{:start start
:end end}]))))
:end end}
mentionable-users]))))
(defonce input-texts (atom {}))
(defonce mentions-enabled (reagent/atom {}))
@@ -179,7 +183,7 @@
(re-frame/dispatch [:chat.ui/set-chat-input-text val]))
(defn on-change
[last-text-change timeout-id refs chat-id sending-image args]
[last-text-change timeout-id mentionable-users refs chat-id sending-image args]
(let [text (.-text ^js (.-nativeEvent ^js args))
prev-text (get @input-texts chat-id)]
(when (and (seq prev-text) (empty? text) (not sending-image))
@@ -202,24 +206,46 @@
;; NOTE(rasom): on iOS `on-change` is dispatched after `on-text-input`,
;; that's why mention suggestions are calculated on `on-change`
(when platform/ios?
(re-frame/dispatch [:mention/calculate-suggestions]))))
(re-frame/dispatch [::mentions/calculate-suggestions mentionable-users]))))
(rf/defn set-input-text
"Set input text for current-chat. Takes db and input text and cofx
as arguments and returns new fx. Always clear all validation messages."
{:events [:chat.ui.input/set-chat-input-text]}
[{:keys [db]} text chat-id]
(let [params [chat-id text]
method "wakuext_chatMentionToInputField"]
{:json-rpc/call [{:method method
:params params
:on-success #(rf/dispatch [:mention/on-to-input-field-success %])
:on-error #(rf/dispatch [:mention/on-error
{:method method
:params params} %])}]}))
(let [text-with-mentions (mentions/->input-field text)
all-contacts (:contacts/contacts db)
chat (get-in db [:chats chat-id])
current-multiaccount (:multiaccount db)
community-members (when (= (:chat-type chat) chat.constants/community-chat-type)
(get-in db [:communities (:community-id chat) :members]))
mentionable-users (mentions/get-mentionable-users
chat
all-contacts
current-multiaccount
community-members)
hydrated-mentions (map
(fn [[t mention :as e]]
(if (= t :mention)
(let [mention (multiaccounts/displayed-name
(get mentionable-users mention))]
[:mention
(if (string/starts-with? mention "@")
mention
(str "@" mention))])
e))
text-with-mentions)
info (mentions/->info hydrated-mentions)
new-text (string/join (map second hydrated-mentions))]
{:set-text-input-value [chat-id new-text]
:db
(-> db
(assoc-in [:chats/cursor chat-id] (:mention-end info))
(assoc-in [:chat/inputs-with-mentions chat-id] hydrated-mentions)
(assoc-in [:chats/mentions chat-id :mentions] info))}))
(defn on-text-input
[chat-id args]
[mentionable-users chat-id args]
(let [native-event (.-nativeEvent ^js args)
text (.-text ^js native-event)
previous-text (.-previousText ^js native-event)
@@ -230,7 +256,7 @@
(swap! mentions-enabled assoc chat-id true))
(re-frame/dispatch
[:mention/on-text-input
[::mentions/on-text-input
{:new-text text
:previous-text previous-text
:start start
@@ -239,11 +265,12 @@
;; `on-change`, that's why mention suggestions are calculated
;; on `on-change`
(when platform/android?
(re-frame/dispatch [:mention/calculate-suggestions]))))
(re-frame/dispatch [::mentions/calculate-suggestions mentionable-users]))))
(defn text-input
[{:keys [set-active-panel refs chat-id sending-image]}]
(let [cooldown-enabled? @(re-frame/subscribe [:chats/current-chat-cooldown-enabled?])
mentionable-users @(re-frame/subscribe [:chats/mentionable-users])
timeout-id (atom nil)
last-text-change (atom nil)
mentions-enabled (get @mentions-enabled chat-id)
@@ -269,10 +296,11 @@
:auto-capitalize :sentences
:on-selection-change (partial on-selection-change
timeout-id
last-text-change)
last-text-change
mentionable-users)
:on-change
(partial on-change last-text-change timeout-id refs chat-id sending-image)
:on-text-input (partial on-text-input chat-id)}
(partial on-change last-text-change timeout-id mentionable-users refs chat-id sending-image)
:on-text-input (partial on-text-input mentionable-users chat-id)}
(if mentions-enabled
(for [[idx [type text]] (map-indexed
(fn [idx item]
@@ -76,8 +76,7 @@
(format-reply-author from contact-name current-public-key)]])
(defn reply-message
[{:keys [from identicon content-type contentType parsed-text content deleted? deleted-for-me?
album-images-count]}
[{:keys [from identicon content-type contentType parsed-text content deleted? deleted-for-me?]}
in-chat-input? pin? recording-audio?]
(let [contact-name (rf/sub [:contacts/contact-name-by-identity from])
current-public-key (rf/sub [:multiaccount/public-key])
@@ -114,12 +113,9 @@
(= constants/content-type-audio content-type))
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}))}
(case (or content-type contentType)
constants/content-type-image (if album-images-count
(i18n/label :t/images-albums-count
{:album-images-count album-images-count})
(i18n/label :t/image))
constants/content-type-sticker (i18n/label :t/sticker)
constants/content-type-audio (i18n/label :t/audio)
constants/content-type-image "Image"
constants/content-type-sticker "Sticker"
constants/content-type-audio "Audio"
(get-quoted-text-with-mentions (or parsed-text (:parsed-text content))))]])]
(when (and in-chat-input? (not recording-audio?))
[quo2.button/button
@@ -5,6 +5,7 @@
[re-frame.core :as re-frame]
[reagent.core :as reagent]
[status-im2.constants :as chat.constants]
[status-im.chat.models.mentions :as mentions]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.transforms :as transforms]
@@ -92,7 +93,7 @@
(rf/dispatch [:chat.ui/set-chat-input-text val]))
(defn on-selection-change
[timeout-id last-text-change args]
[timeout-id last-text-change mentionable-users args]
(let [selection (.-selection ^js (.-nativeEvent ^js args))
start (.-start selection)
end (.-end selection)]
@@ -103,9 +104,10 @@
(reset!
timeout-id
(background-timer/set-timeout
#(rf/dispatch [:mention/on-selection-change
#(rf/dispatch [::mentions/on-selection-change
{:start start
:end end}])
:end end}
mentionable-users])
50)))
;; NOTE(rasom): on Android we dispatch event only in case if there
;; was no text changes during last 50ms. `on-selection-change` is
@@ -114,12 +116,13 @@
(when (and platform/android?
(or (not @last-text-change)
(< 50 (- (js/Date.now) @last-text-change))))
(rf/dispatch [:mention/on-selection-change
(rf/dispatch [::mentions/on-selection-change
{:start start
:end end}]))))
:end end}
mentionable-users]))))
(defn on-change
[last-text-change timeout-id refs chat-id sending-image args]
[last-text-change timeout-id mentionable-users refs chat-id sending-image args]
(let [text (.-text ^js (.-nativeEvent ^js args))
prev-text (get @input-texts chat-id)]
(when (and (seq prev-text) (empty? text) (not sending-image))
@@ -144,10 +147,10 @@
;; NOTE(rasom): on iOS `on-change` is dispatched after `on-text-input`,
;; that's why mention suggestions are calculated on `on-change`
(when platform/ios?
(rf/dispatch [:mention/calculate-suggestions]))))
(rf/dispatch [::mentions/calculate-suggestions mentionable-users]))))
(defn on-text-input
[chat-id args]
[mentionable-users chat-id args]
(let [native-event (.-nativeEvent ^js args)
text (.-text ^js native-event)
previous-text (.-previousText ^js native-event)
@@ -158,7 +161,7 @@
(swap! mentions-enabled? assoc chat-id true))
(rf/dispatch
[:mention/on-text-input
[::mentions/on-text-input
{:new-text text
:previous-text previous-text
:start start
@@ -167,7 +170,7 @@
;; `on-change`, that's why mention suggestions are calculated
;; on `on-change`
(when platform/android?
(rf/dispatch [:mention/calculate-suggestions]))))
(rf/dispatch [::mentions/calculate-suggestions mentionable-users]))))
(defn text-input-style
[chat-id]
@@ -190,6 +193,7 @@
(defn text-input
[{:keys [refs chat-id sending-image on-content-size-change]}]
(let [cooldown-enabled? (rf/sub [:chats/current-chat-cooldown-enabled?])
mentionable-users (rf/sub [:chats/mentionable-users])
timeout-id (reagent/atom nil)
last-text-change (reagent/atom nil)
mentions-enabled? (get @mentions-enabled? chat-id)
@@ -216,17 +220,18 @@
:on-content-size-change on-content-size-change
:on-selection-change (partial on-selection-change
timeout-id
last-text-change)
last-text-change
mentionable-users)
:on-change
(partial on-change last-text-change timeout-id refs chat-id sending-image)
:on-text-input (partial on-text-input chat-id)}
(partial on-change last-text-change timeout-id mentionable-users refs chat-id sending-image)
:on-text-input (partial on-text-input mentionable-users chat-id)}
input-with-mentions (rf/sub [:chat/input-with-mentions])
children (fn []
(if mentions-enabled?
(map-indexed
(fn [index [mention-type text]]
^{:key (str index "_" mention-type "_" text)}
[rn/text (when (= mention-type :mention) {:style {:color colors/primary-50}})
(fn [index [_ text]]
^{:key (str index "_" type "_" text)}
[rn/text (when (= type :mention) {:style {:color colors/primary-50}})
text])
input-with-mentions)
(get @input-texts chat-id)))]
@@ -184,7 +184,7 @@
on login, otherwise just handle it"
{:events [:universal-links/handle-url]}
[{:keys [db] :as cofx} url]
(if (and (multiaccounts.model/logged-in? db) (= (:app-state db) "active"))
(if (and (multiaccounts.model/logged-in? cofx) (= (:app-state db) "active"))
(route-url cofx url)
(store-url-for-later cofx url)))
-3
View File
@@ -263,9 +263,6 @@
An example of a connection string is -> cs2:5vd6J6:Jfc:27xMmHKEYwzRGXcvTtuiLZFfXscMx4Mz8d9wEHUxDj4p7:EG7Z13QScfWBJNJ5cprszzDQ5fBVsYMirXo8MaQFJvpF:3 "
"cs")
(def ^:const local-pairing-role-sender "sender")
(def ^:const local-pairing-role-receiver "receiver")
;; sender and receiver events
(def ^:const local-pairing-event-connection-success "connection-success")
(def ^:const local-pairing-event-connection-error "connection-error")
@@ -13,3 +13,5 @@
(def ^:const velocity-factor 0.5)
(def ^:const default-duration 300)
(def ^:const default-dimension 1000)
@@ -216,9 +216,11 @@
curr-orientation (or (rf/sub [:lightbox/orientation])
orientation/portrait)
portrait? (= curr-orientation orientation/portrait)
dimensions (utils/get-dimensions (or image-width (:window-width args))
(or image-height (:window-width args))
curr-orientation args)
dimensions (utils/get-dimensions
(or image-width c/default-dimension)
(or image-height c/default-duration)
curr-orientation
args)
animations {:scale (anim/use-val c/min-scale)
:saved-scale (anim/use-val c/min-scale)
:pan-x-start (anim/use-val c/init-offset)
@@ -15,8 +15,7 @@
[status-im2.contexts.onboarding.common.background.view :as background]
[status-im2.contexts.onboarding.sign-in.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.transforms :as transforms]))
[utils.re-frame :as rf]))
(defonce camera-permission-granted? (reagent/atom false))
@@ -86,20 +85,14 @@
(defn- qr-scan-hole-area
[qr-view-finder]
(let [status-bar-height (rn/status-bar-height)]
[rn/view
{:style style/qr-view-finder
:on-layout (fn [event]
(let [layout (transforms/js->clj (oops/oget event "nativeEvent.layout"))
width (:width layout)
y (if platform/android?
(+ status-bar-height (:y layout))
(:y layout))
view-finder (-> layout
(assoc :height width)
(assoc :y y))]
(reset! qr-view-finder view-finder)))}]))
[rn/view
{:style style/qr-view-finder
:on-layout (fn [event]
(let [layout (js->clj (oops/oget event "nativeEvent.layout")
:keywordize-keys
true)
view-finder (assoc layout :height (:width layout))]
(reset! qr-view-finder view-finder)))}])
(defn- border
[border1 border2 corner]
+5 -14
View File
@@ -13,17 +13,10 @@
(rf/defn local-pairing-completed
{:events [:syncing/pairing-completed]}
[{:keys [db]}]
(let [receiver? (= (get-in db [:syncing :role]) constants/local-pairing-role-receiver)]
(merge
{:db (dissoc db :syncing)}
(when receiver?
{:dispatch [:init-root :enable-notifications]}))))
(rf/defn local-pairing-update-role
{:events [:syncing/update-role]}
[{:keys [db]} role]
{:db (assoc-in db [:syncing :role] role)})
[{:keys [db] :as cofx}]
(rf/merge cofx
{:db (dissoc db :local-pairing/completed-pairing?)
:dispatch [:init-root :enable-notifications]}))
(defn- get-default-node-config
[installation-id]
@@ -51,7 +44,6 @@
:nodeConfig final-node-config
:settingCurrentNetwork config/default-network
:deviceType utils.platform/os}}))]
(rf/dispatch [:syncing/update-role constants/local-pairing-role-receiver])
(status/input-connection-string-for-bootstrapping
connection-string
config-map
@@ -69,8 +61,7 @@
[:show-bottom-sheet
{:content (fn []
[sheet/qr-code-view-with-connection-string
connection-string])}])
(rf/dispatch [:syncing/update-role constants/local-pairing-role-sender]))]
connection-string])}]))]
(if valid-password?
(let [sha3-pwd (status/sha3 (str (security/safe-unmask-data entered-password)))
key-uid (get-in db [:multiaccount :key-uid])
+21
View File
@@ -3,6 +3,7 @@
[quo.design-system.colors :as colors]
[re-frame.core :as re-frame]
[status-im.add-new.db :as db]
[status-im.chat.models.mentions :as mentions]
[status-im.communities.core :as communities]
[status-im.group-chats.core :as group-chat]
[status-im.group-chats.db :as group-chats.db]
@@ -437,6 +438,26 @@
(fn [[current-chat pk]]
(group-chat/member-removed? current-chat pk)))
(re-frame/reg-sub
:chats/mentionable-users
:<- [:chats/current-chat]
:<- [:contacts/blocked-set]
:<- [:contacts/contacts]
:<- [:multiaccount]
:<- [:communities/current-community-members]
(fn
[[{:keys [users] :as chat}
blocked
all-contacts
{:keys [public-key] :as current-multiaccount}
community-members]]
(let [mentionable-users (mentions/get-mentionable-users chat
all-contacts
current-multiaccount
community-members)
members-left (into #{} (filter #(group-chat/member-removed? chat %) (keys users)))]
(apply dissoc mentionable-users (conj (concat blocked members-left) public-key)))))
(re-frame/reg-sub
:chat/mention-suggestions
:<- [:chats/current-chat-id]
+1 -1
View File
@@ -29,7 +29,7 @@
(re-frame/reg-sub
:multiaccount/logged-in?
(fn [db]
(multiaccounts.model/logged-in? db)))
(multiaccounts.model/logged-in? {:db db})))
(re-frame/reg-sub
:hide-screen?
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.143.1",
"commit-sha1": "ee01fe4e0c14f03fb32dda15365da3c73470cde0",
"src-sha256": "0l5rld1p5nsvfahn8iymyn87a8h6wrllcx2jngcy7pxffbgk3619"
"version": "v0.142.4",
"commit-sha1": "142b170ec99498bbeb41d7f4ce5b7140db597e56",
"src-sha256": "038p3axqj4m2wczs3fg44535rn6y235hr23w9fjriaglp80p2z07"
}
+1 -1
View File
@@ -36,7 +36,7 @@ python-dateutil==2.8.1
pytz==2020.4
PyYAML==5.4
repoze.lru==0.7
requests==2.25.1
requests==2.28.2
rlp==3.0.0
sauceclient==1.0.0
scrypt==0.8.17
+12 -12
View File
@@ -1,23 +1,23 @@
import asyncio
import logging
from datetime import datetime
import os
import functools
import json
import logging
import os
from datetime import datetime
from support.appium_container import AppiumContainer
from support.test_data import TestSuiteData
import functools
import time
async def start_threads(quantity: int, func: type, returns: dict, *args):
loop = asyncio.get_event_loop()
# from tests.conftest import sauce
# for _ in range(60):
# if 16 - len([job for job in sauce.jobs.get_user_jobs() if job['status'] == 'in progress']) < quantity:
# time.sleep(10)
# from tests.conftest import sauce
# for _ in range(60):
# if 16 - len([job for job in sauce.jobs.get_user_jobs() if job['status'] == 'in progress']) < quantity:
# time.sleep(10)
for i in range(quantity):
returns[i] = loop.run_in_executor(None, func, *args)
# returns[i] = loop.run_in_executor(None, functools.partial(func, **kwargs))
for k in returns:
returns[k] = await returns[k]
return returns
@@ -44,6 +44,7 @@ def get_current_time():
def debug(text: str):
logging.debug(text)
appium_root_project_path = os.path.join(os.sep.join(__file__.split(os.sep)[:-1]), '../')
pytest_config_global = dict()
@@ -54,7 +55,7 @@ common_password = 'qwerty1234'
unique_password = 'unique' + get_current_time()
pin = '121212'
puk = '000000000000'
pair_code= '000000'
pair_code = '000000'
background_service_message = 'Background service for notifications'
bootnode_address = "enode://a8a97f126f5e3a340cb4db28a1187c325290ec08b2c9a6b1f19845ac86c46f9fac2ba13328822590" \
@@ -77,6 +78,5 @@ test_dapp_name = 'simpledapp.status.im'
emojis = {'thumbs-up': 2, 'thumbs-down': 3, 'love': 1, 'laugh': 4, 'angry': 6, 'sad': 5}
with open(os.sep.join(__file__.split(os.sep)[:-1]) + '/../../../translations/en.json') as json_file:
transl = json.load(json_file)
+40 -33
View File
@@ -15,7 +15,6 @@ from sauceclient import SauceException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.support.wait import WebDriverWait
from urllib3.exceptions import MaxRetryError
from support.api.network_api import NetworkApi
from support.github_report import GithubHtmlReport
@@ -70,10 +69,10 @@ def get_capabilities_sauce_lab():
desired_caps['name'] = test_suite_data.current_test.name
desired_caps['platformName'] = 'Android'
desired_caps['appiumVersion'] = '1.18.1'
desired_caps['platformVersion'] = '10.0'
desired_caps['platformVersion'] = '12.0'
desired_caps['deviceName'] = 'Android GoogleAPI Emulator'
desired_caps['deviceOrientation'] = "portrait"
desired_caps['commandTimeout'] = 600
desired_caps['newCommandTimeout'] = 600
desired_caps['idleTimeout'] = 1000
desired_caps['unicodeKeyboard'] = True
desired_caps['automationName'] = 'UiAutomator2'
@@ -301,17 +300,21 @@ def create_shared_drivers(quantity):
capabilities = {'maxDuration': 3600}
print('SC Executor: %s' % executor_sauce_lab)
try:
# options = webdriver.webdriver.AppiumOptions()
# for key, value in update_capabilities_sauce_lab(capabilities).items():
# options.set_capability(key, value)
drivers = loop.run_until_complete(start_threads(quantity,
Driver,
drivers,
executor_sauce_lab,
update_capabilities_sauce_lab(capabilities)))
Driver,
drivers,
executor_sauce_lab,
update_capabilities_sauce_lab(capabilities)))
for i in range(quantity):
test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
drivers[i].implicitly_wait(implicit_wait)
return drivers, loop
except MaxRetryError as e:
test_suite_data.current_test.testruns[-1].error = e.reason
except Exception as e:
loop.close()
raise e #from None
class LocalSharedMultipleDeviceTestCase(AbstractTestCase):
@@ -370,12 +373,14 @@ class SauceSharedMultipleDeviceTestCase(AbstractTestCase):
geth_names.append(
'%s_geth%s.log' % (test_suite_data.current_test.name, str(self.drivers[driver].number)))
geth_contents.append(self.pull_geth(self.drivers[driver]))
except (WebDriverException, AttributeError):
pass
finally:
geth = {geth_names[i]: geth_contents[i] for i in range(len(geth_names))}
test_suite_data.current_test.geth_paths = self.github_report.save_geth(geth)
try:
geth = {geth_names[i]: geth_contents[i] for i in range(len(geth_names))}
test_suite_data.current_test.geth_paths = self.github_report.save_geth(geth)
except IndexError:
pass
@pytest.fixture(scope='class', autouse=True)
def prepare(self, request):
@@ -390,28 +395,30 @@ class SauceSharedMultipleDeviceTestCase(AbstractTestCase):
from tests.conftest import sauce
requests_session = requests.Session()
requests_session.auth = (sauce_username, sauce_access_key)
for _, driver in cls.drivers.items():
session_id = driver.session_id
try:
sauce.jobs.update_job(username=sauce_username, job_id=session_id, name=cls.__name__)
except (RemoteDisconnected, SauceException):
pass
try:
driver.quit()
except WebDriverException:
pass
url = 'https://api.%s/rest/v1/%s/jobs/%s/assets/%s' % (apibase, sauce_username, session_id, "log.json")
WebDriverWait(driver, 60, 2).until(lambda _: requests_session.get(url).status_code == 200)
commands = requests_session.get(url).json()
for command in commands:
if hasattr(cls, 'drivers'):
for _, driver in cls.drivers.items():
session_id = driver.session_id
try:
if command['message'].startswith("Started "):
for test in test_suite_data.tests:
if command['message'] == "Started %s" % test.name:
test.testruns[-1].first_commands[session_id] = commands.index(command) + 1
except KeyError:
continue
cls.loop.close()
sauce.jobs.update_job(username=sauce_username, job_id=session_id, name=cls.__name__)
except (RemoteDisconnected, SauceException, ConnectionError):
pass
try:
driver.quit()
except WebDriverException:
pass
url = 'https://api.%s/rest/v1/%s/jobs/%s/assets/%s' % (apibase, sauce_username, session_id, "log.json")
WebDriverWait(driver, 60, 2).until(lambda _: requests_session.get(url).status_code == 200)
commands = requests_session.get(url).json()
for command in commands:
try:
if command['message'].startswith("Started "):
for test in test_suite_data.tests:
if command['message'] == "Started %s" % test.name:
test.testruns[-1].first_commands[session_id] = commands.index(command) + 1
except KeyError:
continue
if hasattr(cls, 'loop'):
cls.loop.close()
for test in test_suite_data.tests:
cls.github_report.save_test(test)
+1
View File
@@ -243,6 +243,7 @@ def should_save_device_stats(config):
return all(db_args)
# @pytest.hookimpl(hookwrapper=True)
@pytest.mark.hookwrapper
def pytest_runtest_makereport(item, call):
outcome = yield
+11 -11
View File
@@ -72,17 +72,17 @@ class BaseElement(object):
return None
def find_element(self):
for _ in range(3):
try:
self.driver.info("Find `%s` by `%s`: `%s`" % (self.name, self.by, self.exclude_emoji(self.locator)))
return self.driver.find_element(self.by, self.locator)
except NoSuchElementException:
raise NoSuchElementException(
"Device %s: %s by %s: `%s` is not found on the screen" % (
self.driver.number, self.name, self.by, self.locator)) from None
except Exception as exception:
if 'Internal Server Error' in str(exception):
continue
# for _ in range(3):
try:
self.driver.info("Find `%s` by `%s`: `%s`" % (self.name, self.by, self.exclude_emoji(self.locator)))
return self.driver.find_element(self.by, self.locator)
except NoSuchElementException:
raise NoSuchElementException(
"Device %s: %s by %s: `%s` is not found on the screen" % (
self.driver.number, self.name, self.by, self.locator)) from None
# except Exception as exception:
# if 'Internal Server Error' in str(exception):
# continue
def find_elements(self):
return self.driver.find_elements(self.by, self.locator)
+8 -1
View File
@@ -1,6 +1,8 @@
import time
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from selenium.common.exceptions import TimeoutException, NoSuchElementException, StaleElementReferenceException
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from tests import test_dapp_url
from views.base_element import Button, Text, BaseElement, SilentButton, CheckBox, EditBox
@@ -312,6 +314,11 @@ class HomeView(BaseView):
chat_element.cancel_contact_request()
else:
self.driver.fail("Illegal option for CR!")
try:
element = self.close_activity_centre.find_element()
WebDriverWait(self.driver, 30).until(expected_conditions.staleness_of(element))
except TimeoutException:
pass
self.close_activity_centre.click()
self.chats_tab.wait_for_visibility_of_element()
-1
View File
@@ -2018,7 +2018,6 @@
"you-have-no-contacts": "You have no contacts",
"my-albums": "My albums",
"images": "images",
"images-albums-count": "{{album-images-count}} images",
"only-6-images": "You can only add 6 images to your message",
"delivered": "Delivered",
"mark-all-notifications-as-read": "Mark all notifications as read",