Skip to content

Commit cf79873

Browse files
committed
Refined kotlin sheet logic and updated screenshots on Linux
1 parent 6ba5b56 commit cf79873

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed
5.65 KB
Loading
4.93 KB
Loading

scripts/hellocodenameone/common/src/main/kotlin/com/codenameone/examples/hellocodenameone/tests/KotlinUiTest.kt

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@ package com.codenameone.examples.hellocodenameone.tests
33
import com.codename1.components.Accordion
44
import com.codename1.components.MultiButton
55
import com.codename1.components.Switch
6-
import com.codename1.ui.Button
7-
import com.codename1.ui.CheckBox
8-
import com.codename1.ui.Container
9-
import com.codename1.ui.Label
10-
import com.codename1.ui.Sheet
11-
import com.codename1.ui.Slider
12-
import com.codename1.ui.TextArea
13-
import com.codename1.ui.TextField
6+
import com.codename1.testing.TestUtils
7+
import com.codename1.ui.*
148
import com.codename1.ui.layouts.BoxLayout
15-
import com.codename1.ui.util.UITimer
169

1710
class KotlinUiTest : BaseTest() {
1811
override fun runTest(): Boolean {
19-
val kotlinForm = createForm("Kotlin", BoxLayout.y(), "kotlin")
12+
var called = BooleanArray(1)
13+
val kotlinForm = object : Form("Kotlin", BoxLayout.y()) {
14+
override fun onShowCompleted() {
15+
super.onShowCompleted()
16+
called[0] = true
17+
}
18+
}
2019
kotlinForm.addAll(
2120
Label("Kotlin UI Test Components"),
2221
Button("Kotlin Button"),
@@ -58,6 +57,16 @@ class KotlinUiTest : BaseTest() {
5857
sheet.contentPane.add(Label("This is a sheet covering part of the screen"))
5958
sheet.show(0)
6059

60+
var timeout = 100;
61+
while (sheet.parent == null && !called[0]) {
62+
TestUtils.waitFor(10)
63+
timeout--
64+
TestUtils.assertNotEqual(0, timeout)
65+
}
66+
67+
Cn1ssDeviceRunnerHelper.emitCurrentFormScreenshot("kotlin")
68+
done()
69+
6170
return true
6271
}
6372
}

scripts/run-ios-ui-tests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,20 @@ LOG_CHUNKS="$(cn1ss_count_chunks "$TEST_LOG")"; LOG_CHUNKS="${LOG_CHUNKS//[^0-9]
548548
ri_log "Chunk counts -> simulator log: ${LOG_CHUNKS}"
549549

550550
if [ "${LOG_CHUNKS:-0}" = "0" ]; then
551+
COLLECTED_LOG_DIR="$ARTIFACTS_DIR/simulator-logs"
552+
ensure_dir "$COLLECTED_LOG_DIR"
553+
DEBUG_LOG="$COLLECTED_LOG_DIR/device-runner-debug.log"
554+
if [ -n "$SIM_DEVICE_ID" ]; then
555+
ri_log "Capturing simulator debug log to $DEBUG_LOG"
556+
xcrun simctl spawn "$SIM_DEVICE_ID" log show --style syslog --last 30m > "$DEBUG_LOG" 2>/dev/null || true
557+
else
558+
ri_log "Capturing host simulator debug log to $DEBUG_LOG"
559+
log show --style syslog --last 30m > "$DEBUG_LOG" 2>/dev/null || true
560+
fi
561+
CRASH_LOG_DIR="$COLLECTED_LOG_DIR/crash-reports"
562+
ensure_dir "$CRASH_LOG_DIR"
563+
ri_log "Collecting recent crash reports into $CRASH_LOG_DIR"
564+
find "$HOME/Library/Logs/DiagnosticReports" -type f -name '*.crash' -mmin -120 -print -exec cp {} "$CRASH_LOG_DIR" \; 2>/dev/null || true
551565
ri_log "STAGE:MARKERS_NOT_FOUND -> simulator output did not include CN1SS chunks"
552566
ri_log "---- CN1SS lines (if any) ----"
553567
(grep "CN1SS:" "$TEST_LOG" || true) | sed 's/^/[CN1SS] /'

0 commit comments

Comments
 (0)