Skip to content

Commit 85cd391

Browse files
authored
Add a hidden view-id-tracker view for e2e testing (#22434)
1 parent 628e5f7 commit 85cd391

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

.env.e2e

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ API_LOGGING_ENABLED=1
4343
SENTRY_ENABLED=0
4444
SENTRY_ENVIRONMENT=ci-main
4545
USE_PUBLIC_LOG_DIR=1
46+
VIEW_ID_TRACKER=1

.env.jenkins

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ API_LOGGING_ENABLED=1
4040
SENTRY_ENABLED=0
4141
SENTRY_ENVIRONMENT=ci-main
4242
USE_PUBLIC_LOG_DIR=0
43+
VIEW_ID_TRACKER=1

src/status_im/config.cljs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,6 @@
142142
;; download via Appium doesn't seem like a solid long-term
143143
;; approach for QA team
144144
(def use-public-log-dir? (enabled? (get-config :USE_PUBLIC_LOG_DIR "0")))
145+
146+
;; A flag for enabling hidden view-id-tracker view, required for e2e testing
147+
(def enable-view-id-tracker? (enabled? (get-config :VIEW_ID_TRACKER "0")))

src/status_im/contexts/shell/view.cljs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(:require
33
[quo.foundations.colors :as colors]
44
[react-native.core :as rn]
5+
[status-im.config :as config]
56
[status-im.contexts.shell.bottom-tabs.view :as bottom-tabs]
67
[status-im.contexts.shell.home-stack.view :as home-stack]
78
[status-im.contexts.shell.shared-values :as shared-values]
@@ -15,6 +16,16 @@
1516
(rf/dispatch [:navigate-back])
1617
true))
1718

19+
;; A hidden view-id-tracker view, required for e2e testing
20+
(defn- view-id-tracker
21+
[]
22+
(let [view-id (rf/sub [:view-id])]
23+
[rn/view
24+
{:accessible true
25+
:accessibility-label :view-id-tracker
26+
:style {:position :absolute :z-index -1}}
27+
[rn/text {:color :transparent} view-id]]))
28+
1829
(defn shell-stack
1930
[]
2031
(let [shared-values (shared-values/calculate-and-set-shared-values)]
@@ -23,5 +34,7 @@
2334
(rn/hw-back-add-listener navigate-back-handler)
2435
#(rn/hw-back-remove-listener navigate-back-handler)))
2536
[rn/view {:style {:background-color colors/neutral-100 :flex 1}}
37+
(when config/enable-view-id-tracker?
38+
[view-id-tracker])
2639
[home-stack/view shared-values]
2740
[bottom-tabs/view shared-values]]))

0 commit comments

Comments
 (0)