Skip to content

Commit 544e5fa

Browse files
authored
test: Add teams coverage to Maestro (#6575)
1 parent d0b8be5 commit 544e5fa

File tree

5 files changed

+291
-1
lines changed

5 files changed

+291
-1
lines changed

.maestro/helpers/navigate-to-login.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ tags:
55
---
66
- tapOn: Workspace URL. Required.
77
- inputText: ${output.data.server}
8-
- tapOn: Connect
8+
- tapOn:
9+
text: Connect
10+
waitToSettleTimeoutMs: 1000
911
- extendedWaitUntil:
1012
timeout: 60000
1113
visible: Login
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
appId: chat.rocket.reactnative
2+
name: Navigate to room action
3+
jsEngine: graaljs
4+
tags:
5+
- 'util'
6+
7+
---
8+
- runFlow:
9+
when:
10+
notVisible:
11+
id: 'room-view'
12+
commands:
13+
- runFlow:
14+
file: './navigate-to-room.yaml'
15+
env:
16+
ROOM: ${ROOM}
17+
18+
- extendedWaitUntil:
19+
visible:
20+
id: 'room-view'
21+
timeout: 60000
22+
- assertVisible:
23+
id: 'room-header'
24+
index: 0
25+
- tapOn:
26+
id: 'room-header'
27+
index: 0
28+
- extendedWaitUntil:
29+
visible:
30+
id: 'room-actions-view'
31+
timeout: 60000

.maestro/teams/convert-team.yaml

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
appId: chat.rocket.reactnative
2+
name: Convert Team
3+
jsEngine: graaljs
4+
onFlowStart:
5+
- runFlow: '../helpers/setup.yaml'
6+
onFlowEnd:
7+
- evalScript: ${output.utils.deleteCreatedUsers()}
8+
9+
---
10+
- runFlow: ../helpers/launch-app.yaml
11+
- runFlow: ../helpers/login.yaml
12+
- evalScript: ${output.toBeConverted = 'to-be-converted-' + output.random()}
13+
- evalScript: ${output.toBeMoved = 'to-be-moved-' + output.random()}
14+
- evalScript: ${output.publicChannelToBeConverted = 'channel-public-to-be-converted-' + output.random()}
15+
16+
# should convert public channel to a team
17+
- runFlow:
18+
file: './utils/create-channel.yaml'
19+
env:
20+
channelName: ${output.publicChannelToBeConverted}
21+
publicChannel: true
22+
- runFlow:
23+
file: '../helpers/navigate-to-room-action.yaml'
24+
env:
25+
ROOM: ${output.publicChannelToBeConverted}
26+
- scrollUntilVisible:
27+
element:
28+
id: 'room-actions-convert-to-team'
29+
- tapOn:
30+
id: 'room-actions-convert-to-team'
31+
- extendedWaitUntil:
32+
visible:
33+
text: '.*You are converting this channel to a team. All members will be kept.*'
34+
timeout: 60000
35+
- assertVisible:
36+
text: 'Convert'
37+
- tapOn:
38+
text: 'Convert'
39+
- extendedWaitUntil:
40+
visible:
41+
id: 'room-view-title-${output.publicChannelToBeConverted}'
42+
timeout: 60000
43+
- runFlow: '../helpers/go-back.yaml'
44+
- extendedWaitUntil:
45+
visible:
46+
id: 'rooms-list-view'
47+
timeout: 60000
48+
49+
# should convert private channel to a team
50+
- runFlow:
51+
file: './utils/create-channel.yaml'
52+
env:
53+
channelName: ${output.toBeConverted}
54+
- runFlow:
55+
file: '../helpers/navigate-to-room-action.yaml'
56+
env:
57+
ROOM: ${output.toBeConverted}
58+
- scrollUntilVisible:
59+
element:
60+
id: 'room-actions-convert-to-team'
61+
- tapOn:
62+
id: 'room-actions-convert-to-team'
63+
- extendedWaitUntil:
64+
visible:
65+
text: '.*You are converting this channel to a team. All members will be kept.*'
66+
timeout: 60000
67+
- assertVisible:
68+
text: 'Convert'
69+
- tapOn:
70+
text: 'Convert'
71+
- extendedWaitUntil:
72+
visible:
73+
id: 'room-view-title-${output.toBeConverted}'
74+
timeout: 60000
75+
- runFlow: '../helpers/go-back.yaml'
76+
- extendedWaitUntil:
77+
visible:
78+
id: 'rooms-list-view'
79+
timeout: 60000
80+
81+
# should move channel to a team
82+
- runFlow:
83+
file: './utils/create-channel.yaml'
84+
env:
85+
channelName: ${output.toBeMoved}
86+
- runFlow:
87+
file: '../helpers/navigate-to-room-action.yaml'
88+
env:
89+
ROOM: ${output.toBeMoved}
90+
- scrollUntilVisible:
91+
element:
92+
id: 'room-actions-move-to-team'
93+
- tapOn:
94+
id: room-actions-move-to-team
95+
- extendedWaitUntil:
96+
visible:
97+
id: select-list-view-submit
98+
timeout: 60000
99+
- tapOn:
100+
id: select-list-view-submit
101+
- extendedWaitUntil:
102+
visible:
103+
id: 'select-list-view-item-${output.toBeConverted}'
104+
timeout: 60000
105+
- tapOn:
106+
id: 'select-list-view-item-${output.toBeConverted}'
107+
- extendedWaitUntil:
108+
visible:
109+
id: 'select-list-view-submit'
110+
timeout: 60000
111+
- tapOn:
112+
id: 'select-list-view-submit'
113+
- extendedWaitUntil:
114+
visible:
115+
text: '.*After reading the previous instructions about this behavior, do you still want to move this channel to the selected team?.*'
116+
timeout: 60000
117+
- assertVisible:
118+
text: 'Yes, move it!'
119+
- tapOn:
120+
text: 'Yes, move it!'
121+
- extendedWaitUntil:
122+
visible:
123+
id: 'room-header'
124+
timeout: 60000
125+
- tapOn:
126+
id: 'room-header'
127+
- extendedWaitUntil:
128+
visible:
129+
id: 'room-actions-teams'
130+
timeout: 60000
131+
- runFlow: '../helpers/go-back.yaml'
132+
- runFlow: '../helpers/go-back.yaml'
133+
- extendedWaitUntil:
134+
visible:
135+
id: 'rooms-list-view'
136+
timeout: 60000
137+
138+
# should convert a team to a channel
139+
- runFlow:
140+
file: '../helpers/navigate-to-room-action.yaml'
141+
env:
142+
ROOM: ${output.toBeConverted}
143+
- scrollUntilVisible:
144+
element:
145+
text: 'Convert to channel'
146+
- tapOn: 'Convert to channel'
147+
- extendedWaitUntil:
148+
visible:
149+
text: '.*Converting team to channel.*'
150+
timeout: 60000
151+
- extendedWaitUntil:
152+
visible:
153+
id: 'select-list-view-item-${output.toBeMoved}'
154+
timeout: 60000
155+
- tapOn:
156+
id: 'select-list-view-item-${output.toBeMoved}'
157+
- extendedWaitUntil:
158+
visible:
159+
id: 'select-list-view-submit'
160+
timeout: 60000
161+
- tapOn:
162+
id: 'select-list-view-submit'
163+
- extendedWaitUntil:
164+
visible:
165+
text: '.*You are converting this team to a channel.*'
166+
timeout: 60000
167+
- assertVisible:
168+
text: 'Convert'
169+
- tapOn:
170+
text: 'Convert'
171+
- extendedWaitUntil:
172+
visible:
173+
id: 'room-view'
174+
timeout: 60000
175+
- extendedWaitUntil:
176+
visible:
177+
id: 'room-view-title-${output.toBeConverted}'
178+
timeout: 60000
179+
- runFlow: '../helpers/go-back.yaml'
180+
- extendedWaitUntil:
181+
visible:
182+
id: 'rooms-list-view'
183+
timeout: 60000
184+
- extendedWaitUntil:
185+
notVisible:
186+
id: 'rooms-list-view-item-${output.toBeMoved}'
187+
timeout: 60000

.maestro/teams/team.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
appId: chat.rocket.reactnative
2+
name: Team
23
jsEngine: graaljs
34
onFlowStart:
45
- runFlow: '../helpers/setup.yaml'
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
appId: chat.rocket.reactnative
2+
tags:
3+
- 'util'
4+
5+
---
6+
- extendedWaitUntil:
7+
visible:
8+
id: rooms-list-view-create-channel
9+
timeout: 60000
10+
- tapOn:
11+
id: rooms-list-view-create-channel
12+
- extendedWaitUntil:
13+
visible:
14+
id: new-message-view
15+
timeout: 60000
16+
- extendedWaitUntil:
17+
visible:
18+
id: new-message-view-create-channel
19+
timeout: 60000
20+
- tapOn:
21+
id: new-message-view-create-channel
22+
- extendedWaitUntil:
23+
visible:
24+
id: select-users-view
25+
timeout: 60000
26+
- assertVisible:
27+
id: selected-users-view-submit
28+
- tapOn:
29+
id: selected-users-view-submit
30+
- extendedWaitUntil:
31+
visible:
32+
id: create-channel-view
33+
timeout: 60000
34+
- tapOn:
35+
id: create-channel-name
36+
- inputText: ${channelName}
37+
- hideKeyboard
38+
39+
- runFlow:
40+
when:
41+
true: ${publicChannel}
42+
commands:
43+
- tapOn:
44+
id: create-channel-type
45+
46+
- scrollUntilVisible:
47+
element:
48+
id: create-channel-submit
49+
timeout: 60000
50+
- tapOn:
51+
id: create-channel-submit
52+
53+
- extendedWaitUntil:
54+
visible:
55+
id: room-view
56+
timeout: 60000
57+
- extendedWaitUntil:
58+
visible:
59+
id: room-view-title-${channelName}
60+
timeout: 60000
61+
- runFlow: ../../helpers/go-back.yaml
62+
- extendedWaitUntil:
63+
visible:
64+
id: rooms-list-view
65+
timeout: 60000
66+
- extendedWaitUntil:
67+
visible:
68+
id: rooms-list-view-item-${channelName}
69+
timeout: 60000

0 commit comments

Comments
 (0)