Всем привет! У меня есть тестовые классы и нужно, чтобы один тестовый класс запускался после выполнения предыдущего.
Нашёл, что есть doFirst и doLast, но как при помощи них управлять тестовыми классами не нашёл. Перепробовал много способов, но ни один не заработал, как мне нужно.
Моя структура тестовых классов
Мой файл build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.qameta.allure:allure-gradle:2.8.1"
classpath "org.junit.platform:junit-platform-gradle-plugin:1.2.0"
}
}
plugins {
id 'java'
id 'idea'
}
group 'chat.ros.testing2'
version '1.0'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
sourceCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
}
apply plugin: 'io.qameta.allure'
apply plugin: 'java'
apply plugin: 'maven'
jar {
baseName = 'roschat-ms'
version = '1.0'
exclude ("chat/ros/testing2/server/MonitoringPage.class")
exclude ("chat/ros/testing2/data/SettingsData.class")
exclude ("chat/ros/testing2/server/settings/**")
enabled = true
}
dependencies {
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.6.0'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.6.0'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.6.0'
// https://mvnrepository.com/artifact/org.junit/junit5-engine
compile group: 'org.junit', name: 'junit5-engine', version: '5.0.0-ALPHA'
// https://mvnrepository.com/artifact/org.junit.platform/junit-platform-runner
testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: '1.6.1'
//dependencies for selenium
// https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
// https://mvnrepository.com/artifact/com.codeborne/selenide
compile group: 'com.codeborne', name: 'selenide', version: '5.4.1'
// https://mvnrepository.com/artifact/ru.stqa.selenium/webdriver-factory
compile group: 'ru.stqa.selenium', name: 'webdriver-factory', version: '4.3'
//dependencies for reporting
// https://mvnrepository.com/artifact/io.qameta.allure/allure-junit5
testCompile group: 'io.qameta.allure', name: 'allure-junit5', version: '2.13.1'
// https://mvnrepository.com/artifact/io.qameta.allure/allure-junit-platform
compile group: 'io.qameta.allure', name: 'allure-junit-platform', version: '2.13.1'
// https://mvnrepository.com/artifact/io.qameta.allure/allure-selenide
compile group: 'io.qameta.allure', name: 'allure-selenide', version: '2.13.1'
// https://mvnrepository.com/artifact/ru.yandex.qatools.ashot/ashot
compile group: 'ru.yandex.qatools.ashot', name: 'ashot', version: '1.5.4'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '2.0.0-alpha1'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '2.0.0-alpha1'
//Dependencies for connect ssh
// https://mvnrepository.com/artifact/com.jcraft/jsch
compile group: 'com.jcraft', name: 'jsch', version: '0.1.55'
}
allure {
version = '2.8.1'
autoconfigure = true
aspectjweaver = true
downloadLink = 'https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.8.1/allure-commandline-2.8.1.zip'
useJUnit5 {
version = '2.13.1'
}
}
test {
useJUnitPlatform()
dependsOn 'cleanTest'
// Show test results.
testLogging {
events "passed", "skipped", "failed"
}
}