Open wjbakker opened 2 years ago
I'm not sure if you're still using AssertJSwingTestCaseTemplate
for your tests but I found that tests would hang if you had an exception in any @BeforeEach
or @AfterEach
. I worked around that (I think) using this extension:
@RegisterExtension
InvocationInterceptor invocationInterceptor = new InvocationInterceptor() {
@Override
public void interceptBeforeEachMethod(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable {
proceedWithRobotCleanup(invocation);
}
@Override
public void interceptAfterEachMethod(Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable {
proceedWithRobotCleanup(invocation);
}
private void proceedWithRobotCleanup(Invocation<Void> invocation) throws Throwable {
try {
invocation.proceed();
} catch (Throwable e) {
if (robot() != null) {
cleanUp();
}
throw e;
}
}
};
Adds a Junit-Jupiter Extension for tests annotated with @GUITest.
Tests can now be run with the
@GUITestExtension
.A new module is added:
Example usage:
Solves !259