Skip to content

Instantly share code, notes, and snippets.

View Legionivo's full-sized avatar
🐈

Andrii Konovka Legionivo

🐈
View GitHub Profile
@Legionivo
Legionivo / TestRailReportExtension.java
Last active June 2, 2020 07:36
TestRail extension which reports test run results to TestRail and creates test run for each configuration related to some test plan.
public class TestRailReportExtension implements TestWatcher, BeforeAllCallback {
private static boolean started = false;
private static final String TESTRAIL_REPORT = "TEST_RAIL";
private static List<Result> results = new CopyOnWriteArrayList<>();
@Override
public void testDisabled(ExtensionContext extensionContext, Optional<String> optional) {
addResult(extensionContext, TestRailStatus.DISABLED);
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'org.junit.jupiter:junit-jupiter:5.6.2'
implementation 'com.github.legionivo:testrail-api-java-client:1.0.7'
}
test {
useJUnitPlatform()
testLogging {
@Legionivo
Legionivo / TestRailReportExtension.java
Last active February 24, 2020 14:35
TestRail extension which reports test run results to TestRail and creates a basic test run which is not part of any test plan.
public class TestRailReportExtension implements TestWatcher, BeforeAllCallback {
private static boolean started = false;
private static final String TESTRAIL_REPORT = "TEST_RAIL";
private static List<Result> results = new CopyOnWriteArrayList<>();
@Override
public void testDisabled(ExtensionContext extensionContext, Optional<String> optional) {
/**
* Custom Extension which executes code only once before all tests are started and after all tests finished.
* This is temporary solution until https://github.com/junit-team/junit5/issues/456 will not be released
*/
public class SystemSetupExtension implements BeforeAllCallback, ExtensionContext.Store.CloseableResource {
private static boolean systemReady = false;
/**