From 241cc20f66c229d138616afc7a0e1a04664cb9dc Mon Sep 17 00:00:00 2001 From: savkk Date: Sat, 31 Dec 2022 01:34:33 +0300 Subject: [PATCH] added QaseId and QaseTitle annotations --- pom.xml | 2 +- qase-api/README.md | 2 +- qase-api/pom.xml | 2 +- .../java/io/qase/api/annotation/CaseId.java | 4 +++ .../io/qase/api/annotation/CaseTitle.java | 3 +++ .../java/io/qase/api/annotation/QaseId.java | 10 ++++++++ .../io/qase/api/annotation/QaseTitle.java | 11 ++++++++ .../io/qase/api/services/Attachments.java | 12 +++------ .../io/qase/api/utils/IntegrationUtils.java | 25 +++++++++++++++++++ .../qase/client/services/AttachmentsTest.java | 6 ++--- qase-cucumber3-jvm/README.md | 2 +- qase-cucumber3-jvm/pom.xml | 2 +- qase-cucumber4-jvm/README.md | 2 +- qase-cucumber4-jvm/pom.xml | 2 +- qase-cucumber5-jvm/README.md | 2 +- qase-cucumber5-jvm/pom.xml | 2 +- qase-junit4/README.md | 2 +- qase-junit4/pom.xml | 2 +- .../java/io/qase/junit4/QaseListener.java | 20 +++++++++++++++ .../java/io/qase/junit/samples/Failed.java | 4 +-- .../io/qase/junit/samples/FailedWithTime.java | 4 +-- .../java/io/qase/junit/samples/Multiple.java | 8 +++--- .../java/io/qase/junit/samples/NewCase.java | 4 +-- .../java/io/qase/junit/samples/Passed.java | 4 +-- .../io/qase/junit/samples/PassedWithTime.java | 4 +-- .../java/io/qase/junit/samples/WithSteps.java | 4 +-- qase-junit5/README.md | 4 +-- qase-junit5/pom.xml | 2 +- .../java/io/qase/junit5/samples/Failed.java | 4 +-- .../qase/junit5/samples/FailedWithTime.java | 4 +-- .../java/io/qase/junit5/samples/Multiple.java | 8 +++--- .../java/io/qase/junit5/samples/NewCase.java | 4 +-- .../java/io/qase/junit5/samples/Passed.java | 4 +-- .../qase/junit5/samples/PassedWithTime.java | 4 +-- .../io/qase/junit5/samples/WithSteps.java | 4 +-- qase-testng/README.md | 6 ++--- qase-testng/pom.xml | 2 +- .../java/io/qase/testng/samples/Failed.java | 4 +-- .../qase/testng/samples/FailedWithTime.java | 4 +-- .../java/io/qase/testng/samples/NewCase.java | 4 +-- .../java/io/qase/testng/samples/Passed.java | 4 +-- .../qase/testng/samples/PassedWithTime.java | 4 +-- .../io/qase/testng/samples/WithSteps.java | 4 +-- .../qase/testng/samples/WithStepsSuccess.java | 4 +-- 44 files changed, 144 insertions(+), 75 deletions(-) create mode 100644 qase-api/src/main/java/io/qase/api/annotation/QaseId.java create mode 100644 qase-api/src/main/java/io/qase/api/annotation/QaseTitle.java diff --git a/pom.xml b/pom.xml index 785abfad..c9cb1935 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ io.qase qase-java pom - 3.0.1 + 3.0.2 qase-api qase-testng diff --git a/qase-api/README.md b/qase-api/README.md index e0ddf952..32be7e98 100644 --- a/qase-api/README.md +++ b/qase-api/README.md @@ -8,7 +8,7 @@ Add the following dependency and repository to your pom.xml: io.qase qase-api - 3.0.1 + 3.0.2 ``` diff --git a/qase-api/pom.xml b/qase-api/pom.xml index 1fb339c7..83bb1ade 100644 --- a/qase-api/pom.xml +++ b/qase-api/pom.xml @@ -5,7 +5,7 @@ qase-java io.qase - 3.0.1 + 3.0.2 4.0.0 diff --git a/qase-api/src/main/java/io/qase/api/annotation/CaseId.java b/qase-api/src/main/java/io/qase/api/annotation/CaseId.java index 5c140fa5..06f596cc 100644 --- a/qase-api/src/main/java/io/qase/api/annotation/CaseId.java +++ b/qase-api/src/main/java/io/qase/api/annotation/CaseId.java @@ -2,9 +2,13 @@ import java.lang.annotation.*; +/** + * @deprecated use {@link QaseId} instead. + */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented +@Deprecated public @interface CaseId { long value(); } diff --git a/qase-api/src/main/java/io/qase/api/annotation/CaseTitle.java b/qase-api/src/main/java/io/qase/api/annotation/CaseTitle.java index c93cf5cd..0b0f1d2d 100644 --- a/qase-api/src/main/java/io/qase/api/annotation/CaseTitle.java +++ b/qase-api/src/main/java/io/qase/api/annotation/CaseTitle.java @@ -3,6 +3,9 @@ import java.lang.annotation.*; +/** + * @deprecated use {@link QaseTitle} instead. + */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented diff --git a/qase-api/src/main/java/io/qase/api/annotation/QaseId.java b/qase-api/src/main/java/io/qase/api/annotation/QaseId.java new file mode 100644 index 00000000..bcb03c04 --- /dev/null +++ b/qase-api/src/main/java/io/qase/api/annotation/QaseId.java @@ -0,0 +1,10 @@ +package io.qase.api.annotation; + +import java.lang.annotation.*; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface QaseId { + long value(); +} diff --git a/qase-api/src/main/java/io/qase/api/annotation/QaseTitle.java b/qase-api/src/main/java/io/qase/api/annotation/QaseTitle.java new file mode 100644 index 00000000..601729b3 --- /dev/null +++ b/qase-api/src/main/java/io/qase/api/annotation/QaseTitle.java @@ -0,0 +1,11 @@ +package io.qase.api.annotation; + +import java.lang.annotation.*; + + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface QaseTitle { + String value(); +} diff --git a/qase-api/src/main/java/io/qase/api/services/Attachments.java b/qase-api/src/main/java/io/qase/api/services/Attachments.java index dca629a6..8461677b 100644 --- a/qase-api/src/main/java/io/qase/api/services/Attachments.java +++ b/qase-api/src/main/java/io/qase/api/services/Attachments.java @@ -2,7 +2,7 @@ import io.qase.api.CasesStorage; import io.qase.api.StepStorage; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.api.annotation.Step; import io.qase.api.config.QaseConfig; import io.qase.api.exceptions.QaseException; @@ -13,11 +13,7 @@ import io.qase.guice.Injectors; import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Optional; +import java.util.*; import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -28,7 +24,7 @@ public class Attachments { /** * Adds attachments to the current context. - * The context could be either {@link io.qase.api.annotation.CaseId} or {@link io.qase.api.annotation.Step} + * The context could be either {@link io.qase.api.annotation.QaseId} or {@link io.qase.api.annotation.Step} * * @throws QaseException if the invocation context can not be found * */ @@ -92,7 +88,7 @@ private static AttachmentContext lookupCurrentContext() { return AttachmentContext.TEST_CASE; } throw new UncheckedQaseException(new QaseException(String.format( - "It is expected either %s or %s-annotated method be called.", Step.class.getName(), CaseId.class.getName() + "It is expected either %s or %s-annotated method be called.", Step.class.getName(), QaseId.class.getName() ))); } diff --git a/qase-api/src/main/java/io/qase/api/utils/IntegrationUtils.java b/qase-api/src/main/java/io/qase/api/utils/IntegrationUtils.java index 83742d7c..51751927 100644 --- a/qase-api/src/main/java/io/qase/api/utils/IntegrationUtils.java +++ b/qase-api/src/main/java/io/qase/api/utils/IntegrationUtils.java @@ -2,6 +2,8 @@ import io.qase.api.annotation.CaseId; import io.qase.api.annotation.CaseTitle; +import io.qase.api.annotation.QaseId; +import io.qase.api.annotation.QaseTitle; import java.io.PrintWriter; import java.io.StringWriter; @@ -24,6 +26,10 @@ public static String getStacktrace(Throwable throwable) { } public static Long getCaseId(Method method) { + Long qaseId = getQaseId(method); + if (qaseId != null) { + return qaseId; + } if (method.isAnnotationPresent(CaseId.class)) { return method .getDeclaredAnnotation(CaseId.class).value(); @@ -32,9 +38,28 @@ public static Long getCaseId(Method method) { } public static String getCaseTitle(Method method) { + String qaseTitle = getQaseTitle(method); + if (qaseTitle != null) { + return qaseTitle; + } if (method.isAnnotationPresent(CaseTitle.class)) { return method.getDeclaredAnnotation(CaseTitle.class).value(); } return null; } + + private static Long getQaseId(Method method) { + if (method.isAnnotationPresent(QaseId.class)) { + return method + .getDeclaredAnnotation(QaseId.class).value(); + } + return null; + } + + private static String getQaseTitle(Method method) { + if (method.isAnnotationPresent(QaseTitle.class)) { + return method.getDeclaredAnnotation(QaseTitle.class).value(); + } + return null; + } } diff --git a/qase-api/src/test/java/io/qase/client/services/AttachmentsTest.java b/qase-api/src/test/java/io/qase/client/services/AttachmentsTest.java index ea3521a1..809940ad 100644 --- a/qase-api/src/test/java/io/qase/client/services/AttachmentsTest.java +++ b/qase-api/src/test/java/io/qase/client/services/AttachmentsTest.java @@ -4,7 +4,7 @@ import com.google.gson.Gson; import io.qase.api.CasesStorage; import io.qase.api.StepStorage; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.api.annotation.Step; import io.qase.api.exceptions.QaseException; import io.qase.api.services.Attachments; @@ -73,14 +73,14 @@ public void afterEach() { stopCaseIfInProgress(); } - @CaseId(CASE_WITHOUT_STEPS_ID) + @QaseId(CASE_WITHOUT_STEPS_ID) public void caseWithAttachmentsWithoutSteps() throws QaseException { startCase(); Attachments.addAttachmentsToCurrentContext(getTestAttachments()); // No finishCase for being able to verify CaseStorage.getCurrentCase() } - @CaseId(CASE_WITH_STEPS_ID) + @QaseId(CASE_WITH_STEPS_ID) public void caseWithAttachmentsWithSteps() throws QaseException { startCase(); stepWithAttachments(); diff --git a/qase-cucumber3-jvm/README.md b/qase-cucumber3-jvm/README.md index c43fdcd8..5a8b2d88 100644 --- a/qase-cucumber3-jvm/README.md +++ b/qase-cucumber3-jvm/README.md @@ -42,7 +42,7 @@ Add the following dependency and repository to your pom.xml: io.qase qase-cucumber3-jvm - 3.0.1 + 3.0.2 diff --git a/qase-cucumber3-jvm/pom.xml b/qase-cucumber3-jvm/pom.xml index 5b6cfe95..e77da060 100644 --- a/qase-cucumber3-jvm/pom.xml +++ b/qase-cucumber3-jvm/pom.xml @@ -5,7 +5,7 @@ qase-java io.qase - 3.0.1 + 3.0.2 4.0.0 diff --git a/qase-cucumber4-jvm/README.md b/qase-cucumber4-jvm/README.md index 42f3194c..f49e8510 100644 --- a/qase-cucumber4-jvm/README.md +++ b/qase-cucumber4-jvm/README.md @@ -42,7 +42,7 @@ Add the following dependency and repository to your pom.xml: io.qase qase-cucumber4-jvm - 3.0.1 + 3.0.2 diff --git a/qase-cucumber4-jvm/pom.xml b/qase-cucumber4-jvm/pom.xml index 493ad3b8..1167a916 100644 --- a/qase-cucumber4-jvm/pom.xml +++ b/qase-cucumber4-jvm/pom.xml @@ -5,7 +5,7 @@ qase-java io.qase - 3.0.1 + 3.0.2 4.0.0 diff --git a/qase-cucumber5-jvm/README.md b/qase-cucumber5-jvm/README.md index 4c3672c0..45df7b67 100644 --- a/qase-cucumber5-jvm/README.md +++ b/qase-cucumber5-jvm/README.md @@ -42,7 +42,7 @@ Add the following dependency and repository to your pom.xml: io.qase qase-cucumber5-jvm - 3.0.1 + 3.0.2 diff --git a/qase-cucumber5-jvm/pom.xml b/qase-cucumber5-jvm/pom.xml index 60e0db2d..597b384a 100644 --- a/qase-cucumber5-jvm/pom.xml +++ b/qase-cucumber5-jvm/pom.xml @@ -5,7 +5,7 @@ qase-java io.qase - 3.0.1 + 3.0.2 4.0.0 diff --git a/qase-junit4/README.md b/qase-junit4/README.md index 54f7458b..9a3c4ed6 100644 --- a/qase-junit4/README.md +++ b/qase-junit4/README.md @@ -24,7 +24,7 @@ Add the following dependency and repository to your pom.xml: io.qase qase-junit4 - 3.0.1 + 3.0.2 test diff --git a/qase-junit4/pom.xml b/qase-junit4/pom.xml index 853fe93b..99b6e8ec 100644 --- a/qase-junit4/pom.xml +++ b/qase-junit4/pom.xml @@ -5,7 +5,7 @@ qase-java io.qase - 3.0.1 + 3.0.2 4.0.0 diff --git a/qase-junit4/src/main/java/io/qase/junit4/QaseListener.java b/qase-junit4/src/main/java/io/qase/junit4/QaseListener.java index 78759c6a..6e91377c 100644 --- a/qase-junit4/src/main/java/io/qase/junit4/QaseListener.java +++ b/qase-junit4/src/main/java/io/qase/junit4/QaseListener.java @@ -4,6 +4,8 @@ import io.qase.api.StepStorage; import io.qase.api.annotation.CaseId; import io.qase.api.annotation.CaseTitle; +import io.qase.api.annotation.QaseId; +import io.qase.api.annotation.QaseTitle; import io.qase.api.config.QaseConfig; import io.qase.api.services.QaseTestCaseListener; import io.qase.client.model.ResultCreate; @@ -101,15 +103,33 @@ private ResultCreate setupResultItem(ResultCreate resultCreate, Description desc } private Long getCaseId(Description description) { + Long qaseId = getQaseId(description); + if (qaseId != null) { + return qaseId; + } CaseId caseIdAnnotation = description.getAnnotation(CaseId.class); return caseIdAnnotation != null ? caseIdAnnotation.value() : null; } private String getCaseTitle(Description description) { + String qaseTitle = getQaseTitle(description); + if (qaseTitle != null) { + return qaseTitle; + } CaseTitle caseTitleAnnotation = description.getAnnotation(CaseTitle.class); return caseTitleAnnotation != null ? caseTitleAnnotation.value() : null; } + private Long getQaseId(Description description) { + QaseId caseIdAnnotation = description.getAnnotation(QaseId.class); + return caseIdAnnotation != null ? caseIdAnnotation.value() : null; + } + + private String getQaseTitle(Description description) { + QaseTitle caseTitleAnnotation = description.getAnnotation(QaseTitle.class); + return caseTitleAnnotation != null ? caseTitleAnnotation.value() : null; + } + private static QaseTestCaseListener createQaseListener() { return Junit4Module.getInjector().getInstance(QaseTestCaseListener.class); } diff --git a/qase-junit4/src/test/java/io/qase/junit/samples/Failed.java b/qase-junit4/src/test/java/io/qase/junit/samples/Failed.java index b21d8b56..a677a716 100644 --- a/qase-junit4/src/test/java/io/qase/junit/samples/Failed.java +++ b/qase-junit4/src/test/java/io/qase/junit/samples/Failed.java @@ -1,12 +1,12 @@ package io.qase.junit.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.Test; public class Failed { @Test - @CaseId(321) + @QaseId(321) public void failedTest() { throw new AssertionError("Error message"); } diff --git a/qase-junit4/src/test/java/io/qase/junit/samples/FailedWithTime.java b/qase-junit4/src/test/java/io/qase/junit/samples/FailedWithTime.java index 06dcbdad..0e339b59 100644 --- a/qase-junit4/src/test/java/io/qase/junit/samples/FailedWithTime.java +++ b/qase-junit4/src/test/java/io/qase/junit/samples/FailedWithTime.java @@ -1,13 +1,13 @@ package io.qase.junit.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.Test; import java.util.concurrent.TimeUnit; public class FailedWithTime { @Test - @CaseId(321) + @QaseId(321) public void failedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(2)); throw new AssertionError("Error message"); diff --git a/qase-junit4/src/test/java/io/qase/junit/samples/Multiple.java b/qase-junit4/src/test/java/io/qase/junit/samples/Multiple.java index 30037518..36b7f9a3 100644 --- a/qase-junit4/src/test/java/io/qase/junit/samples/Multiple.java +++ b/qase-junit4/src/test/java/io/qase/junit/samples/Multiple.java @@ -1,6 +1,6 @@ package io.qase.junit.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.junit.samples.steps.Steps; import org.junit.Test; @@ -9,7 +9,7 @@ public class Multiple { @Test - @CaseId(123) + @QaseId(123) public void failedWithStepsTest() { Steps steps = new Steps(); steps.successStep(); @@ -17,14 +17,14 @@ public void failedWithStepsTest() { } @Test - @CaseId(456) + @QaseId(456) public void passedWithStepsTest() { Steps steps = new Steps(); steps.successStep(); } @Test - @CaseId(321) + @QaseId(321) public void failedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(2)); throw new AssertionError("Error message"); diff --git a/qase-junit4/src/test/java/io/qase/junit/samples/NewCase.java b/qase-junit4/src/test/java/io/qase/junit/samples/NewCase.java index afb9fa77..fe1140aa 100644 --- a/qase-junit4/src/test/java/io/qase/junit/samples/NewCase.java +++ b/qase-junit4/src/test/java/io/qase/junit/samples/NewCase.java @@ -1,13 +1,13 @@ package io.qase.junit.samples; -import io.qase.api.annotation.CaseTitle; +import io.qase.api.annotation.QaseTitle; import io.qase.junit.samples.steps.Steps; import org.junit.Test; public class NewCase { @Test - @CaseTitle("Case Title") + @QaseTitle("Case Title") public void passedTest() { Steps steps = new Steps(); steps.successStep(); diff --git a/qase-junit4/src/test/java/io/qase/junit/samples/Passed.java b/qase-junit4/src/test/java/io/qase/junit/samples/Passed.java index ef845c29..c77dde53 100644 --- a/qase-junit4/src/test/java/io/qase/junit/samples/Passed.java +++ b/qase-junit4/src/test/java/io/qase/junit/samples/Passed.java @@ -1,12 +1,12 @@ package io.qase.junit.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.Test; public class Passed { @Test - @CaseId(123) + @QaseId(123) public void passedTest() { } diff --git a/qase-junit4/src/test/java/io/qase/junit/samples/PassedWithTime.java b/qase-junit4/src/test/java/io/qase/junit/samples/PassedWithTime.java index fd3efedf..d6ba0e60 100644 --- a/qase-junit4/src/test/java/io/qase/junit/samples/PassedWithTime.java +++ b/qase-junit4/src/test/java/io/qase/junit/samples/PassedWithTime.java @@ -1,7 +1,7 @@ package io.qase.junit.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.Test; import java.util.concurrent.TimeUnit; @@ -9,7 +9,7 @@ public class PassedWithTime { @Test - @CaseId(123) + @QaseId(123) public void passedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(3)); } diff --git a/qase-junit4/src/test/java/io/qase/junit/samples/WithSteps.java b/qase-junit4/src/test/java/io/qase/junit/samples/WithSteps.java index 454f8e5c..6d154671 100644 --- a/qase-junit4/src/test/java/io/qase/junit/samples/WithSteps.java +++ b/qase-junit4/src/test/java/io/qase/junit/samples/WithSteps.java @@ -1,13 +1,13 @@ package io.qase.junit.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.junit.samples.steps.Steps; import org.junit.Test; public class WithSteps { @Test - @CaseId(123) + @QaseId(123) public void passedTest() { Steps steps = new Steps(); steps.successStep(); diff --git a/qase-junit5/README.md b/qase-junit5/README.md index 5ac41eda..0e89519d 100644 --- a/qase-junit5/README.md +++ b/qase-junit5/README.md @@ -24,7 +24,7 @@ Add the following dependency and repository to your pom.xml: io.qase qase-junit5 - 3.0.1 + 3.0.2 @@ -67,7 +67,7 @@ add the below code to build.gradle: ``` dependencies { ... - testImplementation 'io.qase:qase-junit5:3.0.1' + testImplementation 'io.qase:qase-junit5:3.0.2' } test { diff --git a/qase-junit5/pom.xml b/qase-junit5/pom.xml index 45f63ecd..10b3ec9b 100644 --- a/qase-junit5/pom.xml +++ b/qase-junit5/pom.xml @@ -5,7 +5,7 @@ qase-java io.qase - 3.0.1 + 3.0.2 4.0.0 diff --git a/qase-junit5/src/test/java/io/qase/junit5/samples/Failed.java b/qase-junit5/src/test/java/io/qase/junit5/samples/Failed.java index 899ea7ec..cefc1e56 100644 --- a/qase-junit5/src/test/java/io/qase/junit5/samples/Failed.java +++ b/qase-junit5/src/test/java/io/qase/junit5/samples/Failed.java @@ -1,12 +1,12 @@ package io.qase.junit5.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.jupiter.api.Test; public class Failed { @Test - @CaseId(321) + @QaseId(321) public void failedTest() { throw new AssertionError("Error message"); } diff --git a/qase-junit5/src/test/java/io/qase/junit5/samples/FailedWithTime.java b/qase-junit5/src/test/java/io/qase/junit5/samples/FailedWithTime.java index 1dfa8608..18959a10 100644 --- a/qase-junit5/src/test/java/io/qase/junit5/samples/FailedWithTime.java +++ b/qase-junit5/src/test/java/io/qase/junit5/samples/FailedWithTime.java @@ -1,13 +1,13 @@ package io.qase.junit5.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; public class FailedWithTime { @Test - @CaseId(321) + @QaseId(321) public void failedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(2)); throw new AssertionError("Error message"); diff --git a/qase-junit5/src/test/java/io/qase/junit5/samples/Multiple.java b/qase-junit5/src/test/java/io/qase/junit5/samples/Multiple.java index b1a5997c..8e43619e 100644 --- a/qase-junit5/src/test/java/io/qase/junit5/samples/Multiple.java +++ b/qase-junit5/src/test/java/io/qase/junit5/samples/Multiple.java @@ -1,6 +1,6 @@ package io.qase.junit5.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.junit5.samples.Steps.Steps; import org.junit.jupiter.api.Test; @@ -9,7 +9,7 @@ public class Multiple { @Test - @CaseId(123) + @QaseId(123) public void failedWithStepsTest() { Steps steps = new Steps(); steps.successStep(); @@ -17,14 +17,14 @@ public void failedWithStepsTest() { } @Test - @CaseId(456) + @QaseId(456) public void passedWithStepsTest() { Steps steps = new Steps(); steps.successStep(); } @Test - @CaseId(321) + @QaseId(321) public void failedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(2)); throw new AssertionError("Error message"); diff --git a/qase-junit5/src/test/java/io/qase/junit5/samples/NewCase.java b/qase-junit5/src/test/java/io/qase/junit5/samples/NewCase.java index 7e30c07a..03243505 100644 --- a/qase-junit5/src/test/java/io/qase/junit5/samples/NewCase.java +++ b/qase-junit5/src/test/java/io/qase/junit5/samples/NewCase.java @@ -1,13 +1,13 @@ package io.qase.junit5.samples; -import io.qase.api.annotation.CaseTitle; +import io.qase.api.annotation.QaseTitle; import io.qase.junit5.samples.Steps.Steps; import org.junit.jupiter.api.Test; public class NewCase { @Test - @CaseTitle("Case Title") + @QaseTitle("Case Title") public void passedTest() { Steps steps = new Steps(); steps.successStep(); diff --git a/qase-junit5/src/test/java/io/qase/junit5/samples/Passed.java b/qase-junit5/src/test/java/io/qase/junit5/samples/Passed.java index 6a6881bb..1352a8d7 100644 --- a/qase-junit5/src/test/java/io/qase/junit5/samples/Passed.java +++ b/qase-junit5/src/test/java/io/qase/junit5/samples/Passed.java @@ -1,12 +1,12 @@ package io.qase.junit5.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.jupiter.api.Test; public class Passed { @Test - @CaseId(123) + @QaseId(123) public void passedTest() { } diff --git a/qase-junit5/src/test/java/io/qase/junit5/samples/PassedWithTime.java b/qase-junit5/src/test/java/io/qase/junit5/samples/PassedWithTime.java index 58e8ed02..ed6465c2 100644 --- a/qase-junit5/src/test/java/io/qase/junit5/samples/PassedWithTime.java +++ b/qase-junit5/src/test/java/io/qase/junit5/samples/PassedWithTime.java @@ -1,7 +1,7 @@ package io.qase.junit5.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; @@ -9,7 +9,7 @@ public class PassedWithTime { @Test - @CaseId(123) + @QaseId(123) public void passedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(3)); } diff --git a/qase-junit5/src/test/java/io/qase/junit5/samples/WithSteps.java b/qase-junit5/src/test/java/io/qase/junit5/samples/WithSteps.java index b79af248..9a661c91 100644 --- a/qase-junit5/src/test/java/io/qase/junit5/samples/WithSteps.java +++ b/qase-junit5/src/test/java/io/qase/junit5/samples/WithSteps.java @@ -1,13 +1,13 @@ package io.qase.junit5.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.junit5.samples.Steps.Steps; import org.junit.jupiter.api.Test; public class WithSteps { @Test - @CaseId(123) + @QaseId(123) public void withStepsFailedTest() { Steps steps = new Steps(); steps.successStep(); diff --git a/qase-testng/README.md b/qase-testng/README.md index ca076558..39925d60 100644 --- a/qase-testng/README.md +++ b/qase-testng/README.md @@ -21,7 +21,7 @@ Add the following dependency to your pom.xml: io.qase qase-testng - 3.0.1 + 3.0.2 test @@ -92,7 +92,7 @@ mvn clean test -DQASE_ENABLE=true -DQASE_PROJECT_CODE=PRJ -DQASE_RUN_ID=123 -DQA ### Link autotests with test-cases -To link tests with test-cases in Qase TMS you should use annotation `@io.qase.api.annotation.CaseId`: +To link tests with test-cases in Qase TMS you should use annotation `@io.qase.api.annotation.QaseId`: ```java @Test @@ -104,7 +104,7 @@ public void someTest(){ ### TestCase as a Code -For using Test Case as a Code, you could mark your test by annotation `@io.qase.api.annotation.CaseTitle`: +For using Test Case as a Code, you could mark your test by annotation `@io.qase.api.annotation.QaseTitle`: ```java @Test diff --git a/qase-testng/pom.xml b/qase-testng/pom.xml index a6d22d1c..a691400a 100644 --- a/qase-testng/pom.xml +++ b/qase-testng/pom.xml @@ -5,7 +5,7 @@ qase-java io.qase - 3.0.1 + 3.0.2 4.0.0 diff --git a/qase-testng/src/test/java/io/qase/testng/samples/Failed.java b/qase-testng/src/test/java/io/qase/testng/samples/Failed.java index a9be6e60..c45018fe 100644 --- a/qase-testng/src/test/java/io/qase/testng/samples/Failed.java +++ b/qase-testng/src/test/java/io/qase/testng/samples/Failed.java @@ -1,12 +1,12 @@ package io.qase.testng.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.testng.annotations.Test; public class Failed { @Test - @CaseId(321) + @QaseId(321) public void failedTest() { throw new AssertionError("Error message"); } diff --git a/qase-testng/src/test/java/io/qase/testng/samples/FailedWithTime.java b/qase-testng/src/test/java/io/qase/testng/samples/FailedWithTime.java index 358d10c1..7f2d6af8 100644 --- a/qase-testng/src/test/java/io/qase/testng/samples/FailedWithTime.java +++ b/qase-testng/src/test/java/io/qase/testng/samples/FailedWithTime.java @@ -1,13 +1,13 @@ package io.qase.testng.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; public class FailedWithTime { @Test - @CaseId(321) + @QaseId(321) public void failedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(2)); throw new AssertionError("Error message"); diff --git a/qase-testng/src/test/java/io/qase/testng/samples/NewCase.java b/qase-testng/src/test/java/io/qase/testng/samples/NewCase.java index 9f05bb23..1bcd4f2e 100644 --- a/qase-testng/src/test/java/io/qase/testng/samples/NewCase.java +++ b/qase-testng/src/test/java/io/qase/testng/samples/NewCase.java @@ -1,13 +1,13 @@ package io.qase.testng.samples; -import io.qase.api.annotation.CaseTitle; +import io.qase.api.annotation.QaseTitle; import io.qase.testng.samples.steps.Steps; import org.testng.annotations.Test; public class NewCase { @Test - @CaseTitle("Case Title") + @QaseTitle("Case Title") public void passedTest() { Steps steps = new Steps(); steps.successStep(); diff --git a/qase-testng/src/test/java/io/qase/testng/samples/Passed.java b/qase-testng/src/test/java/io/qase/testng/samples/Passed.java index 32cc2765..e41457f9 100644 --- a/qase-testng/src/test/java/io/qase/testng/samples/Passed.java +++ b/qase-testng/src/test/java/io/qase/testng/samples/Passed.java @@ -1,12 +1,12 @@ package io.qase.testng.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.testng.annotations.Test; public class Passed { @Test - @CaseId(123) + @QaseId(123) public void passedTest() { } diff --git a/qase-testng/src/test/java/io/qase/testng/samples/PassedWithTime.java b/qase-testng/src/test/java/io/qase/testng/samples/PassedWithTime.java index 0b34e859..747a3b5a 100644 --- a/qase-testng/src/test/java/io/qase/testng/samples/PassedWithTime.java +++ b/qase-testng/src/test/java/io/qase/testng/samples/PassedWithTime.java @@ -1,6 +1,6 @@ package io.qase.testng.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; @@ -8,7 +8,7 @@ public class PassedWithTime { @Test - @CaseId(123) + @QaseId(123) public void passedTest() throws InterruptedException { Thread.sleep(TimeUnit.SECONDS.toMillis(3)); } diff --git a/qase-testng/src/test/java/io/qase/testng/samples/WithSteps.java b/qase-testng/src/test/java/io/qase/testng/samples/WithSteps.java index 6e2d05de..e78d141a 100644 --- a/qase-testng/src/test/java/io/qase/testng/samples/WithSteps.java +++ b/qase-testng/src/test/java/io/qase/testng/samples/WithSteps.java @@ -1,13 +1,13 @@ package io.qase.testng.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.testng.samples.steps.Steps; import org.testng.annotations.Test; public class WithSteps { @Test - @CaseId(123) + @QaseId(123) public void passedTest() { Steps steps = new Steps(); steps.successStep(); diff --git a/qase-testng/src/test/java/io/qase/testng/samples/WithStepsSuccess.java b/qase-testng/src/test/java/io/qase/testng/samples/WithStepsSuccess.java index f1aa22c6..c01807c0 100644 --- a/qase-testng/src/test/java/io/qase/testng/samples/WithStepsSuccess.java +++ b/qase-testng/src/test/java/io/qase/testng/samples/WithStepsSuccess.java @@ -1,13 +1,13 @@ package io.qase.testng.samples; -import io.qase.api.annotation.CaseId; +import io.qase.api.annotation.QaseId; import io.qase.testng.samples.steps.Steps; import org.testng.annotations.Test; public class WithStepsSuccess { @Test - @CaseId(41332) + @QaseId(41332) public void passedTest() { Steps steps = new Steps(); steps.successStep();