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
59 changes: 59 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version: 2
updates:
- package-ecosystem: maven
directories:
- "/appium-maven"
- "/jdi-light-testng"
- "/playwright"
- "/selenium-maven"
- "/standalone-from-folder-maven"
schedule:
interval: weekly
groups:
maven-minor-patch:
patterns:
- "*"
update-types:
- minor
- patch
maven-major:
patterns:
- "*"
update-types:
- major
maven-security:
applies-to: security-updates
patterns:
- "*"

- package-ecosystem: gradle
directories:
- "/allure-junit5-gradle-kts"
- "/selenide-gradle"
schedule:
interval: weekly
groups:
gradle-minor-patch:
patterns:
- "*"
update-types:
- minor
- patch
gradle-major:
patterns:
- "*"
update-types:
- major
gradle-security:
applies-to: security-updates
patterns:
- "*"

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*"
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
maven:
name: ${{ matrix.example }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: [appium-maven, jdi-light-testng, playwright, selenium-maven, standalone-from-folder-maven]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: 17
cache: maven
cache-dependency-path: ${{ matrix.example }}/pom.xml
- run: mvn -B test-compile
working-directory: ${{ matrix.example }}

gradle:
name: ${{ matrix.example }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: [allure-junit5-gradle-kts, selenide-gradle]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v6
- run: ./gradlew testClasses
working-directory: ${{ matrix.example }}
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# List of examples
* [Playwright](https://github.com/Visual-Regression-Tracker/examples-java/blob/master/playwright)
* [Selenium + Maven + JUnit4](https://github.com/Visual-Regression-Tracker/examples-java/blob/master/selenium-maven)
* [Selenide + Gradle + TestNg](https://github.com/Visual-Regression-Tracker/examples-java/blob/master/selenide-gradle)
* [Allure + screen-diff-plugin + Gradle + JUnit5](https://github.com/Visual-Regression-Tracker/examples-java/blob/master/allure-junit5-gradle-kts)
* [Standalone Java read from folder + Maven](https://github.com/Visual-Regression-Tracker/examples-java/blob/master/standalone-from-folder-maven)
* [JDI Light + TestNg](https://github.com/Visual-Regression-Tracker/examples-java/blob/master/jdi-light-testng)
* [Appium + maven](https://github.com/Visual-Regression-Tracker/examples-java/tree/master/appium-maven)
# Visual Regression Tracker examples for Java

Each folder is a separate project on [sdk-java](https://github.com/Visual-Regression-Tracker/sdk-java) 5.5.0 from JitPack (Java 17):

- [Playwright + Maven + JUnit 4](playwright)
- [Selenium 4 + Maven + JUnit 4](selenium-maven)
- [Selenide + Gradle + TestNG](selenide-gradle)
- [Allure + Selenide + Gradle (Kotlin DSL) + JUnit 5](allure-junit5-gradle-kts)
- [Standalone Java: compare PNG and PDF files from a folder + Maven](standalone-from-folder-maven)
- [JDI Light + TestNG + Maven](jdi-light-testng)
- [Appium (iOS) + TestNG + Maven](appium-maven)

The browser examples open https://the-internet.herokuapp.com headless. They connect to
`http://localhost:4200` with the default API key and project of a fresh
[Visual Regression Tracker](https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker)
install; change that in each example's `VisualRegressionTrackerConfig`.

Run a Maven example with `mvn test`, a Gradle one with `./gradlew test`.
98 changes: 3 additions & 95 deletions allure-junit5-gradle-kts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,95 +1,3 @@
/.allure
# Gradle
# ------
.gradle
/build
/buildSrc/build
/buildSrc/subprojects/*/build
/subprojects/*/build
/subprojects/docs/src/samples/**/build
/subprojects/docs/src/snippets/**/build
/subprojects/internal-android-performance-testing/build-android-libs

# IDEA
# ----
!/.idea
/.idea/*
!/.idea/codeStyles
!/.idea/inspectionProfiles
!/.idea/icon.png
!/.idea/icon_dark.png
*/**/.idea
.shelf
/*.iml
/*.ipr
/*.iws
/buildSrc/.idea
/buildSrc/.shelf
/buildSrc/*.iml
/buildSrc/*.ipr
/buildSrc/*.iws
/buildSrc/out
/buildSrc/subprojects/*/*.iml
/buildSrc/subprojects/*/out
/out
/subprojects/*/*.iml
/subprojects/*/out
/.teamcity/*.iml
/.teamcity/target

# Eclipse
# -------
*.classpath
*.project
*.settings
/bin
/subprojects/*/bin
atlassian-ide-plugin.xml
.metadata/

# NetBeans
# --------
.nb-gradle
.nb-gradle-properties

# Vim
# ---
*.sw[nop]

# Emacs
# -----
*~
\#*\#
.\#*

# Textmate
# --------
.textmate

# Sublime Text
# ------------
*.sublime-*

# jEnv
# ----
.java-version

# macOS
# ----
.DS_Store

# HPROF
# -----
*.hprof

# Work dirs
# ---------
/incoming-distributions
/intTestHomeDir

# Logs
# ----
/*.log

# oh-my-zsh gradle plugin
.gradletasknamecache
.gradle/
build/
.allure/
70 changes: 14 additions & 56 deletions allure-junit5-gradle-kts/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,68 +1,26 @@
import io.qameta.allure.gradle.AllureExtension

plugins {
java
maven
id("io.qameta.allure") version "2.8.1"
}

group "io.qameta.allure.examples"
version 1.3

val seleniumVersion = "3.141.59"
val allureVersion = "2.13.6"
val junit5Version = "5.6.2"

tasks.withType(JavaCompile::class) {
sourceCompatibility = "${JavaVersion.VERSION_1_8}"
targetCompatibility = "${JavaVersion.VERSION_1_8}"
}

tasks {
compileJava {
options.encoding = "UTF-8"
}
compileTestJava {
options.encoding = "UTF-8"
}
}

configure<AllureExtension> {
autoconfigure = true
aspectjweaver = true
version = allureVersion

clean = true

useJUnit5 {
version = allureVersion
}
}

tasks.withType(Test::class) {
ignoreFailures = true
useJUnitPlatform {

}

systemProperty("junit.jupiter.execution.parallel.enabled", "true")
systemProperty("junit.jupiter.execution.parallel.config.strategy", "dynamic")
systemProperty("junit.jupiter.extensions.autodetection.enabled", "true")
id("io.qameta.allure") version "4.3.0"
}

repositories {
mavenCentral()
mavenLocal()
maven(url = "https://jitpack.io")
}

tasks.withType<JavaCompile>().configureEach {
options.release = 17
}

dependencies {
testImplementation("com.github.visual-regression-tracker:sdk-java:4.5.1")
testImplementation("com.codeborne:selenide:5.14.0")
testImplementation("org.seleniumhq.selenium:selenium-java:$seleniumVersion")
testImplementation("io.qameta.allure:allure-java-commons:$allureVersion")
testImplementation("com.github.Visual-Regression-Tracker:sdk-java:5.5.0")
testImplementation("com.codeborne:selenide:7.19.1")
testImplementation(platform("org.junit:junit-bom:6.1.3"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit5Version")
tasks.test {
useJUnitPlatform()
ignoreFailures = true
}
Binary file modified allure-junit5-gradle-kts/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading