Skip to content

Commit 39c4463

Browse files
demo tape
1 parent 12ef810 commit 39c4463

3 files changed

Lines changed: 126 additions & 2 deletions

File tree

demo/demo.gif

28.7 KB
Loading

demo/demo.tape

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Sleep 500ms
4646
Type "testingbot maestro ./app-debug.apk ./flows/ --device Pixel9 --real-device"
4747
Enter
4848

49-
# Wait for script to complete
50-
Sleep 6s
49+
# Wait for script to complete (banner + upload + spinner-animated table)
50+
Sleep 8s
5151

5252
# ============================================
5353
# OUTRO

demo/testingbot

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#!/bin/bash
2+
# Fake testingbot command for demo recording.
3+
# Mirrors the real CLI's output format so vhs can capture a deterministic demo.
4+
5+
print_banner() {
6+
echo ''
7+
printf ' \033[34m▀█▀ █▀▀ ▄▀▀▀ ▀█▀ ▀█▀ █▄ █ ▄▀▀▀ █▀▀▄ █▀▀█ ▀█▀\033[0m\n'
8+
printf ' \033[34m █ █▀ ▀▀▄ █ █ █ ▀█ █ ▀█ █▀▀▄ █ █ █ \033[0m\n'
9+
printf ' \033[34m ▀ ▀▀▀ ▀▀▀ ▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀ ▀▀▀▀ ▀ \033[0m\n'
10+
echo ''
11+
printf ' \033[2mEspresso · XCUITest · Maestro · v1.0.8\033[0m\n'
12+
printf ' \033[2m~/projects/testingbotctl\033[0m\n'
13+
echo ''
14+
}
15+
16+
# Animate a spinner label on one line for a short burst, then leave a final
17+
# line in place.
18+
spin_line() {
19+
local duration_frames=$1
20+
local running_label=$2
21+
local final_label=$3
22+
local frames=('' '' '' '' '' '' '' '' '' '')
23+
for ((i = 0; i < duration_frames; i++)); do
24+
local f="${frames[$((i % ${#frames[@]}))]}"
25+
# %b expands the \033 escapes that live inside the label arguments.
26+
printf '\r\033[K\033[36m%s %b\033[0m' "$f" "$running_label"
27+
sleep 0.08
28+
done
29+
printf '\r\033[K%b\n' "$final_label"
30+
}
31+
32+
if [ "$1" = "login" ]; then
33+
print_banner
34+
echo -e '\033[1;36m11:55:58.10\033[0m Opening browser for authentication...'
35+
sleep 1.2
36+
echo -e '\033[1;36m11:55:59.20\033[0m Waiting for login...'
37+
sleep 4
38+
echo ''
39+
echo -e ' \033[1;32m✔\033[0m Successfully authenticated!'
40+
sleep 0.3
41+
echo ' Credentials saved to ~/.testingbot'
42+
echo ''
43+
exit 0
44+
fi
45+
46+
if [ "$1" = "maestro" ]; then
47+
if [[ "$2" == *.ipa ]]; then
48+
APP_NAME="sample.ipa"
49+
APP_SIZE="18.7 MB/18.7 MB"
50+
RUN_ID="21290"
51+
DEVICE="iPhone 16 - 18.0"
52+
else
53+
APP_NAME="app-debug.apk"
54+
APP_SIZE="12.4 MB/12.4 MB"
55+
RUN_ID="21289"
56+
DEVICE="Pixel 9 - 15.0"
57+
fi
58+
59+
print_banner
60+
61+
echo -e '\033[1;36m11:55:59.10\033[0m Uploading Maestro App'
62+
sleep 0.2
63+
printf ' %s: [' "$APP_NAME"
64+
for i in {1..30}; do
65+
printf ''
66+
sleep 0.02
67+
done
68+
printf '] 100%% (%s) • 4.2 MB/s\033[K\n' "$APP_SIZE"
69+
sleep 0.2
70+
71+
echo -e '\033[1;36m11:55:59.82\033[0m Uploading Maestro Flows'
72+
sleep 0.1
73+
echo -e '\033[1;36m11:55:59.83\033[0m Bundling 4 files into flows.zip:'
74+
sleep 0.05
75+
echo '11:55:59.83 Flow files (3):'
76+
echo '11:55:59.83 - login-flow.yaml'
77+
echo '11:55:59.83 - home-flow.yaml'
78+
echo '11:55:59.83 - checkout-flow.yaml'
79+
echo '11:55:59.83 Scripts (1):'
80+
echo '11:55:59.83 - scripts/helpers.js'
81+
sleep 0.2
82+
printf ' flows.zip: ['
83+
for i in {1..30}; do
84+
printf ''
85+
sleep 0.01
86+
done
87+
printf '] 100%% (2.1 KB/2.1 KB)\033[K\n'
88+
sleep 0.2
89+
90+
echo -e '\033[1;36m11:56:00.38\033[0m Running Maestro Tests'
91+
sleep 0.1
92+
echo -e '\033[1;36m11:56:00.47\033[0m Waiting for test results...'
93+
sleep 0.2
94+
echo " 🔗 Run $RUN_ID ($DEVICE): Watch in realtime:"
95+
echo " https://testingbot.com/members/maestro/19687/runs/$RUN_ID"
96+
sleep 0.6
97+
98+
echo ''
99+
# New widened Status column (10 chars) with colored ✔/✘ PASSED/FAILED
100+
printf ' \033[2m%s %s %s %s\033[0m\n' \
101+
"$(printf '%-10s' 'Duration')" \
102+
"$(printf '%-10s' 'Status')" \
103+
"$(printf '%-30s' 'Flow')" \
104+
'Fail reason'
105+
printf ' \033[2m────────── ────────── ────────────────────────────── ──────────────────────────────────────\033[0m\n'
106+
sleep 0.3
107+
108+
# Animated RUNNING → PASSED for each flow. The spinner frame is emitted
109+
# by spin_line; the running label just carries the trailing text.
110+
spin_line 8 "RUNNING Login Flow" \
111+
" 32s \033[1;32m✔ PASSED\033[0m Login Flow"
112+
spin_line 8 "RUNNING Home Flow" \
113+
" 28s \033[1;32m✔ PASSED\033[0m Home Flow"
114+
spin_line 10 "RUNNING Checkout Flow" \
115+
" 45s \033[1;32m✔ PASSED\033[0m Checkout Flow"
116+
117+
sleep 0.3
118+
echo ''
119+
printf ' \033[1;32m✔\033[0m Run %s \033[2m(%s)\033[0m: \033[32mTest completed successfully\033[0m\n' \
120+
"$RUN_ID" "$DEVICE"
121+
echo ''
122+
sleep 0.2
123+
echo -e '\033[1;36m11:58:45.21\033[0m All tests completed successfully!'
124+
fi

0 commit comments

Comments
 (0)