2
2
import com .applitools .eyes .BatchInfo ;
3
3
import com .applitools .eyes .EyesRunner ;
4
4
import com .applitools .eyes .RectangleSize ;
5
+ import com .applitools .eyes .TestResultContainer ;
5
6
import com .applitools .eyes .TestResultsSummary ;
6
7
import com .applitools .eyes .selenium .BrowserType ;
7
8
import com .applitools .eyes .selenium .Configuration ;
@@ -50,7 +51,7 @@ public static void main(String [] args) {
50
51
51
52
// Start Applitools Visual AI Test
52
53
eyes .open (driver ,"ACME Bank" , "Selenium Java Basic: Quickstart" , new RectangleSize (1200 , 600 ));
53
- driver .get ("https://sandbox.applitools.com/bank?layoutAlgo=true " );
54
+ driver .get ("https://sandbox.applitools.com/bank" );
54
55
55
56
// Full Page - Visual AI Assertion
56
57
eyes .check (Target .window ().fully ().withName ("Login page" ));
@@ -62,6 +63,7 @@ public static void main(String [] args) {
62
63
// Full Page - Visual AI Assertion
63
64
eyes .check (
64
65
Target .window ().fully ().withName ("Main page" )
66
+
65
67
// Uncomment to apply Layout regions and have test pass
66
68
/* .layout(
67
69
By.cssSelector(".dashboardOverview_accountBalances__3TUPB"),
@@ -79,11 +81,20 @@ public static void main(String [] args) {
79
81
} finally {
80
82
if (driver != null )
81
83
driver .quit ();
84
+
82
85
if (runner != null ) {
83
86
TestResultsSummary allTestResults = runner .getAllTestResults ();
84
- System .out .println (allTestResults );
87
+ for (TestResultContainer container : allTestResults .getAllResults ()) {
88
+ if (container .getTestResults () != null && !container .getTestResults ().isPassed ()) {
89
+ System .exit (1 );
90
+ }
91
+ }
85
92
}
86
- System .exit (0 );
93
+
94
+ System .exit (0 ); // All tests passed
95
+ }
96
+
97
+ System .exit (0 ); // Will not be reached if mismatch occurred
87
98
}
88
99
}
89
100
}
0 commit comments