Skip to content
Peter Thomas edited this page Dec 2, 2024 · 15 revisions

Here is a simple build.gradle for Karate and JUnit 5. Please also refer to the main README.

Make sure you change the karateVersion from X.X.X to the version you need, the latest one will be visible here.

plugins {
    id 'java'
}

ext {
    karateVersion = 'X.X.X'
}

dependencies {
    testImplementation "io.karatelabs:karate-junit5:${karateVersion}"
}

sourceSets {
    test {
        resources {
            srcDir file('src/test/java')
            exclude '**/*.java'
        }
    }
}

test {
    useJUnitPlatform()
    systemProperty "karate.options", System.properties.getProperty("karate.options")
    systemProperty "karate.env", System.properties.getProperty("karate.env")
    outputs.upToDateWhen { false }
}

repositories {
    mavenCentral()
}

Gatling

It is possible to use the Karate Gatling integration with Karate by using a custom JavaExec task. Refer to the documentation here.

Also the karate-todo example has a sample build.gradle on the wiki.