Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use java ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'

- run: mvn install versions:use-latest-releases exec:java -Dexec.mainClass="com.applitools.quickstarts.AppTest" -Dexec.classpathScope=test -Dmaven.compiler.source="1.7" -Dmaven.compiler.target="1.7" -Dci_test=true
env:
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}

- uses: mikeal/publish-to-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: 'master'
28 changes: 28 additions & 0 deletions .github/workflows/updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Updates

on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use java ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'

- run: mvn install versions:use-latest-releases exec:java -Dexec.mainClass="com.applitools.quickstarts.AppTest" -Dexec.classpathScope=test -Dmaven.compiler.source="1.7" -Dmaven.compiler.target="1.7" -Dci_test=true
env:
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}

- uses: mikeal/publish-to-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: 'test_CI'
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>com.applitools</groupId>
<artifactId>eyes-selenium-java3</artifactId>
<version>RELEASE</version>
<version>3.201.0</version>
</dependency>
</dependencies>
</project>
20 changes: 20 additions & 0 deletions pom.xml.versionsBackup
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.applitools.quickstarts</groupId>
<artifactId>Java-UltraFastGrid-Tutorial</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>Java-tutorial</name>
<url>http://maven.apache.org</url>

<dependencies>
<!-- This is the Applitools Selenium Java SDK -->
<dependency>
<groupId>com.applitools</groupId>
<artifactId>eyes-selenium-java3</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
</project>
9 changes: 5 additions & 4 deletions src/test/java/com/applitools/quickstarts/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

/**
* Unit test for simple App.
Expand All @@ -21,7 +22,8 @@ public class AppTest {

public static void main(String[] args) {
// Create a new chrome web driver
WebDriver webDriver = new ChromeDriver();
boolean CI_TEST = Boolean.getBoolean("ci_test");
WebDriver webDriver = new ChromeDriver(new ChromeOptions().setHeadless(CI_TEST));

// Create a runner with concurrency of 1
VisualGridRunner runner = new VisualGridRunner(1);
Expand Down Expand Up @@ -49,7 +51,7 @@ public static void setUp(Eyes eyes) {
Configuration config = new Configuration();

// You can get your api key from the Applitools dashboard
config.setApiKey("APPLITOOLS_API_KEY");
config.setApiKey(System.getenv("APPLITOOLS_API_KEY"));

// create a new batch info instance and set it to the configuration
config.setBatch(new BatchInfo("Ultrafast Batch"));
Expand Down Expand Up @@ -102,9 +104,8 @@ private static void tearDown(WebDriver webDriver, VisualGridRunner runner) {
// Close the browser
webDriver.quit();

// we pass false to this method to suppress the exception that is thrown if we
// find visual differences
TestResultsSummary allTestResults = runner.getAllTestResults(false);
TestResultsSummary allTestResults = runner.getAllTestResults(true);
System.out.println(allTestResults);
}

Expand Down