Skip to content

Commit f3e1497

Browse files
authored
test: fix unread badge test (#6752)
1 parent 6c4637a commit f3e1497

File tree

6 files changed

+182
-2
lines changed

6 files changed

+182
-2
lines changed

.maestro/tests/room/mark-as-unread.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ tags:
5353
timeout: 60000
5454
- extendedWaitUntil:
5555
visible:
56-
text: '.*1.*'
56+
id: 'unread-badge-1'
5757
childOf:
5858
id: 'rooms-list-view-item-${output.otherUser.username}'
5959
timeout: 60000
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
appId: chat.rocket.reactnative
2+
name: Unread badge
3+
onFlowStart:
4+
- runFlow: '../../helpers/setup.yaml'
5+
tags:
6+
- test-13
7+
8+
---
9+
- evalScript: ${output.user = output.utils.createUser()}
10+
- evalScript: ${output.otherUser = output.utils.createUser()}
11+
12+
- runFlow:
13+
file: '../../helpers/login-with-deeplink.yaml'
14+
env:
15+
USERNAME: ${output.user.username}
16+
PASSWORD: ${output.user.password}
17+
18+
# Should have normal unread indicator on normal message
19+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
20+
- extendedWaitUntil:
21+
visible:
22+
id: 'rooms-list-view-item-${output.otherUser.username}'
23+
timeout: 60000
24+
- extendedWaitUntil:
25+
visible:
26+
id: 'unread-badge-1'
27+
childOf:
28+
id: 'rooms-list-view-item-${output.otherUser.username}'
29+
timeout: 60000
30+
- tapOn:
31+
id: 'rooms-list-view-item-${output.otherUser.username}'
32+
- tapOn:
33+
id: header-back
34+
- extendedWaitUntil:
35+
notVisible:
36+
id: 'unread-badge-1'
37+
childOf:
38+
id: 'rooms-list-view-item-${output.otherUser.username}'
39+
timeout: 60000
40+
41+
# Should have mention unread indicator on mentioned message
42+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
43+
- extendedWaitUntil:
44+
visible:
45+
id: 'rooms-list-view-item-${output.otherUser.username}'
46+
timeout: 60000
47+
- extendedWaitUntil:
48+
visible:
49+
id: 'mention-badge-1'
50+
childOf:
51+
id: 'rooms-list-view-item-${output.otherUser.username}'
52+
timeout: 60000
53+
- tapOn:
54+
id: 'rooms-list-view-item-${output.otherUser.username}'
55+
- tapOn:
56+
id: header-back
57+
- extendedWaitUntil:
58+
notVisible:
59+
id: 'mention-badge-1'
60+
childOf:
61+
id: 'rooms-list-view-item-${output.otherUser.username}'
62+
timeout: 60000
63+
64+
# send normal message first and mention in next message and it should show mentioned unread indicator
65+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
66+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
67+
- extendedWaitUntil:
68+
visible:
69+
id: 'rooms-list-view-item-${output.otherUser.username}'
70+
timeout: 60000
71+
- extendedWaitUntil:
72+
visible:
73+
id: 'mention-badge-2'
74+
childOf:
75+
id: 'rooms-list-view-item-${output.otherUser.username}'
76+
timeout: 60000
77+
- tapOn:
78+
id: 'rooms-list-view-item-${output.otherUser.username}'
79+
- tapOn:
80+
id: header-back
81+
- extendedWaitUntil:
82+
notVisible:
83+
id: 'mention-badge-2'
84+
childOf:
85+
id: 'rooms-list-view-item-${output.otherUser.username}'
86+
timeout: 60000
87+
88+
# send mention message first and normal message in next message and it should show mentioned unread indicator
89+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
90+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
91+
- extendedWaitUntil:
92+
visible:
93+
id: 'rooms-list-view-item-${output.otherUser.username}'
94+
timeout: 60000
95+
- extendedWaitUntil:
96+
visible:
97+
id: 'mention-badge-2'
98+
childOf:
99+
id: 'rooms-list-view-item-${output.otherUser.username}'
100+
timeout: 60000
101+
- tapOn:
102+
id: 'rooms-list-view-item-${output.otherUser.username}'
103+
- tapOn:
104+
id: header-back
105+
- extendedWaitUntil:
106+
notVisible:
107+
id: 'mention-badge-2'
108+
childOf:
109+
id: 'rooms-list-view-item-${output.otherUser.username}'
110+
timeout: 60000

app/containers/Header/components/HeaderButton/__snapshots__/HeaderButtons.test.tsx.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ exports[`Story Snapshots: Badge should match snapshot 1`] = `
204204
},
205205
]
206206
}
207+
testID="unread-badge-1"
207208
>
208209
<Text
209210
numberOfLines={1}
@@ -319,6 +320,7 @@ exports[`Story Snapshots: Badge should match snapshot 1`] = `
319320
},
320321
]
321322
}
323+
testID="unread-badge-1"
322324
>
323325
<Text
324326
numberOfLines={1}
@@ -434,6 +436,7 @@ exports[`Story Snapshots: Badge should match snapshot 1`] = `
434436
},
435437
]
436438
}
439+
testID="unread-badge-1"
437440
>
438441
<Text
439442
numberOfLines={1}
@@ -3703,6 +3706,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
37033706
},
37043707
]
37053708
}
3709+
testID="unread-badge-1"
37063710
>
37073711
<Text
37083712
numberOfLines={1}
@@ -4258,6 +4262,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
42584262
},
42594263
]
42604264
}
4265+
testID="unread-badge-1"
42614266
>
42624267
<Text
42634268
numberOfLines={1}
@@ -4813,6 +4818,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
48134818
},
48144819
]
48154820
}
4821+
testID="unread-badge-1"
48164822
>
48174823
<Text
48184824
numberOfLines={1}

app/containers/RoomItem/__snapshots__/RoomItem.test.tsx.snap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
12881288
undefined,
12891289
]
12901290
}
1291+
testID="unread-badge-1"
12911292
>
12921293
<Text
12931294
numberOfLines={1}
@@ -1966,6 +1967,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
19661967
undefined,
19671968
]
19681969
}
1970+
testID="unread-badge-+999"
19691971
>
19701972
<Text
19711973
numberOfLines={1}
@@ -2644,6 +2646,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
26442646
undefined,
26452647
]
26462648
}
2649+
testID="mention-badge-1"
26472650
>
26482651
<Text
26492652
numberOfLines={1}
@@ -3322,6 +3325,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
33223325
undefined,
33233326
]
33243327
}
3328+
testID="group-mention-badge-1"
33253329
>
33263330
<Text
33273331
numberOfLines={1}
@@ -4000,6 +4004,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
40004004
undefined,
40014005
]
40024006
}
4007+
testID="unread-badge-1"
40034008
>
40044009
<Text
40054010
numberOfLines={1}
@@ -4678,6 +4683,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
46784683
undefined,
46794684
]
46804685
}
4686+
testID="unread-badge-1"
46814687
>
46824688
<Text
46834689
numberOfLines={1}
@@ -5356,6 +5362,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
53565362
undefined,
53575363
]
53585364
}
5365+
testID="unread-badge-1"
53595366
>
53605367
<Text
53615368
numberOfLines={1}
@@ -6034,6 +6041,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
60346041
undefined,
60356042
]
60366043
}
6044+
testID="mention-badge-1"
60376045
>
60386046
<Text
60396047
numberOfLines={1}
@@ -6712,6 +6720,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
67126720
undefined,
67136721
]
67146722
}
6723+
testID="group-mention-badge-1"
67156724
>
67166725
<Text
67176726
numberOfLines={1}
@@ -7390,6 +7399,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
73907399
undefined,
73917400
]
73927401
}
7402+
testID="unread-badge-1"
73937403
>
73947404
<Text
73957405
numberOfLines={1}
@@ -8699,6 +8709,7 @@ exports[`Story Snapshots: CondensedRoomItem should match snapshot 1`] = `
86998709
undefined,
87008710
]
87018711
}
8712+
testID="unread-badge-1"
87028713
>
87038714
<Text
87048715
numberOfLines={1}
@@ -9377,6 +9388,7 @@ exports[`Story Snapshots: CondensedRoomItem should match snapshot 1`] = `
93779388
undefined,
93789389
]
93799390
}
9391+
testID="unread-badge-+999"
93809392
>
93819393
<Text
93829394
numberOfLines={1}
@@ -10663,6 +10675,7 @@ exports[`Story Snapshots: CondensedRoomItemWithoutAvatar should match snapshot 1
1066310675
undefined,
1066410676
]
1066510677
}
10678+
testID="unread-badge-1"
1066610679
>
1066710680
<Text
1066810681
numberOfLines={1}
@@ -12507,6 +12520,7 @@ exports[`Story Snapshots: ExpandedRoomItemWithoutAvatar should match snapshot 1`
1250712520
undefined,
1250812521
]
1250912522
}
12523+
testID="unread-badge-1"
1251012524
>
1251112525
<Text
1251212526
numberOfLines={1}
@@ -13175,6 +13189,7 @@ exports[`Story Snapshots: ExpandedRoomItemWithoutAvatar should match snapshot 1`
1317513189
undefined,
1317613190
]
1317713191
}
13192+
testID="unread-badge-1"
1317813193
>
1317913194
<Text
1318013195
numberOfLines={1}
@@ -17133,6 +17148,7 @@ exports[`Story Snapshots: LastMessage should match snapshot 1`] = `
1713317148
undefined,
1713417149
]
1713517150
}
17151+
testID="unread-badge-1"
1713617152
>
1713717153
<Text
1713817154
numberOfLines={1}
@@ -17842,6 +17858,7 @@ exports[`Story Snapshots: LastMessage should match snapshot 1`] = `
1784217858
undefined,
1784317859
]
1784417860
}
17861+
testID="unread-badge-+999"
1784517862
>
1784617863
<Text
1784717864
numberOfLines={1}
@@ -18551,6 +18568,7 @@ exports[`Story Snapshots: LastMessage should match snapshot 1`] = `
1855118568
undefined,
1855218569
]
1855318570
}
18571+
testID="unread-badge-1"
1855418572
>
1855518573
<Text
1855618574
numberOfLines={1}

0 commit comments

Comments
 (0)