Skip to content

Commit 291bc80

Browse files
authored
Merge branch 'main' into fix/canonicalize-typed-sign-data
2 parents c255c17 + 70977ad commit 291bc80

56 files changed

Lines changed: 3418 additions & 602 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run-appium-smoke-tests-android.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,49 @@ jobs:
149149
metamask_environment: ${{ inputs.metamask_environment }}
150150
runner_provider: ${{ inputs.runner_provider }}
151151
secrets: inherit
152+
153+
appium-network-abstractions-android-smoke:
154+
if: >-
155+
${{
156+
!cancelled() &&
157+
(contains(fromJson(inputs.selected_tags), 'ALL') ||
158+
contains(fromJson(inputs.selected_tags), 'SmokeNetworkAbstractions'))
159+
}}
160+
strategy:
161+
matrix:
162+
split: [1]
163+
fail-fast: false
164+
uses: ./.github/workflows/run-appium-e2e-workflow.yml
165+
with:
166+
test-suite-name: appium-network-abstractions-android-smoke
167+
platform: android
168+
test_suite_tag: SmokeNetworkAbstractions
169+
split_number: ${{ matrix.split }}
170+
total_splits: 1
171+
build_type: ${{ inputs.build_type }}
172+
metamask_environment: ${{ inputs.metamask_environment }}
173+
runner_provider: ${{ inputs.runner_provider }}
174+
secrets: inherit
175+
176+
appium-wallet-platform-android-smoke:
177+
if: >-
178+
${{
179+
!cancelled() &&
180+
(contains(fromJson(inputs.selected_tags), 'ALL') ||
181+
contains(fromJson(inputs.selected_tags), 'SmokeWalletPlatform'))
182+
}}
183+
strategy:
184+
matrix:
185+
split: [1]
186+
fail-fast: false
187+
uses: ./.github/workflows/run-appium-e2e-workflow.yml
188+
with:
189+
test-suite-name: appium-wallet-platform-android-smoke
190+
platform: android
191+
test_suite_tag: SmokeWalletPlatform
192+
split_number: ${{ matrix.split }}
193+
total_splits: 1
194+
build_type: ${{ inputs.build_type }}
195+
metamask_environment: ${{ inputs.metamask_environment }}
196+
runner_provider: ${{ inputs.runner_provider }}
197+
secrets: inherit

.github/workflows/run-appium-smoke-tests-ios.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,49 @@ jobs:
128128
metamask_environment: ${{ inputs.metamask_environment || 'e2e' }}
129129
runner_provider: ${{ inputs.runner_provider || 'current' }}
130130
secrets: inherit
131+
132+
appium-network-abstractions-ios-smoke:
133+
if: >-
134+
${{
135+
!cancelled() &&
136+
(contains(fromJson(inputs.selected_tags || '["ALL"]'), 'ALL') ||
137+
contains(fromJson(inputs.selected_tags || '["ALL"]'), 'SmokeNetworkAbstractions'))
138+
}}
139+
strategy:
140+
matrix:
141+
split: [1]
142+
fail-fast: false
143+
uses: ./.github/workflows/run-appium-e2e-workflow.yml
144+
with:
145+
test-suite-name: appium-network-abstractions-ios-smoke
146+
platform: ios
147+
test_suite_tag: SmokeNetworkAbstractions
148+
split_number: ${{ matrix.split }}
149+
total_splits: 1
150+
build_type: ${{ inputs.build_type || 'main' }}
151+
metamask_environment: ${{ inputs.metamask_environment || 'e2e' }}
152+
runner_provider: ${{ inputs.runner_provider || 'current' }}
153+
secrets: inherit
154+
155+
appium-wallet-platform-ios-smoke:
156+
if: >-
157+
${{
158+
!cancelled() &&
159+
(contains(fromJson(inputs.selected_tags || '["ALL"]'), 'ALL') ||
160+
contains(fromJson(inputs.selected_tags || '["ALL"]'), 'SmokeWalletPlatform'))
161+
}}
162+
strategy:
163+
matrix:
164+
split: [1]
165+
fail-fast: false
166+
uses: ./.github/workflows/run-appium-e2e-workflow.yml
167+
with:
168+
test-suite-name: appium-wallet-platform-ios-smoke
169+
platform: ios
170+
test_suite_tag: SmokeWalletPlatform
171+
split_number: ${{ matrix.split }}
172+
total_splits: 1
173+
build_type: ${{ inputs.build_type || 'main' }}
174+
metamask_environment: ${{ inputs.metamask_environment || 'e2e' }}
175+
runner_provider: ${{ inputs.runner_provider || 'current' }}
176+
secrets: inherit

app/components/UI/Predict/Predict.testIds.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ export const PredictHomeSelectorsIDs = {
5353
CATEGORIES_SECTION: 'predict-home-categories-section',
5454
POPULAR_TODAY_SECTION: 'predict-home-popular-today-section',
5555
TRENDING_SECTION: 'predict-home-trending-section',
56+
// Wrappers that measure each section for scroll-into-view impression tracking.
57+
LIVE_NOW_IMPRESSION: 'predict-home-live-now-impression',
58+
CATEGORIES_IMPRESSION: 'predict-home-categories-impression',
59+
POPULAR_TODAY_IMPRESSION: 'predict-home-popular-today-impression',
60+
TRENDING_IMPRESSION: 'predict-home-trending-impression',
5661
} as const;
5762

5863
// ========================================

app/components/UI/Predict/constants/eventNames.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ export const PredictEventProperties = {
6767
SESSION_ID: 'session_id',
6868
IS_SESSION_END: 'is_session_end',
6969

70+
// Redesigned home + generic feed IA (PRED-834)
71+
FEED_ID: 'feed_id',
72+
TAB_ID: 'tab_id',
73+
FILTER_ID: 'filter_id',
74+
SECTION_ID: 'section_id',
75+
IS_DYNAMIC_FILTER: 'is_dynamic_filter',
76+
TRACKING_MODE: 'tracking_mode',
77+
7078
// Payment token (buy-with-any-token flow only)
7179
PAYMENT_TOKEN_ADDRESS: 'payment_token_address',
7280
PAYMENT_TOKEN_SYMBOL: 'payment_token_symbol',
@@ -174,6 +182,13 @@ export const PredictEventValues = {
174182
ACTION_TYPE: {
175183
VIEWED: 'viewed',
176184
CLICKED: 'clicked',
185+
SEE_ALL: 'see_all',
186+
},
187+
SECTION_ID: {
188+
LIVE_NOW: 'live_now',
189+
CATEGORIES: 'categories',
190+
POPULAR_TODAY: 'popular_today',
191+
TRENDING: 'trending',
177192
},
178193
BANNER_TYPE: {
179194
WORLD_CUP: 'world_cup',

app/components/UI/Predict/controllers/PredictAnalytics.test.ts

Lines changed: 168 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ describe('PredictAnalytics', () => {
693693
});
694694
});
695695

696-
it('tracks feed viewed with session end defaulting to false', () => {
696+
it('tracks feed viewed with session fields when provided', () => {
697697
predictAnalytics.trackFeedViewed({
698698
sessionId: 's1',
699699
feedTab: 'trending',
@@ -702,6 +702,7 @@ describe('PredictAnalytics', () => {
702702
numPagesViewed: 3,
703703
sessionTime: 98,
704704
entryPoint: 'carousel',
705+
isSessionEnd: false,
705706
portfolioModuleEnabled: true,
706707
});
707708

@@ -771,39 +772,6 @@ describe('PredictAnalytics', () => {
771772
});
772773
});
773774

774-
it('tracks category clicked with category name and entry point', () => {
775-
predictAnalytics.trackCategoryClicked({
776-
categoryName: 'politics',
777-
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
778-
});
779-
780-
const event = getTrackedEvent();
781-
782-
expect(event.name).toBe(
783-
MetaMetricsEvents.PREDICT_CATEGORY_CLICKED.category,
784-
);
785-
expect(event.properties).toMatchObject({
786-
category_name: 'politics',
787-
entry_point: PredictEventValues.ENTRY_POINT.HOME_SECTION,
788-
});
789-
});
790-
791-
it('tracks category clicked without an entry point', () => {
792-
predictAnalytics.trackCategoryClicked({
793-
categoryName: 'sports',
794-
});
795-
796-
const event = getTrackedEvent();
797-
798-
expect(event.name).toBe(
799-
MetaMetricsEvents.PREDICT_CATEGORY_CLICKED.category,
800-
);
801-
expect(event.properties).toMatchObject({
802-
category_name: 'sports',
803-
});
804-
expect(event.properties).not.toHaveProperty('entry_point');
805-
});
806-
807775
it('tracks share action with optional market fields', () => {
808776
predictAnalytics.trackShareAction({
809777
status: PredictShareStatus.SUCCESS,
@@ -916,5 +884,171 @@ describe('PredictAnalytics', () => {
916884
entry_point: 'home_section',
917885
});
918886
});
887+
888+
it('tracks generic feed viewed with feed/tab/filter ids and no session fields', () => {
889+
predictAnalytics.trackFeedViewed({
890+
feedId: 'sports',
891+
tabId: 'basketball',
892+
filterId: 'live',
893+
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
894+
});
895+
896+
const feedEvent = getTrackEventMock().mock.calls[0][0] as TrackedEvent;
897+
898+
expect(feedEvent.name).toBe(
899+
MetaMetricsEvents.PREDICT_FEED_VIEWED.category,
900+
);
901+
expect(feedEvent.properties).toMatchObject({
902+
feed_id: 'sports',
903+
tab_id: 'basketball',
904+
filter_id: 'live',
905+
entry_point: PredictEventValues.ENTRY_POINT.HOME_SECTION,
906+
});
907+
// Lightweight one-shot path omits every session-only field.
908+
expect(feedEvent.properties).not.toHaveProperty('session_id');
909+
expect(feedEvent.properties).not.toHaveProperty('is_session_end');
910+
expect(feedEvent.properties).not.toHaveProperty('predict_feed_tab');
911+
expect(feedEvent.properties).not.toHaveProperty(
912+
'num_feed_pages_viewed_in_session',
913+
);
914+
});
915+
916+
it('tracks home viewed with entry point', () => {
917+
predictAnalytics.trackHomeViewed({
918+
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
919+
});
920+
921+
const event = getTrackedEvent();
922+
923+
expect(event.name).toBe(MetaMetricsEvents.PREDICT_HOME_VIEWED.category);
924+
expect(event.properties).toEqual({
925+
entry_point: PredictEventValues.ENTRY_POINT.HOME_SECTION,
926+
});
927+
});
928+
929+
it('tracks home viewed with no properties when entry point is unknown', () => {
930+
predictAnalytics.trackHomeViewed({});
931+
932+
const event = getTrackedEvent();
933+
934+
expect(event.name).toBe(MetaMetricsEvents.PREDICT_HOME_VIEWED.category);
935+
expect(event.properties).toEqual({});
936+
});
937+
938+
it('tracks a home section viewed impression', () => {
939+
predictAnalytics.trackHomeSectionInteraction({
940+
sectionId: PredictEventValues.SECTION_ID.TRENDING,
941+
actionType: PredictEventValues.ACTION_TYPE.VIEWED,
942+
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
943+
});
944+
945+
const event = getTrackedEvent();
946+
947+
expect(event.name).toBe(
948+
MetaMetricsEvents.PREDICT_HOME_SECTION_INTERACTION.category,
949+
);
950+
expect(event.properties).toEqual({
951+
section_id: PredictEventValues.SECTION_ID.TRENDING,
952+
action_type: PredictEventValues.ACTION_TYPE.VIEWED,
953+
entry_point: PredictEventValues.ENTRY_POINT.HOME_SECTION,
954+
});
955+
});
956+
957+
it('tracks a home section see-all tap', () => {
958+
predictAnalytics.trackHomeSectionInteraction({
959+
sectionId: PredictEventValues.SECTION_ID.LIVE_NOW,
960+
actionType: PredictEventValues.ACTION_TYPE.SEE_ALL,
961+
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
962+
});
963+
964+
const event = getTrackedEvent();
965+
966+
expect(event.properties).toMatchObject({
967+
section_id: PredictEventValues.SECTION_ID.LIVE_NOW,
968+
action_type: PredictEventValues.ACTION_TYPE.SEE_ALL,
969+
});
970+
});
971+
972+
it('tracks a categories tile tap with category_name and no filter fields', () => {
973+
predictAnalytics.trackHomeSectionInteraction({
974+
sectionId: PredictEventValues.SECTION_ID.CATEGORIES,
975+
actionType: PredictEventValues.ACTION_TYPE.CLICKED,
976+
categoryName: 'politics',
977+
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
978+
});
979+
980+
const event = getTrackedEvent();
981+
982+
expect(event.name).toBe(
983+
MetaMetricsEvents.PREDICT_HOME_SECTION_INTERACTION.category,
984+
);
985+
expect(event.properties).toEqual({
986+
section_id: PredictEventValues.SECTION_ID.CATEGORIES,
987+
action_type: PredictEventValues.ACTION_TYPE.CLICKED,
988+
category_name: 'politics',
989+
entry_point: PredictEventValues.ENTRY_POINT.HOME_SECTION,
990+
});
991+
expect(event.properties).not.toHaveProperty('filter_id');
992+
expect(event.properties).not.toHaveProperty('is_dynamic_filter');
993+
});
994+
995+
it('tracks a dynamic-filter chip tap with filter id and is_dynamic_filter', () => {
996+
predictAnalytics.trackHomeSectionInteraction({
997+
sectionId: PredictEventValues.SECTION_ID.POPULAR_TODAY,
998+
actionType: PredictEventValues.ACTION_TYPE.CLICKED,
999+
filterId: 'elections',
1000+
isDynamicFilter: true,
1001+
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
1002+
});
1003+
1004+
const event = getTrackedEvent();
1005+
1006+
expect(event.properties).toMatchObject({
1007+
section_id: PredictEventValues.SECTION_ID.POPULAR_TODAY,
1008+
action_type: PredictEventValues.ACTION_TYPE.CLICKED,
1009+
filter_id: 'elections',
1010+
is_dynamic_filter: true,
1011+
});
1012+
});
1013+
1014+
it('tracks a feed tab change', () => {
1015+
predictAnalytics.trackFeedTabChanged({
1016+
feedId: 'sports',
1017+
tabId: 'tennis',
1018+
entryPoint: PredictEventValues.ENTRY_POINT.HOME_SECTION,
1019+
});
1020+
1021+
const event = getTrackedEvent();
1022+
1023+
expect(event.name).toBe(
1024+
MetaMetricsEvents.PREDICT_FEED_TAB_CHANGED.category,
1025+
);
1026+
expect(event.properties).toMatchObject({
1027+
feed_id: 'sports',
1028+
tab_id: 'tennis',
1029+
entry_point: PredictEventValues.ENTRY_POINT.HOME_SECTION,
1030+
});
1031+
});
1032+
1033+
it('tracks a feed filter change with is_dynamic_filter false for a static filter', () => {
1034+
predictAnalytics.trackFeedFilterChanged({
1035+
feedId: 'sports',
1036+
tabId: 'tennis',
1037+
filterId: 'live',
1038+
isDynamicFilter: false,
1039+
});
1040+
1041+
const event = getTrackedEvent();
1042+
1043+
expect(event.name).toBe(
1044+
MetaMetricsEvents.PREDICT_FEED_FILTER_CHANGED.category,
1045+
);
1046+
expect(event.properties).toMatchObject({
1047+
feed_id: 'sports',
1048+
tab_id: 'tennis',
1049+
filter_id: 'live',
1050+
is_dynamic_filter: false,
1051+
});
1052+
});
9191053
});
9201054
});

0 commit comments

Comments
 (0)