File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/test/java/com/applitools/example Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ public void cleanUpTest() {
150150 // If you want to wait synchronously for all checkpoints to complete, then use `eyes.close()`.
151151 }
152152
153+ public void abortTests () {
154+ // Abort tests if things go wrong.
155+ eyes .abortAsync ();
156+ }
157+
153158 public void printResults () {
154159
155160 // Close the batch and report visual differences to the console.
@@ -174,10 +179,18 @@ public static void main(String [] args) {
174179 catch (Exception e ) {
175180 e .printStackTrace ();
176181 }
177- finally {
182+
183+ try {
178184 // No matter what, perform cleanup
179185 tests .cleanUpTest ();
180186 tests .printResults ();
187+ }
188+ catch (Exception e ) {
189+ e .printStackTrace ();
190+ tests .abortTests ();
191+ }
192+ finally {
193+ // Always force execution to end
181194 System .exit (0 );
182195 }
183196 }
You can’t perform that action at this time.
0 commit comments