1- import com .applitools .eyes .BatchInfo ;
2- import com .applitools .eyes .EyesRunner ;
3- import com .applitools .eyes .RectangleSize ;
4- import com .applitools .eyes .TestResultsSummary ;
5- import com .applitools .eyes .selenium .BrowserType ;
6- import com .applitools .eyes .selenium .Configuration ;
7- import com .applitools .eyes .selenium .Eyes ;
1+ import com .applitools .eyes .*;
2+ import com .applitools .eyes .selenium .*;
83import com .applitools .eyes .selenium .fluent .Target ;
94import com .applitools .eyes .visualgrid .model .DeviceName ;
105import com .applitools .eyes .visualgrid .model .ScreenOrientation ;
116import com .applitools .eyes .visualgrid .services .RunnerOptions ;
127import com .applitools .eyes .visualgrid .services .VisualGridRunner ;
138import io .github .bonigarcia .wdm .WebDriverManager ;
149import org .junit .jupiter .api .*;
10+ import org .openqa .selenium .By ;
1511import org .openqa .selenium .WebDriver ;
12+ import org .openqa .selenium .chrome .ChromeOptions ;
1613
1714public class TestCase {
1815 private static WebDriver driver ;
@@ -23,14 +20,21 @@ public class TestCase {
2320
2421 @ BeforeAll
2522 public static void beforeAll () {
26- driver = WebDriverManager .chromedriver ().create ();
23+ ChromeOptions chromeOptions = new ChromeOptions ();
24+ chromeOptions .addArguments ("--headless" );
25+ driver = WebDriverManager .chromedriver ().capabilities (chromeOptions ).create ();
26+
2727 myTestBatch = new BatchInfo ("Test Cases" );
28+ myTestBatch .setSequenceName ("Advanced Visual Testing" );
2829 testRunner = new VisualGridRunner (new RunnerOptions ().testConcurrency (5 ));
2930
3031 suiteConfig = new Configuration ();
3132 suiteConfig .setApiKey (System .getenv ("APPLITOOLS_API_KEY" ));
3233 suiteConfig .setBatch (myTestBatch );
33- suiteConfig .addBrowser (1000 , 600 , BrowserType .CHROME );
34+ // suiteConfig.setBranchName("childBranch");
35+ // suiteConfig.setParentBranchName("featureBranch1");
36+ // suiteConfig.setBaselineBranchName("default");
37+ suiteConfig .addBrowser (1400 , 600 , BrowserType .CHROME );
3438 suiteConfig .addBrowser (1600 , 1200 , BrowserType .FIREFOX );
3539 suiteConfig .addBrowser (1024 , 768 , BrowserType .SAFARI );
3640 suiteConfig .addDeviceEmulation (DeviceName .Pixel_2 , ScreenOrientation .PORTRAIT );
@@ -41,12 +45,12 @@ public static void beforeAll() {
4145 public void beforeEach (TestInfo testInfo ) {
4246 eyes = new Eyes (testRunner );
4347 eyes .setConfiguration (suiteConfig );
44- eyes .open (driver , "My First Tests" , testInfo .getTestMethod ().get ().getName (), new RectangleSize (1000 , 600 ));
48+ eyes .open (driver , "My First Tests" , testInfo .getTestMethod ().get ().getName (), new RectangleSize (1400 , 600 ));
4549 }
4650
4751 @ Test
48- public void applitoolsHelloWorld () {
49- driver .get ("https://applitools.com/helloworld/" );
52+ public void GithubIntegrationTest () {
53+ driver .get ("https://applitools.com/helloworld/?diff2 " );
5054 eyes .check (Target .window ());
5155 }
5256
0 commit comments