Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup atd #888

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
174 changes: 88 additions & 86 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,28 @@
import java.text.SimpleDateFormat
import org.codehaus.groovy.runtime.GStringImpl

import java.text.SimpleDateFormat

buildscript {
ext {
gradleVersion = "8.12"
applitoolsAppiumVersion = "5.73.0"
applitoolsImagesVersion = "5.74.0"
browserStackLocalVersion = "1.1.5"
fasterxmlJacksonVersion = "2.18.2"
atdVersion = "14.0.4" // ATD main branch
jadbVersion = "1.2.1"
unirestVersion = "3.14.5"
specmaticVersion = '1.3.39'
webDriverManagerVersion = '5.9.2'
jodaTimeVersion = "2.13.0"
masterThoughtVersion = "5.8.2"
commonsLang3Version = "3.17.0"
commonsRngSimpleVersion = "1.6"
aspectJVersion = "1.9.22.1"
assertJVersion = "3.27.0"
jetbrainsAnnotationsVersion = "26.0.1"
junitVersion = "5.11.4"
snakeyamlVersion = "2.3"
jsonDiffVersion = "0.4.16"
pdfBoxVersion = '3.0.3'
gradleVersion = "8.12.1"
}
}

plugins {
id "org.sonarqube" version "6.0.1.5171"
id "java"
id "idea"
id "com.github.johnrengelman.shadow" version '8.1.1'
id "com.gradleup.shadow" version '8.3.5'
id "maven-publish"
id "io.freefair.aspectj.post-compile-weaving" version "8.11"
id "io.freefair.aspectj.post-compile-weaving" version "8.12.1"
}

group = 'com.github.znsio'
version '1.0.12'
version = '1.0.13-noATD'

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
Expand All @@ -54,7 +32,7 @@ repositories {
}
mavenCentral()
maven {
url 'https://jitpack.io'
url = 'https://jitpack.io'
}
}

Expand Down Expand Up @@ -139,31 +117,13 @@ task downloadDependencies {
doLast {
println "Downloading required dependencies..."
def dependencies = [
// [
// name : "teswiz",
// type : "github",
// params: [
// repoUrl: "https://api.github.com/repos/znsio/teswiz/releases/latest",
// version: "$project.teswizVersion"
// ]
// ],
[
name : "AppiumTestDistribution",
type : "jitpack",
params: [
group : "com.github.AppiumTestDistribution",
artifact: "AppiumTestDistribution",
version : "$project.atdVersion",
fileNameSuffix: "-jar-with-dependencies"
]
],
[
name : "jadb",
type : "jitpack",
params: [
group : "com.github.vidstige",
artifact: "jadb",
version : "$project.jadbVersion",
group : "com.github.vidstige",
artifact : "jadb",
version : "1.2.1",
fileNameSuffix: ""
]
]
Expand All @@ -187,40 +147,74 @@ tasks.compileJava {
}

dependencies {
// Local JAR dependencies
implementation fileTree(dir: "$project.projectDir/libs", include: ['*.jar'])
implementation files(layout.buildDirectory.files("/classes/main"))
implementation files(layout.buildDirectory.files("/classes/test"))
implementation ("com.github.AppiumTestDistribution:AppiumTestDistribution:$project.atdVersion") {
exclude group: 'io.appium', module: 'java-client'
}
implementation "com.github.vidstige:jadb:$project.jadbVersion"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$project.fasterxmlJacksonVersion"
implementation "com.konghq:unirest-java:$project.unirestVersion"
implementation "org.assertj:assertj-core:$project.assertJVersion"
implementation "org.apache.commons:commons-lang3:$project.commonsLang3Version"
implementation "org.apache.commons:commons-rng-simple:$project.commonsRngSimpleVersion"
implementation "org.jetbrains:annotations:$project.jetbrainsAnnotationsVersion"
implementation "org.junit.jupiter:junit-jupiter:$project.junitVersion"
implementation "joda-time:joda-time:$project.jodaTimeVersion"
implementation "com.browserstack:browserstack-local-java:$project.browserStackLocalVersion"
implementation "com.applitools:eyes-images-java5:$project.applitoolsImagesVersion"
implementation("com.applitools:eyes-appium-java5:$project.applitoolsAppiumVersion") {
// exclude group: 'io.appium', module: 'java-client'
}
implementation "net.masterthought:cucumber-reporting:$masterThoughtVersion"
implementation "org.aspectj:aspectjrt:$project.aspectJVersion"
implementation "in.specmatic:specmatic-core:${project.specmaticVersion}"
implementation "io.github.bonigarcia:webdrivermanager:$project.webDriverManagerVersion"
implementation "org.yaml:snakeyaml:$project.snakeyamlVersion"
implementation "com.flipkart.zjsonpatch:zjsonpatch:$project.jsonDiffVersion"
implementation "org.apache.pdfbox:pdfbox:$project.pdfBoxVersion"

// Build-specific directories
implementation files(layout.buildDirectory.dir("classes/main"))
implementation files(layout.buildDirectory.dir("classes/test"))
implementation 'com.google.guava:guava:33.4.0-jre'

// Logging
implementation "org.apache.logging.log4j:log4j-api:2.24.3"
implementation "org.apache.logging.log4j:log4j-core:2.24.3"
// implementation "org.apache.logging.log4j:log4j-1.2-api:2.24.3"

// JSON and YAML processing
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2"
// implementation "org.yaml:snakeyaml:$project.snakeyamlVersion"
implementation "com.flipkart.zjsonpatch:zjsonpatch:0.4.16"

// Assertions and testing
implementation "org.assertj:assertj-core:3.27.3"
// implementation "org.junit.jupiter:junit-jupiter:$project.junitVersion"
// implementation "org.testng:testng:7.10.2"
implementation "io.cucumber:cucumber-java:7.20.1"
implementation "io.cucumber:cucumber-testng:7.20.1"

// Unirest for API testing
implementation "com.konghq:unirest-java:3.14.5"

// Appium and BrowserStack
// implementation "io.appium:java-client:9.3.0"
implementation "com.browserstack:browserstack-local-java:1.1.5"

// Applitools for visual testing
implementation "com.applitools:eyes-images-java5:5.75.2"
implementation "com.applitools:eyes-appium-java5:5.74.2"

// Aspect-Oriented Programming (AOP)
implementation "org.aspectj:aspectjrt:1.9.22.1"

// Specmatic and JSON Schema validation
implementation "in.specmatic:specmatic-core:1.3.39"
implementation "org.everit.json:org.everit.json.schema:1.5.1"
implementation 'com.jayway.jsonpath:json-path:2.9.0'

// Utility libraries
implementation "org.apache.commons:commons-lang3:3.17.0"
implementation "org.apache.commons:commons-rng-simple:1.6"
implementation "org.jetbrains:annotations:26.0.2"
implementation "joda-time:joda-time:2.13.1"
implementation "io.github.bonigarcia:webdrivermanager:5.9.2"

// Reporting
implementation "net.masterthought:cucumber-reporting:5.8.4"
implementation 'com.epam.reportportal:agent-java-cucumber6:5.3.4'

// PDF handling
implementation "org.apache.pdfbox:pdfbox:3.0.4"

// Lombok
implementation 'org.projectlombok:lombok:1.18.36'
}


shadowJar {
archiveBaseName.set("$project.name")
archiveClassifier.set('')
archiveVersion.set("$project.version")
zip64 true
zip64 = true
manifest {
attributes "Multi-Release": true
attributes "Main-Class": "com.znsio.e2e.runner.Runner"
Expand Down Expand Up @@ -272,7 +266,7 @@ static def getCurrentTimestamp() {
return df.format(today)
}

project.ext.logDir = "./target/" + getMonth() + "/" + getCurrentDatestamp() + "/" + getCurrentTimestamp()
def logDir = "./target/" + getMonth() + "/" + getCurrentDatestamp() + "/" + getCurrentTimestamp()

def copyRpPropertiesIfMissing() {
def rpFile = file('src/test/resources/reportportal.properties')
Expand Down Expand Up @@ -303,9 +297,9 @@ gradle.taskGraph.whenReady { taskGraph ->

tasks.register('run', JavaExec) {
doFirst {
println "Using LOG_DIR: ${project.logDir}"
System.setProperty "LOG_DIR", "${project.logDir}"
environment "APPLITOOLS_LOG_DIR", "${project.logDir}/applitools_logs"
println "Using LOG_DIR: $logDir"
System.setProperty "LOG_DIR", "$logDir"
environment "APPLITOOLS_LOG_DIR", "${logDir}/applitools_logs"
environment "APPLITOOLS_API_KEY", System.getenv("TESWIZ_APPLITOOLS_API_KEY")

def hostname = InetAddress.getLocalHost().getHostName()
Expand Down Expand Up @@ -360,8 +354,17 @@ tasks.register('run', JavaExec) {
}

test {
useJUnitPlatform()
doFirst {
println "Using LOG_DIR for tests: ${logDir}"
systemProperty "LOG_DIR", "${logDir}"

def logFileDir = new File(logDir)
if (!logFileDir.exists()) {
logFileDir.mkdirs()
println "Created log directory at: ${logFileDir.absolutePath}"
}
}
useTestNG()
outputs.upToDateWhen { false }

testLogging {
Expand All @@ -379,17 +382,16 @@ test {
if (System.getProperty('debug', 'false') == 'true') {
jvmArgs '-Xdebug', '-agentlib:jdwp=transport=dt_socket,server=n,address=192.168.29.248:9009,suspend=y'
}
println "Using LOG_DIR: ${project.logDir}"
reports {
html.required.set(true)
junitXml.required.set(true)
html.outputLocation.set(file("$project.logDir/unit-test-results"))
junitXml.outputLocation.set(file("$project.logDir/unit-test-results"))
html.outputLocation.set(file("$logDir/unit-test-results"))
junitXml.outputLocation.set(file("$logDir/unit-test-results"))
}
}

tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ['--release', '17']
options.compilerArgs += ['--release', '17', '-Xlint:deprecation']
}

tasks.withType(JavaExec).configureEach {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading
Loading