File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
testcases/cachyos/dailylive Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,28 @@ function test_setup() {
1111 test_password="ILoveCandy"
1212}
1313
14+ function qt_wait_else() {
15+ local test_name="$1"
16+ local fallback="$2"
17+ local text="$3"
18+ local retries=$4
19+ local interval=$5
20+
21+ for c in $( seq 1 $retries ); do
22+ qt_echo "🔁 $c / $retries «$text» "
23+ qt_screenshot_ppm "$test_name"
24+ # We only ever OCR the most recent image, so we just send the text name and the screenshot count
25+ if qt_search_screenshot "$test_name" "$text"; then
26+ return 0
27+ fi
28+ qt_wait_for_seconds "$interval"
29+ done
30+
31+ "$fallback" "$test_name"
32+
33+ qt_test_fail "Coulnd't find text «$text» in screenshot «$QT_SCREENSHOT_COUNT» after $retries retries"
34+ }
35+
1436function test_post_boot_grub() {
1537 qt_wait_for_seconds 5
1638 qt_wait_for_text "$FUNCNAME" "GNU GRUB" 3 5
@@ -144,8 +166,14 @@ function test_calamares_install() {
144166 qt_screenshot_ppm "$FUNCNAME"
145167}
146168
169+ function test_calamares_failed() {
170+ qt_send_key_combo "spc"
171+ qt_wait_for_seconds 2
172+ qt_screenshot_ppm "$FUNCNAME"
173+ }
174+
147175function test_calamares_finished() {
148- qt_wait_for_text "$FUNCNAME" "$text_calamares_finished" 30 60
176+ qt_wait_else "$FUNCNAME" "test_calamares_failed " "$text_calamares_finished" 30 60
149177 qt_send_key_combo "spc"
150178 qt_screenshot_ppm "$FUNCNAME"
151179}
You can’t perform that action at this time.
0 commit comments