Essayez d'utiliser le FEST-Swing pour les tests de GUI Swing, et à l'aide par exemple de http://easytesting.org/swing/wiki/pmwiki.php?n=FEST-Swing.LaunchFromMainexemple FEST-swing ne fonctionne pas, frame.isShowing() return false
Malheureusement, le frame.isShowing() retourne toujours faux si je vois déjà swing JavaApp est en cours d'exécution
Voir mes codes
...
ApplicationLauncher.application(JavaApp.class).start();
GenericTypeMatcher<Frame> matcher = new GenericTypeMatcher<Frame>(Frame.class) {
protected boolean isMatching(Frame frame) {
System.out.println("title:" + frame.getTitle() + " showing:" +frame.isShowing()); // .getTitle());
return "Java Application".equals(frame.getTitle()) && frame.isShowing();
}
};
Robot robot = BasicRobot.robotWithNewAwtHierarchy();
FrameFixture frame2 = WindowFinder.findFrame(matcher).withTimeout(5000).using(robot);
...
du journal de la console
title: showing: false
Deux questions: 1.
je dois utiliser le cadre insteaf de JFrame, sinon il ne peut être égalé, il cause le titre est pas correct, je me attends "Java Application"
2. frame.isShowing () est toujours faux retour, il semble étrange
BTW: codes lastest semble paramètre pour les besoins GenericTypeMatcher() RGS/larry