Skip to content

Commit 0d13c14

Browse files
authored
chore: new test workspace (#6841)
1 parent 2d81c44 commit 0d13c14

File tree

20 files changed

+117
-60
lines changed

20 files changed

+117
-60
lines changed

.github/scripts/run-maestro.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PLATFORM="${1:-${PLATFORM:-android}}"
55
SHARD="${2:-${SHARD:-default}}"
66
FLOWS_DIR=".maestro/tests"
77
MAIN_REPORT="maestro-report.xml"
8-
MAX_RERUN_ROUNDS="${MAX_RERUN_ROUNDS:-2}"
8+
MAX_RERUN_ROUNDS="${MAX_RERUN_ROUNDS:-3}"
99
RERUN_REPORT_PREFIX="maestro-rerun"
1010
export MAESTRO_DRIVER_STARTUP_TIMEOUT="${MAESTRO_DRIVER_STARTUP_TIMEOUT:-120000}"
1111

@@ -51,11 +51,12 @@ echo "Mapped flows for tag test-${SHARD}:"
5151
awk -F'\t' '{ printf " %s -> %s\n", $1, $2 }' "$MAPFILE"
5252

5353
FLOW_FILES=()
54-
declare -A SEEN
54+
SEEN_PATHS=""
55+
5556
while IFS=$'\t' read -r name path; do
56-
if [ -z "${SEEN[$path]:-}" ]; then
57+
if ! printf '%s\n' "$SEEN_PATHS" | grep -Fqx "$path"; then
5758
FLOW_FILES+=("$path")
58-
SEEN[$path]=1
59+
SEEN_PATHS="${SEEN_PATHS}"$'\n'"$path"
5960
fi
6061
done < "$MAPFILE"
6162

.github/workflows/maestro-android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
6868
with:
6969
name: Android Maestro Logs - Shard ${{ inputs.shard }}
7070
path: ~/.maestro/tests/**/*.png
71-
retention-days: 7
71+
retention-days: 7

.github/workflows/maestro-ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ jobs:
101101
with:
102102
name: iOS Maestro Logs - Shard ${{ inputs.shard }}
103103
path: ~/.maestro/tests/**/*.png
104-
retention-days: 7
104+
retention-days: 7

.maestro/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Contains the scripts that are going to be executed by the flows before running t
3939
#### `data.js`
4040

4141
- Contains seeds to common test data, like server url, public channels, etc
42-
- Currently we point to https://mobile.rocket.chat as main server
42+
- Currently we point to https://mobile.qa.rocket.chat as main server
4343
- Pointing to a local server is not recommended yet, as you would need to create a few public channels and change some permissions
4444
- Ideally we should point to a docker or even a mocked server, but that's tbd
4545
- Try not to add new data there. Use random values instead.

.maestro/scripts/data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const data = {
2-
server: 'https://mobile.rocket.chat',
2+
server: 'https://mobile.qa.rocket.chat',
33
alternateServer: 'https://stable.rocket.chat',
44
...output.account,
55
accounts: [],
@@ -15,4 +15,4 @@ const data = {
1515
e2eePassword: 'Password1@abcdefghijklmnopqrst'
1616
};
1717

18-
output.data = data;
18+
output.data = data;

.maestro/scripts/random.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,37 @@ function random(length = 10) {
77
return text;
88
}
99

10+
function generatePassword(length = 10) {
11+
const lower = 'abcdefghijklmnopqrstuvwxyz'
12+
const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13+
const nums = '0123456789'
14+
const all = lower + upper + nums
15+
16+
let password = ''
17+
password += lower[Math.floor(Math.random() * lower.length)]
18+
password += upper[Math.floor(Math.random() * upper.length)]
19+
password += nums[Math.floor(Math.random() * nums.length)]
20+
21+
while (password.length < length) {
22+
const char = all[Math.floor(Math.random() * all.length)]
23+
const last = password[password.length - 1]
24+
const secondLast = password[password.length - 2]
25+
const thirdLast = password[password.length - 3]
26+
27+
if (char === last && char === secondLast && char === thirdLast) continue
28+
password += char
29+
}
30+
31+
return password
32+
}
33+
34+
1035
const randomUser = () => {
1136
const randomVal = random();
1237
return {
1338
username: 'user' + randomVal,
1439
name: 'user' + randomVal,
15-
password: 'Password1@' + randomVal,
40+
password: generatePassword(),
1641
email: 'mobile+' + randomVal + '@rocket.chat'
1742
};
1843
}

.maestro/tests/assorted/accessibility-and-appearance.yaml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ tags:
8787

8888
- extendedWaitUntil:
8989
visible:
90-
text: '.*@all - all mention.*'
90+
text: '@all - all mention'
9191
timeout: 60000
9292
- extendedWaitUntil:
9393
visible:
94-
text: '.*@rocket.cat - user mention.*'
94+
text: '@rocket.cat - user mention'
9595
timeout: 60000
9696

9797
# should disable mentions with @ symbol
@@ -126,19 +126,11 @@ tags:
126126

127127
- extendedWaitUntil:
128128
visible:
129-
text: '.*all - all mention.*'
130-
timeout: 60000
131-
- extendedWaitUntil:
132-
notVisible:
133-
text: '.*@all - all mention.*'
129+
text: 'all - all mention'
134130
timeout: 60000
135131
- extendedWaitUntil:
136132
visible:
137-
text: '.*rocket.cat - user mention.*'
138-
timeout: 60000
139-
- extendedWaitUntil:
140-
notVisible:
141-
text: '.*@rocket.cat - user mention.*'
133+
text: 'rocket.cat - user mention'
142134
timeout: 60000
143135

144136
# should enable rooms with # symbol
@@ -173,7 +165,7 @@ tags:
173165

174166
- extendedWaitUntil:
175167
visible:
176-
text: '.*#general - channel mention.*'
168+
text: '#general - channel mention'
177169
timeout: 60000
178170

179171
# should disable mentions with # symbol
@@ -205,12 +197,7 @@ tags:
205197
file: '../../helpers/search-and-navigate-room.yaml'
206198
env:
207199
ROOM: 'maestro-accessibility-test'
208-
209200
- extendedWaitUntil:
210201
visible:
211-
text: '.*general - channel mention.*'
212-
timeout: 60000
213-
- extendedWaitUntil:
214-
notVisible:
215-
text: '.*#general - channel mention.*'
202+
text: 'general - channel mention'
216203
timeout: 60000

.maestro/tests/assorted/changeserver.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,20 @@ tags:
180180
visible:
181181
text: '.*Delete.*'
182182
timeout: 60000
183-
- tapOn:
184-
text: 'Delete'
183+
- runFlow:
184+
when:
185+
platform: iOS
186+
commands:
187+
- tapOn:
188+
point: 65%,55%
189+
retryTapIfNoChange: true
190+
- runFlow:
191+
when:
192+
platform: Android
193+
commands:
194+
- tapOn:
195+
text: 'Delete'
196+
retryTapIfNoChange: true
185197

186198
# verify alternate server is deleted
187199
- waitForAnimationToEnd:

.maestro/tests/assorted/delete-server.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,20 @@ tags:
9393
visible:
9494
text: '.*Delete.*'
9595
timeout: 60000
96-
- tapOn:
97-
text: 'Delete'
96+
- runFlow:
97+
when:
98+
platform: iOS
99+
commands:
100+
- tapOn:
101+
point: 65%,55%
102+
retryTapIfNoChange: true
103+
- runFlow:
104+
when:
105+
platform: Android
106+
commands:
107+
- tapOn:
108+
text: 'Delete'
109+
retryTapIfNoChange: true
98110
- waitForAnimationToEnd:
99111
timeout: 300
100112
- extendedWaitUntil:

.maestro/tests/assorted/user-preferences.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ tags:
8383
visible:
8484
text: ':('
8585
timeout: 60000
86+
8687
- extendedWaitUntil:
8788
notVisible:
8889
text: '😞'
@@ -140,7 +141,3 @@ tags:
140141
visible:
141142
text: '😞'
142143
timeout: 60000
143-
- extendedWaitUntil:
144-
notVisible:
145-
text: ':('
146-
timeout: 60000

0 commit comments

Comments
 (0)