Skip to content

Commit c6ec3a4

Browse files
committed
Ensure animation screenshots navigate back via showBack
1 parent 551b671 commit c6ec3a4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

docs/demos/common/src/test/java/com/codenameone/developerguide/animations/AnimationDemosScreenshotTest.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public boolean runTest() throws Exception {
7575
saveScreenshot(storageKeyFor(demo.getTitle()), screenshot);
7676
}
7777

78-
host.show();
79-
waitForHost(host);
78+
returnToHost(activeForm, host);
8079
}
8180

8281
return true;
@@ -163,6 +162,20 @@ private void waitForHost(Form host) {
163162
TestUtils.waitFor(200);
164163
}
165164

165+
private void returnToHost(Form demoForm, Form host) {
166+
if (host == null) {
167+
return;
168+
}
169+
170+
if (demoForm != null && demoForm != host) {
171+
demoForm.showBack();
172+
} else {
173+
host.show();
174+
}
175+
176+
waitForHost(host);
177+
}
178+
166179
private void triggerAnimationIfNeeded(Demo demo, Form form) {
167180
if (demo == null || form == null) {
168181
return;

0 commit comments

Comments
 (0)