mardi 12 juin 2018

Close application after test without test failure using AssertJ

I use AssertJ to test my swing application. I must to close my application after test and before the next test, which will start my application again. But, when I call frame.close(); or System.exit(0); the test crashes with exit code 0. I tried to use this code before test:

ApplicationLauncher.application(App.class).start();
    pause(8000);
    frame = WindowFinder.findFrame(FrameMatcher.withTitle("Application")).using(robot());
    try {
        frame.close();
    } catch (Exception e){
        e.printStackTrace();
    }
    ApplicationLauncher.application(App.class).start();
    pause(8000);
    frame = WindowFinder.findFrame(FrameMatcher.withTitle("Application")).using(robot());

But, after frame.close(); I have the same problem. May be anyone know how to do it? Any advice?

Aucun commentaire:

Enregistrer un commentaire