11package io .qameta .allure ;
22
3+ import io .qameta .allure .model .Label ;
34import io .qameta .allure .model .Stage ;
45import io .qameta .allure .model .Status ;
56import io .qameta .allure .model .StatusDetails ;
@@ -35,8 +36,24 @@ public static AllureLifecycle getLifecycle() {
3536 return lifecycle ;
3637 }
3738
39+ public static void addLabels (final Label ... labels ) {
40+ getLifecycle ().updateTestCase (testResult -> testResult .withLabels (labels ));
41+ }
42+
43+ public static void addLinks (final io .qameta .allure .model .Link ... links ) {
44+ getLifecycle ().updateTestCase (testResult -> testResult .withLinks (links ));
45+ }
46+
47+ public static void addDescription (final String description ) {
48+ getLifecycle ().updateExecutable (executable -> executable .withDescription (description ));
49+ }
50+
51+ public static void addDescriptionHtml (final String descriptionHtml ) {
52+ getLifecycle ().updateExecutable (executable -> executable .withDescriptionHtml (descriptionHtml ));
53+ }
54+
3855 public static void addStep (final String name ) {
39- lifecycle .addStep (new StepResult ()
56+ getLifecycle () .addStep (new StepResult ()
4057 .withName (name )
4158 .withStart (System .currentTimeMillis ())
4259 .withStop (System .currentTimeMillis ())
@@ -46,7 +63,7 @@ public static void addStep(final String name) {
4663 }
4764
4865 public static void addStep (final String name , final Status status , final StatusDetails statusDetails ) {
49- lifecycle .addStep (new StepResult ()
66+ getLifecycle () .addStep (new StepResult ()
5067 .withName (name )
5168 .withStart (System .currentTimeMillis ())
5269 .withStop (System .currentTimeMillis ())
@@ -57,27 +74,27 @@ public static void addStep(final String name, final Status status, final StatusD
5774 }
5875
5976 public static void addAttachment (final String name , final String content ) {
60- lifecycle .addAttachment (name , TEXT_PLAIN , TXT_EXTENSION , content .getBytes (StandardCharsets .UTF_8 ));
77+ getLifecycle () .addAttachment (name , TEXT_PLAIN , TXT_EXTENSION , content .getBytes (StandardCharsets .UTF_8 ));
6178 }
6279
6380 public static void addAttachment (final String name , final String type , final String content ) {
64- lifecycle .addAttachment (name , type , TXT_EXTENSION , content .getBytes (StandardCharsets .UTF_8 ));
81+ getLifecycle () .addAttachment (name , type , TXT_EXTENSION , content .getBytes (StandardCharsets .UTF_8 ));
6582 }
6683
6784 @ SuppressWarnings ("PMD.UseObjectForClearerAPI" )
6885 public static void addAttachment (final String name , final String type ,
6986 final String content , final String fileExtension ) {
70- lifecycle .addAttachment (name , type , fileExtension , content .getBytes (StandardCharsets .UTF_8 ));
87+ getLifecycle () .addAttachment (name , type , fileExtension , content .getBytes (StandardCharsets .UTF_8 ));
7188 }
7289
7390 public static void addAttachment (final String name , final InputStream content ) {
74- lifecycle .addAttachment (name , null , null , content );
91+ getLifecycle () .addAttachment (name , null , null , content );
7592 }
7693
7794 @ SuppressWarnings ("PMD.UseObjectForClearerAPI" )
7895 public static void addAttachment (final String name , final String type ,
7996 final InputStream content , final String fileExtension ) {
80- lifecycle .addAttachment (name , type , fileExtension , content );
97+ getLifecycle () .addAttachment (name , type , fileExtension , content );
8198 }
8299
83100 public static CompletableFuture <byte []> addByteAttachmentAsync (
@@ -87,9 +104,9 @@ public static CompletableFuture<byte[]> addByteAttachmentAsync(
87104
88105 public static CompletableFuture <byte []> addByteAttachmentAsync (
89106 final String name , final String type , final String fileExtension , final Supplier <byte []> body ) {
90- final String source = lifecycle .prepareAttachment (name , type , fileExtension );
107+ final String source = getLifecycle () .prepareAttachment (name , type , fileExtension );
91108 return supplyAsync (body ).whenComplete ((result , ex ) ->
92- lifecycle .writeAttachment (source , new ByteArrayInputStream (result )));
109+ getLifecycle () .writeAttachment (source , new ByteArrayInputStream (result )));
93110 }
94111
95112 public static CompletableFuture <InputStream > addStreamAttachmentAsync (
0 commit comments